Jump to content
Sign in to follow this  
Aktonius

List Icons from icon file like shell32

Recommended Posts

Aktonius

I was looking for a picture with map that would reflect my icon numbers from shell32.dll but i didnt get much luck, on the end i created this simple script to list icons and show me exact index of icon that i need.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
$gui = GUICreate("Icon Demo", 980, 900, 260, 174)
GUISetState(@SW_SHOW)

$left = 10
$top = 10

for $icon = 1 to 555
    $Button1 = GUICtrlCreateButton("", $left, $top, 27, 25, $BS_ICON)
    GUICtrlSetImage(-1, "shell32.dll", $icon, 0)
    $index = GUICtrlCreateLabel($icon, $left+3, $top + 27, 25, 25)
    If Mod( $icon, 30) = 0 Then
        $top += 42
        $left = 10
        ContinueLoop
    EndIf

    $left += 32

Next

do
until GUIGetMsg() = $GUI_EVENT_CLOSE
Edited by Aktonius

Share this post


Link to post
Share on other sites
Yashied
Yashied
Aktonius

@gcue

Thanks

@Yashied

Thats very nice work , my small example probably cant compare with that but it was just something tiny and funny but practical that i wanted to show. Wasnt meant to be an icon choser udf or something like that.

And yeah i know index doesnt start at 1 but couldnt bother to make gui look ok with it.

Also its good example how to create dynamic gui when you need it.

Edited by Aktonius

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  

×