Sign in to follow this  
Followers 0
Mat

Selecting Icon files From Dll's

9 posts in this topic

#1 ·  Posted (edited)

essentially I am trying to do what windows does when you decide to change icons for shortcuts on the desktop;

Posted Image

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:

Posted Image

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 fileopendialog
  • send 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
Wend

thanks

mdiesel

Edited by Mat

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Here you can find an UDF to open the native Iconpicker: http://www.autoitscript.com/forum/index.ph...st&p=581943

This 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 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

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by mdiesel

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The functions return Arrays :P $REturn[0] is the filename, $REturn[1] the IconIndex.

Edited 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

Share this post


Link to post
Share on other sites

I knew that, I was testing you :P .....

thanks, I have that working now, you've been a great help

Mdiesel

Share this post


Link to post
Share on other sites

I knew that, I was testing you :P .....

LoL Posted Image

*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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0