Jump to content



Photo

IconChooser UDF


  • Please log in to reply
7 replies to this topic

#1 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,647 posts

Posted 09 May 2011 - 11:40 AM

LAST VERSION - 1.1
13-May-11

This library contains only one function which displays a dialog box that allows the user to choose an icon from the selection available embedded in a resource such as an executable or DLL file. Of course, there is a PickIconDlg() API function but the dialog box created by this library has the following advantages:
  • Ability to resize the displayed icons.
  • Ability to resize the dialog box.
  • Ability to save the window's settings (size, position, etc.) in the registry.
  • Fully customizable appearance a dialog box.
  • More pleasing appearance.

IMPORTANT This library registers the following Windows Message (WM):

WM_COMMAND
WM_CONTEXTMENU
WM_GETMINMAXINFO
WM_NOTIFY
WM_SYSCOMMAND

If you use in your code one of these messages, you should call handlers from this library until returns from your handlers, otherwise, the dialog box will not work properly, for example:

Func MY_WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)     Local $Result = IC_WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)     If $Result <> $GUI_RUNDEFMSG Then         Return $Result     EndIf     ... EndFunc

As usualy, I will be glad to any feedback and suggestions.

 

IconChooser.png



IconChooser UDF Library v1.1
Previous downloads: 71

Attached File  IconChooser.au3   38.44KB   1101 downloads


Example

#Include <IconChooser.au3> Global $Ico[2] = [@SystemDir & '\shell32.dll', 23] $hForm = GUICreate('MyGUI', 160, 160) $Button = GUICtrlCreateButton('Change Icon...', 25, 130, 110, 23) $Icon = GUICtrlCreateIcon($Ico[0], -(1 + $Ico[1]), 64, 50, 32, 32) GUISetState() While 1     Switch GUIGetMsg()         Case -3             ExitLoop         Case $Button             $Data = _IconChooserDialog($Ico[0], $Ico[1], 32, -1, $hForm)             If IsArray($Data) Then                 GUICtrlSetImage($Icon, $Data[0], -(1 + $Data[1]))                 $Ico = $Data             EndIf     EndSwitch WEnd

Edited by Yashied, 10 December 2013 - 02:50 PM.

