Is there any way i can get a window's icon just by it's hWnd.
i used to execute GetWindowModuleFileName() in windows 98 for doing such thing, but it doesnt seem to be working in XP. can anybody help me ?
Posted on 2006-03-30 03:26:20 by XCHG
invoke GetClassLong, hWnd, GCL_HICON
invoke GetClassLong, hWnd, GCL_HICONSM

Bryant Keller
Posted on 2006-03-30 05:20:19 by Synfire
WM_GETICON will also work, as opposed to getting the class icon in cases where you want whatever icon has been assigned to a particular window using WM_SETICON. The other option is to use ExtractIcon and extract it directly from the application image.
Posted on 2006-03-30 07:34:36 by donkey
Synfire : i knew about the GetClassLong but in some cases the function can't either retrieve the icon or the window hasn't got an icon. but if i try finding the hWnd's executable file then i can extract it's icon.

Donkey : WM_GETICON doesn't work even on my own window which has been set an icon by WM_SETICON :roll:
Posted on 2006-03-30 13:41:36 by XCHG