SHIL_JUMBO icons

Just starting out? Need help? Post your questions and find answers here.
firace
Addict
Addict
Posts: 901
Joined: Wed Nov 09, 2011 8:58 am

SHIL_JUMBO icons

Post by firace »

For Windows API wizards: The below code works fine to view a Jumbo icon from shell32.dll, but not from imageres.dll. I'm not able to understand why...

Code: Select all

; code by: LSI

#SHIL_JUMBO = $4

DataSection
  IID_IImageList:
  Data.l $46EB5926
  Data.w $582E,$4017
  Data.b $9F,$DF,$E8,$99,$8D,$AA,$09,$50
EndDataSection 

OpenWindow(0, 233, 233, 300, 300, "Test")

; "c:\windows\system32\imageres.dll"

dll_Shell32 = OpenLibrary(#PB_Any, "Shell32.dll")

*Guid = ?IID_IImageList
CallFunction(dll_Shell32, "SHGetImageList", #SHIL_JUMBO, *Guid, @ImageList.IImageList)
ImageList\GetIcon(81, #ILD_TRANSPARENT, @hIcon)  

ImageGadget(0, 20, 20, 1, 1, hIcon)

Repeat : Until WaitWindowEvent() = 13116

wombats
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Dec 29, 2011 5:03 pm

Re: SHIL_JUMBO icons

Post by wombats »

Does this do what you want? I'm not sure about the #SHIL_JUMBO bit.

Code: Select all

OpenWindow(0, 233, 233, 300, 300, "Test")

test = ExtractIcon_(GetModuleHandle_(0), "c:\windows\system32\imageres.dll", 84)

ImageGadget(0, 20, 20, 1, 1, test)

Repeat : Until WaitWindowEvent() = 13116
firace
Addict
Addict
Posts: 901
Joined: Wed Nov 09, 2011 8:58 am

Re: SHIL_JUMBO icons

Post by firace »

wombats wrote:Does this do what you want? I'm not sure about the #SHIL_JUMBO bit.

Code: Select all

OpenWindow(0, 233, 233, 300, 300, "Test")

test = ExtractIcon_(GetModuleHandle_(0), "c:\windows\system32\imageres.dll", 84)

ImageGadget(0, 20, 20, 1, 1, test)

Repeat : Until WaitWindowEvent() = 13116

I'm afraid this technique only gets normal-sized icons, not Jumbo (256x256) icons. :(
Post Reply