iKey [color=#FF8C00;]|[/color] FTP Uploader [color=#FF8C00;]|[/color] Battery Checker [color=#FF8C00;]|[/color] Boot Manager [color=#FF8C00;]|[/color] Font Viewer [color=#FF8C00;]|[/color] UDF Keyword Manager [color=#FF8C00;]|[/color] Run Dialog Replacement [color=#FF8C00;]|[/color] USBProtect [color=#FF8C00;]|[/color] 3D Axis [color=#FF8C00;]|[/color] Calculator [color=#FF8C00;]|[/color] Sleep [color=#FF8C00;]|[/color] iSwitcher [color=#FF8C00;]|[/color] TM [color=#FF8C00;]|[/color] NetHelper [color=#FF8C00;]|[/color] File Types Manager [color=#FF8C00;]|[/color] Control Viewer [color=#FF8C00;]|[/color] SynFolders [color=#FF8C00;]|[/color] DLL Helper

Animated Tray Icons UDF Library [color=#FF8C00;]|[/color] Hotkeys UDF Library [color=#FF8C00;]|[/color] Hotkeys Input Control UDF Library [color=#FF8C00;]|[/color] Caret Shape UDF Library [color=#FF8C00;]|[/color] Context Help UDF Library [color=#FF8C00;]|[/color] Most Recently Used List UDF Library [color=#FF8C00;]|[/color] Icons UDF Library [color=#FF8C00;]|[/color] FTP UDF Library [color=#FF8C00;]|[/color] Script Communications UDF Library [color=#FF8C00;]|[/color] Color Chooser UDF Library [color=#FF8C00;]|[/color] Color Picker Control UDF Library [color=#FF8C00;]|[/color] IPHelper (Vista/7) UDF Library [color=#FF8C00;]|[/color] WinAPI Extended UDF Library [color=#FF8C00;]|[/color] WinAPIVhd UDF Library [color=#FF8C00;]|[/color] Icon Chooser UDF Library [color=#FF8C00;]|[/color] Copy UDF Library [color=#FF8C00;]|[/color] Restart UDF Library [color=#FF8C00;]|[/color] Event Log UDF Library [color=#FF8C00;]|[/color] NotifyBox UDF Library [color=#FF8C00;]|[/color] Pop-up Windows UDF Library [color=#FF8C00;]|[/color] TVExplorer UDF Library [color=#FF8C00;]|[/color] GuiHotKey UDF Library [color=#FF8C00;]|[/color] GuiSysLink UDF Library [color=#FF8C00;]|[/color] Package UDF Library [color=#FF8C00;]|[/color] Skin UDF Library [color=#FF8C00;]|[/color] AITray UDF Library [color=#FF8C00;]|[/color] RDC UDF Library

Appropriate path [color=#FF8C00;]|[/color] Button text color [color=#FF8C00;]|[/color] Gaussian random numbers [color=#FF8C00;]|[/color] Header's styles (Vista/7) [color=#FF8C00;]|[/color] ICON resource enumeration [color=#FF8C00;]|[/color] Menu & INI [color=#FF8C00;]|[/color] Tabbed string size [color=#FF8C00;]|[/color] Tab's skin [color=#FF8C00;]|[/color] Pop-up circular menu [color=#FF8C00;]|[/color] Progress Bar without animation (Vista/7) [color=#FF8C00;]|[/color] Registry export [color=#FF8C00;]|[/color] Registry path jumping [color=#FF8C00;]|[/color] Unique hardware ID [color=#FF8C00;]|[/color] Windows alignment

More...

Posted Image








#2 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,704 posts

Posted 09 May 2011 - 12:00 PM

Interesting, but FYI there seems to be lots of problems on x64.

The relosution dropdown, and the gui's icon isn't replaced. Probably more, but I don't have time to go over it all now, was just on my way out.

Question: If your main OS isn't x64, then why don't you install a vm so you can test stuff yourself instead of rely on my sleep-deprived reports? :unsure:
(I like VMware Workstation)

#3 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,993 posts

Posted 09 May 2011 - 03:03 PM

Very nice, it will help me in choosing an icon for programs I create. Previously I'd just loop through them until I saw one I liked. Now I can pick one out a LOT easier. :unsure:

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

[color=rgb(255,140,0);]Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude[/color]

 

How to ask questions the smart way!

 

[color=rgb(255,0,0);]Back up and restore Windows user files[/color] [color=rgb(255,0,0);]_Array.au3[/color] - Modified array functions that include support for 2D arrays.[color=rgb(255,0,0);]ColorChooser[/color] - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
[color=rgb(255,0,0);]Customizable Splashscreen GUI w/Progress Bar[/color] - Create a custom "splash screen" GUI with a progress bar and custom label.
[color=rgb(255,0,0);]_FileGetProperty[/color] - Retrieve the properties of a file [color=rgb(255,0,0);]SciTE Toolbar[/color] - A toolbar demo for use with the SciTE editor[color=rgb(255,0,0);]GUIRegisterMsg demo[/color] - Demo script to show how to use the Windows messages to interact with controls and your GUI.
[color=rgb(255,0,0);]GUIToolTip UDF Demo[/color] - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

[color=rgb(0,128,0);]I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.[/color]


#4 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,647 posts

Posted 09 May 2011 - 03:18 PM

Interesting, but FYI there seems to be lots of problems on x64.

It's the same problem as here.

$tagNMITEMACTIVATE = $tagNMHDR & ';uint Aligment;int Index;int SubItem;uint NewState;uint OldState;uint Changed;int X;int Y;lparam lParam;uint KeyFlags'

Fixed.

iKey [color=#FF8C00;]|[/color] FTP Uploader [color=#FF8C00;]|[/color] Battery Checker [color=#FF8C00;]|[/color] Boot Manager [color=#FF8C00;]|[/color] Font Viewer [color=#FF8C00;]|[/color] UDF Keyword Manager [color=#FF8C00;]|[/color] Run Dialog Replacement [color=#FF8C00;]|[/color] USBProtect [color=#FF8C00;]|[/color] 3D Axis [color=#FF8C00;]|[/color] Calculator [color=#FF8C00;]|[/color] Sleep [color=#FF8C00;]|[/color] iSwitcher [color=#FF8C00;]|[/color] TM [color=#FF8C00;]|[/color] NetHelper [color=#FF8C00;]|[/color] File Types Manager [color=#FF8C00;]|[/color] Control Viewer [color=#FF8C00;]|[/color] SynFolders [color=#FF8C00;]|[/color] DLL Helper

Animated Tray Icons UDF Library [color=#FF8C00;]|[/color] Hotkeys UDF Library [color=#FF8C00;]|[/color] Hotkeys Input Control UDF Library [color=#FF8C00;]|[/color] Caret Shape UDF Library [color=#FF8C00;]|[/color] Context Help UDF Library [color=#FF8C00;]|[/color] Most Recently Used List UDF Library [color=#FF8C00;]|[/color] Icons UDF Library [color=#FF8C00;]|[/color] FTP UDF Library [color=#FF8C00;]|[/color] Script Communications UDF Library [color=#FF8C00;]|[/color] Color Chooser UDF Library [color=#FF8C00;]|[/color] Color Picker Control UDF Library [color=#FF8C00;]|[/color] IPHelper (Vista/7) UDF Library [color=#FF8C00;]|[/color] WinAPI Extended UDF Library [color=#FF8C00;]|[/color] WinAPIVhd UDF Library [color=#FF8C00;]|[/color] Icon Chooser UDF Library [color=#FF8C00;]|[/color] Copy UDF Library [color=#FF8C00;]|[/color] Restart UDF Library [color=#FF8C00;]|[/color] Event Log UDF Library [color=#FF8C00;]|[/color] NotifyBox UDF Library [color=#FF8C00;]|[/color] Pop-up Windows UDF Library [color=#FF8C00;]|[/color] TVExplorer UDF Library [color=#FF8C00;]|[/color] GuiHotKey UDF Library [color=#FF8C00;]|[/color] GuiSysLink UDF Library [color=#FF8C00;]|[/color] Package UDF Library [color=#FF8C00;]|[/color] Skin UDF Library [color=#FF8C00;]|[/color] AITray UDF Library [color=#FF8C00;]|[/color] RDC UDF Library

Appropriate path [color=#FF8C00;]|[/color] Button text color [color=#FF8C00;]|[/color] Gaussian random numbers [color=#FF8C00;]|[/color] Header's styles (Vista/7) [color=#FF8C00;]|[/color] ICON resource enumeration [color=#FF8C00;]|[/color] Menu & INI [color=#FF8C00;]|[/color] Tabbed string size [color=#FF8C00;]|[/color] Tab's skin [color=#FF8C00;]|[/color] Pop-up circular menu [color=#FF8C00;]|[/color] Progress Bar without animation (Vista/7) [color=#FF8C00;]|[/color] Registry export [color=#FF8C00;]|[/color] Registry path jumping [color=#FF8C00;]|[/color] Unique hardware ID [color=#FF8C00;]|[/color] Windows alignment

More...

Posted Image


#5 JScript

JScript

    I'm back ... I miss, why not!

  • Active Members
  • PipPipPipPipPipPip
  • 1,232 posts

Posted 09 May 2011 - 05:15 PM

Wonderful!!!Much better than the native function in Windows...
http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)
Spoiler

Posted Image[color=#000000;]Download Dropbox[/color] - Simplify your life!
Your virtual HD wherever you go, anywhere!


#6 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,647 posts

Posted 13 May 2011 - 05:57 PM

The library has been updated to version 1.1.

Changes

  • Added icon cache (speeds up the display a few times), use $IC_FLAG_USECACHE flag. All cached icons are located in a temporary directory in the following format:

    %TEMP%\IC-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.cache
  • Improved logic save the window's parameters to the registry.
  • Improved alignment of the dialog window to the parent window in Windows Vista+.
  • Added a hotkey F5 to refresh the icons.
  • Fixed minor bugs in the code.

iKey [color=#FF8C00;]|[/color] FTP Uploader [color=#FF8C00;]|[/color] Battery Checker [color=#FF8C00;]|[/color] Boot Manager [color=#FF8C00;]|[/color] Font Viewer [color=#FF8C00;]|[/color] UDF Keyword Manager [color=#FF8C00;]|[/color] Run Dialog Replacement [color=#FF8C00;]|[/color] USBProtect [color=#FF8C00;]|[/color] 3D Axis [color=#FF8C00;]|[/color] Calculator [color=#FF8C00;]|[/color] Sleep [color=#FF8C00;]|[/color] iSwitcher [color=#FF8C00;]|[/color] TM [color=#FF8C00;]|[/color] NetHelper [color=#FF8C00;]|[/color] File Types Manager [color=#FF8C00;]|[/color] Control Viewer [color=#FF8C00;]|[/color] SynFolders [color=#FF8C00;]|[/color] DLL Helper

Animated Tray Icons UDF Library [color=#FF8C00;]|[/color] Hotkeys UDF Library [color=#FF8C00;]|[/color] Hotkeys Input Control UDF Library [color=#FF8C00;]|[/color] Caret Shape UDF Library [color=#FF8C00;]|[/color] Context Help UDF Library [color=#FF8C00;]|[/color] Most Recently Used List UDF Library [color=#FF8C00;]|[/color] Icons UDF Library [color=#FF8C00;]|[/color] FTP UDF Library [color=#FF8C00;]|[/color] Script Communications UDF Library [color=#FF8C00;]|[/color] Color Chooser UDF Library [color=#FF8C00;]|[/color] Color Picker Control UDF Library [color=#FF8C00;]|[/color] IPHelper (Vista/7) UDF Library [color=#FF8C00;]|[/color] WinAPI Extended UDF Library [color=#FF8C00;]|[/color] WinAPIVhd UDF Library [color=#FF8C00;]|[/color] Icon Chooser UDF Library [color=#FF8C00;]|[/color] Copy UDF Library [color=#FF8C00;]|[/color] Restart UDF Library [color=#FF8C00;]|[/color] Event Log UDF Library [color=#FF8C00;]|[/color] NotifyBox UDF Library [color=#FF8C00;]|[/color] Pop-up Windows UDF Library [color=#FF8C00;]|[/color] TVExplorer UDF Library [color=#FF8C00;]|[/color] GuiHotKey UDF Library [color=#FF8C00;]|[/color] GuiSysLink UDF Library [color=#FF8C00;]|[/color] Package UDF Library [color=#FF8C00;]|[/color] Skin UDF Library [color=#FF8C00;]|[/color] AITray UDF Library [color=#FF8C00;]|[/color] RDC UDF Library

Appropriate path [color=#FF8C00;]|[/color] Button text color [color=#FF8C00;]|[/color] Gaussian random numbers [color=#FF8C00;]|[/color] Header's styles (Vista/7) [color=#FF8C00;]|[/color] ICON resource enumeration [color=#FF8C00;]|[/color] Menu & INI [color=#FF8C00;]|[/color] Tabbed string size [color=#FF8C00;]|[/color] Tab's skin [color=#FF8C00;]|[/color] Pop-up circular menu [color=#FF8C00;]|[/color] Progress Bar without animation (Vista/7) [color=#FF8C00;]|[/color] Registry export [color=#FF8C00;]|[/color] Registry path jumping [color=#FF8C00;]|[/color] Unique hardware ID [color=#FF8C00;]|[/color] Windows alignment

More...

Posted Image


#7 xeroTechnologiesLLC

xeroTechnologiesLLC

    Prodigy

  • Active Members
  • PipPipPip
  • 158 posts

Posted 07 April 2012 - 05:50 PM

I know this is a bit old post, but wanted to drop in my thanks for creating this.

We are working on a project that this will fit in very nicely and wanted to express my appreciation for the skill shown here.

Very amazing work, Yashied!

#8 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,647 posts

Posted 10 December 2013 - 02:57 PM

Links updated.

P.S.

If you can't download my programs in other posts please change address:

http://yashied.narod2.ru/

to

http://yashied.ru/

iKey [color=#FF8C00;]|[/color] FTP Uploader [color=#FF8C00;]|[/color] Battery Checker [color=#FF8C00;]|[/color] Boot Manager [color=#FF8C00;]|[/color] Font Viewer [color=#FF8C00;]|[/color] UDF Keyword Manager [color=#FF8C00;]|[/color] Run Dialog Replacement [color=#FF8C00;]|[/color] USBProtect [color=#FF8C00;]|[/color] 3D Axis [color=#FF8C00;]|[/color] Calculator [color=#FF8C00;]|[/color] Sleep [color=#FF8C00;]|[/color] iSwitcher [color=#FF8C00;]|[/color] TM [color=#FF8C00;]|[/color] NetHelper [color=#FF8C00;]|[/color] File Types Manager [color=#FF8C00;]|[/color] Control Viewer [color=#FF8C00;]|[/color] SynFolders [color=#FF8C00;]|[/color] DLL Helper

Animated Tray Icons UDF Library [color=#FF8C00;]|[/color] Hotkeys UDF Library [color=#FF8C00;]|[/color] Hotkeys Input Control UDF Library [color=#FF8C00;]|[/color] Caret Shape UDF Library [color=#FF8C00;]|[/color] Context Help UDF Library [color=#FF8C00;]|[/color] Most Recently Used List UDF Library [color=#FF8C00;]|[/color] Icons UDF Library [color=#FF8C00;]|[/color] FTP UDF Library [color=#FF8C00;]|[/color] Script Communications UDF Library [color=#FF8C00;]|[/color] Color Chooser UDF Library [color=#FF8C00;]|[/color] Color Picker Control UDF Library [color=#FF8C00;]|[/color] IPHelper (Vista/7) UDF Library [color=#FF8C00;]|[/color] WinAPI Extended UDF Library [color=#FF8C00;]|[/color] WinAPIVhd UDF Library [color=#FF8C00;]|[/color] Icon Chooser UDF Library [color=#FF8C00;]|[/color] Copy UDF Library [color=#FF8C00;]|[/color] Restart UDF Library [color=#FF8C00;]|[/color] Event Log UDF Library [color=#FF8C00;]|[/color] NotifyBox UDF Library [color=#FF8C00;]|[/color] Pop-up Windows UDF Library [color=#FF8C00;]|[/color] TVExplorer UDF Library [color=#FF8C00;]|[/color] GuiHotKey UDF Library [color=#FF8C00;]|[/color] GuiSysLink UDF Library [color=#FF8C00;]|[/color] Package UDF Library [color=#FF8C00;]|[/color] Skin UDF Library [color=#FF8C00;]|[/color] AITray UDF Library [color=#FF8C00;]|[/color] RDC UDF Library

Appropriate path [color=#FF8C00;]|[/color] Button text color [color=#FF8C00;]|[/color] Gaussian random numbers [color=#FF8C00;]|[/color] Header's styles (Vista/7) [color=#FF8C00;]|[/color] ICON resource enumeration [color=#FF8C00;]|[/color] Menu & INI [color=#FF8C00;]|[/color] Tabbed string size [color=#FF8C00;]|[/color] Tab's skin [color=#FF8C00;]|[/color] Pop-up circular menu [color=#FF8C00;]|[/color] Progress Bar without animation (Vista/7) [color=#FF8C00;]|[/color] Registry export [color=#FF8C00;]|[/color] Registry path jumping [color=#FF8C00;]|[/color] Unique hardware ID [color=#FF8C00;]|[/color] Windows alignment

More...

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users