Aceguy Posted January 9, 2009 Share Posted January 9, 2009 (edited) #include<ButtonConstants.au3> #Include <WinAPI.au3> #include<array.au3> $hGUI = GUICreate("Form1", 200, 200, 193, 125) $Button1 = GUICtrlCreateButton("Button1", 50,50, 32, 32, $BS_ICON) GUISetState() GUICtrlSetImage($Button1,_WinAPI_ExtractIconEx(@DesktopDir&"\low.mp3", -1, 0, 0, 0)) sleep(5000) what am i doing wrong.... Edited January 9, 2009 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 9, 2009 Share Posted January 9, 2009 #include<ButtonConstants.au3> #Include <WinAPI.au3> #include<array.au3> $hGUI = GUICreate("Form1", 200, 200, 193, 125) $Button1 = GUICtrlCreateButton("Button1", 50,50, 32, 32, $BS_ICON) GUISetState() GUICtrlSetImage($Button1,_WinAPI_ExtractIconEx(@DesktopDir&"\low.mp3", -1, 0, 0, 0)) sleep(5000) what am i doing wrong.... This returns the count of icons in the file: _WinAPI_ExtractIconEx(@DesktopDir&"\low.mp3", -1, 0, 0, 0) How is that count going to work as a button image? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Aceguy Posted January 9, 2009 Author Share Posted January 9, 2009 DOH can you help me witth... DllCall("shell32.dll", "hwnd", "ExtractAssociatedIcon", "hwnd","hwnd", "str", @DesktopDir&"\low.mp3", "short*", 0) PLEASE [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Aceguy Posted January 9, 2009 Author Share Posted January 9, 2009 well, been doing lots of searching and came up wih this, tried to modify to my needs but fail... All credit goes to rasim. expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> $hGUI = GUICreate("Test GUI", 300, 200) $cMenu_File = GUICtrlCreateMenu("&File") $cMenuItem_Open = GUICtrlCreateMenuItem("Open", $cMenu_File) $cListView = GUICtrlCreateListView("Items", 10, 10, 280, 160) $hImage = _GUIImageList_Create(16, 16, 5, 3, 1) _GUICtrlListView_SetImageList($cListView, $hImage, 1) GUICtrlSendMsg($cListView, $LVM_SETCOLUMNWIDTH, 0, 200) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $cMenuItem_Open $sFile = FileOpenDialog("Select file", "", "All files (*.*)", 1, "", $hGUI) If Not @error Then $hIcon = _ExtractAssociatedIcon($hGUI, $sFile) $Index = _ImageList_AddIcon($hImage, $hIcon) _DestroyIcon($hIcon) _GUICtrlListView_InsertItem($cListView, $sFile, -1, $Index) EndIf EndSwitch WEnd Func _ExtractAssociatedIcon($hWnd, $sFile) Local $aRet = DllCall("shell32.dll", "hwnd", "ExtractAssociatedIcon", _ "hwnd", $hWnd, _ "str", $sFile, _ "short*", 0) Return $aRet[0] EndFunc ;==>_ExtractAssociatedIcon Func _ImageList_AddIcon($hImage, $hIcon) Local $aRet = DllCall("comctl32.dll", "int", "ImageList_AddIcon", _ "hwnd", $hImage, _ "hwnd", $hIcon) Return $aRet[0] EndFunc ;==>_ImageList_AddIcon Func _DestroyIcon($hIcon) Local $aRet = DllCall("user32.dll", "int", "DestroyIcon", _ "hwnd", $hIcon) Return $aRet[0] EndFunc ;==>_DestroyIcon [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now