Mat Posted March 10, 2009 Posted March 10, 2009 (edited) essentially I am trying to do what windows does when you decide to change icons for shortcuts on the desktop;This, unlike the 'enumicons' example script, needs to send messages back to the Main GUI, both the Icon file/library and the number. enumicons did do something similar to what I wanted it to do (selecting icons aswell in '...' after making the following change$sTmpFile = FileOpenDialog("Select file:", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "Executables & dll's (*.exe;*.dll;*.ocx;*.icl)[b] | Icon Files (*.ico)")[/b]this came up like this though:windows doesnt do that.the other thing it needs to do is send Information back to the control; in much the same way as fileopendialog does - only sending back the number aswell...Overall stuff it needs to do is:act like a fileopendialogsend info back to the control (numbers too)display minimal amount of icons (enumicons goes on forever...)This is a very simple script that you can use as a guidline - though if this script needs to get any bigger - i am happy for it to do so.#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI = GuiCreate ("iconselector", 100, 100) GUICtrlCreatelabel ("icon:", 10, 10, 80, 20) $input = GUICtrlCreateInput ("", 10, 40, 80, 20) $Button = GUICtrlCreateButton ("...", 10, 70, 80, 20) GUISetState () While 1 $msg = GuiGetMsg() Select case $msg = $button Msgbox (0, "???????????????", "What Goes here") Case $msg = $GUI_EVENT_CLOSE exit endselect Wendthanks mdiesel Edited June 21, 2010 by Mat AutoIt Project Listing
ProgAndy Posted March 10, 2009 Posted March 10, 2009 (edited) Here you can find an UDF to open the native Iconpicker: http://www.autoitscript.com/forum/index.ph...st&p=581943This one is written in AutoIt, but sometimes shows more icons than the file actually has: http://www.autoitscript.com/forum/index.ph...st&p=581778 Edited March 10, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Mat Posted March 10, 2009 Author Posted March 10, 2009 (edited) Thanks for the reply How can I get this to return with a text value instead of the icon itself (I'll Probably build that in aswell though)? I can't see anything in the script updating $icon.... Mdiesel PS Are those two links supposed to be the same or am I going mad? PPS I am mad - they were both in the same thread but pointed to different articles... Edited March 10, 2009 by mdiesel AutoIt Project Listing
ProgAndy Posted March 10, 2009 Posted March 10, 2009 (edited) The functions return Arrays $REturn[0] is the filename, $REturn[1] the IconIndex. Edited March 10, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Mat Posted March 10, 2009 Author Posted March 10, 2009 I knew that, I was testing you ..... thanks, I have that working now, you've been a great help Mdiesel AutoIt Project Listing
ProgAndy Posted March 10, 2009 Posted March 10, 2009 I knew that, I was testing you ..... LoL *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Mat Posted March 10, 2009 Author Posted March 10, 2009 Actually....if i then want to use that file name in the registry, shell32.dll is insufficient, it should be : shell32.dll, 3.eg:Regkey...\defaulticon\@="%SystemRoot%\system32\SHELL32.dll, 3"I did mention in my first post that I needed the numbers too, is this possible??Sorry if i'm sounding really stupid now....thanks Mdiesel AutoIt Project Listing
ProgAndy Posted March 10, 2009 Posted March 10, 2009 (edited) I said it already. The Index is in $Return[1] $Return = _PickIconDlg(@SystemDir & "\shell32.dll") $String = FileGetShortName($Return[0]) & "," & $Return[1] MsgBox(0,"",$String) Edited March 10, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Mat Posted March 10, 2009 Author Posted March 10, 2009 stupid it is then... Thanks anyway AutoIt Project Listing
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