Jump to content
Sign in to follow this  

Retrieving information of a windows upper right corner Icon.

Recommended Posts


So I found this function posted and I was wondering how I can actually get it's resource ordinal name instead of its handle, anyone done this before?

This will get the handle to an Icon from particular windows such as explorer windows, retrieving the folder icon displayed in upper right corner apparently..

#Include <GuiListView.au3>
#include <Array.au3>
Func getIconHandleByHwnd($hwnd)
    $hwnd = HWnd($hwnd)
    $WM_GETICON = 0x7F
    $GCL_HICONSM = -34
    $GCL_HICON = -14
    $IDI_APPLICATION = 32512
    Local $hIcon = 0
    $hIcon = _SendMessage ($hwnd, $WM_GETICON, False, 0)
    If ($hIcon == 0) Then $hIcon = _SendMessage ($hwnd, $WM_GETICON, True, 0)
    If ($hIcon == 0) Then
        $hIcon = DllCall("user32.dll", "int", "GetClassLong", "hwnd", $hwnd, "int", $GCL_HICONSM)
        $hIcon = $hIcon[0]
    If ($hIcon == 0) Then
        $hIcon = DllCall("user32.dll", "int", "GetClassLong", "hwnd", $hwnd, "int", $GCL_HICON)
        $hIcon = $hIcon[0]
    Return $hIcon
EndFunc   ;==>getIconHandleByHwnd

Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

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