Page 1 of 1

help me display an icon from a file

PostPosted: Feb 20, 2002 @ 7:28am
by JohnE

PostPosted: Feb 20, 2002 @ 2:42pm
by Dan East
Are you trying to get an icon from an external EXE or DLL, or from the EXE you are writing? If you want a handle to an icon in your program's resources, then use LoadIcon or LoadImage. If you want to extact icons directly form other programs, then use ExtractIconEx.

Dan East

PostPosted: Feb 20, 2002 @ 3:38pm
by JohnE
I'm hoping it is possible to load the icons from a myIcon.ico file. I would not like to be limited to a finite # of icons in a DLL or EXE.

PostPosted: Feb 20, 2002 @ 3:51pm
by Dan East

PostPosted: Feb 20, 2002 @ 8:59pm
by JohnE

PostPosted: Feb 20, 2002 @ 10:08pm
by Dan East

PostPosted: Feb 21, 2002 @ 12:07am
by JohnE

PostPosted: Feb 21, 2002 @ 12:30am
by Dan East

PostPosted: Feb 21, 2002 @ 1:16am
by JohnE

PostPosted: Feb 21, 2002 @ 3:25am
by Dan East

PostPosted: Feb 21, 2002 @ 4:36am
by JohnE
Without any change to the code (besides the path to the file) it extracted a 32x32 icon from a .dll. It appears to have a problem with .ico files.

PostPosted: Feb 21, 2002 @ 5:17am
by Dan East
Well, I'm not exactly sure the CE version supports ico files. According to the Windows CE API docs:
"This function retrieves the handle from the specified executable file or dynamic-link library (DLL)."

That differs from the description in MSDN for the regular Windows API. I have never tried extracting from ico files before. Also, if the icon you are trying to extract is 32x32, then pass the pointer to the handle as the 3rd parameter instead of the 4th.

Dan East

PostPosted: Feb 21, 2002 @ 5:33am
by JohnE
I don't know if you are fimiliar with the newly released DoobloDate but the PPC App allows users to create icon files and use them in the product. I wonder how they accomplished this?