Hi,
Any idea why this would return NULL???
invoke LoadImage, 0, OIC_SAMPLE, IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR
Same problem for any of the OIC_xxx
This works fine:
invoke LoadIcon, 0, IDI_APPLICATION
Regards,
Shantanu
What does GetLastError return?
I cannot routinely find the reference for a constant like OIC_SAMPLE on MSDN online. Where does this come from ?
Looks like the last parameter needs LR_SHARED
invoke LoadImage, 0, OIC_SAMPLE, IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR OR LR_SHARED
Hutch, OIC_* are defined in winuser.h
Hello sinsi,
It works with LR_SHARED!!! :U :U
Another problem though...no matter what dimensions I give (16x16, 48x48) it is giving me handle to a 32x32 icon!!! :'( :'(
Any tips?
Regards,
Shantanu
Maybe an OEM icon only comes in one size?
QuotecxDesired
[in] Specifies the width, in pixels, of the icon or cursor. If this parameter is zero and the fuLoad parameter is LR_DEFAULTSIZE, the function
uses the SM_CXICON or SM_CXCURSOR system metric value to set the width. If this parameter is zero and LR_DEFAULTSIZE is not used,
the function uses the actual resource width.
Notice that the parameter is called cxDesired, your "desired" width. Windows seems to have a "close is good enough" mentality when
it comes to icons...
To sinsi,
Oh well...what to do! Thanks for the previous tip!
Regards,
Shantanu
No worries mate :U
If you do find out how to get other sizes, let us know eh?
Good luck!