trying to load and use the icons inside shell32.dll to use on my form instead of loading them from a resource
invoke GetModuleHandle,CTEXT("c:\windows\system32\Shell32.DLL")
invoke GetProcAddress,eax,160 ;160 should be the "run" icon
invoke Shell_GetImageLists,offset hSysImlLarge,offset hSysImlSmall
now how do i call SHGetFileInfo to pull the small icon from the dll ?
there was a thread about this just a couple weeks ago
try searching "shell32.dll icon"
http://www.masm32.com/board/index.php?topic=12161.0
invoke SHGetFileInfo,CTEXT("c:\windows\system32\Shell32.DLL"),0,addr sfi,\
sizeof SHFILEINFO,SHGFI_SYSICONINDEX or SHGFI_ICON or SHGFI_SMALLICON
INVOKE SendDlgItemMessage,hWin,1015,STM_SETIMAGE,IMAGE_ICON,sfi.SHFILEINFO.hIcon
something like that gets me the dll's icon , im looking to get the smallest icon from the icon in the shell32.dll
i did it for the exes, but i need folder icons and the run icon for my app
(http://img190.imageshack.us/img190/7509/34019512.png)
these may help...
http://msdn.microsoft.com/en-us/library/bb760433%28VS.85%29.aspx
nice little app btw - i like it
thanx :U i do tech work and some of it involves removing spyware so i made this to help a little
i think that link is for only loading a bmp image in the toolbar
If you're just looking for a single icon, why bother with loading the image lists ? Just use LoadImage (http://msdn.microsoft.com/en-us/library/ms648045%28VS.85%29.aspx)...
invoke GetModuleHandle,CTEXT("c:\windows\system32\Shell32.DLL")
invoke LoadImage, eax, 160, IMAGE_ICON, NULL, NULL, LR_SHARED
mov [hIcon],eax
Note that you should always use the LR_SHARED flag when using images from system files.
For an example of using the system image lists you can look at my WinExplorer example on my website.
awesome i just found your site earlier and downloaded it
invoke GetModuleHandle,CTEXT("c:\windows\system32\Shell32.DLL")
invoke LoadImage, eax, 160, IMAGE_ICON, 16, 16, LR_SHARED
INVOKE SendDlgItemMessage,hWin,1015,STM_SETIMAGE,IMAGE_ICON,eax
works like a charm :dance:
quick question if i had an icon as a resource in my program and wantedto loadit the same way would i use
invoke LoadIcon,hInstance,300
invoke SendDlgItemMessage,hWin,1022,STM_SETIMAGE,IMAGE_ICON, eax
is there any way to allow me to choose to size it 16x16 small
ah i figured it out :U
invoke LoadImage, hInstance, 300, IMAGE_ICON, 16, 16, LR_SHARED
mov [win],eax
INVOKE SendDlgItemMessage,hWin,1023,STM_SETIMAGE,IMAGE_ICON, [win]