Page 1 of 1
Retrieve embedded icon filename?
Posted: Tue Dec 02, 2014 8:07 am
by chi
With GetClassLongPtr_(hWnd, #GCL_HICON) I get the handle of the associated icon from my app... But is it possible to retrieve the original filename too? (e.g. MyIcon.ico)
Thanks in advance

Re: Retrieve embedded icon filename?
Posted: Thu Dec 04, 2014 8:17 am
by netmaestro
Not sure whether you mean any program or a PB-compiled program. I have many PB-compiled programs and I loaded one of them in a hex editor and searched for the filename of the icon the compiler was set to use when it generated the exe. Not found. So you probably can't retrieve that information from the compiled exe. The compiler would have to deliberately store it and I guess it just doesn't.
Re: Retrieve embedded icon filename?
Posted: Thu Dec 04, 2014 9:03 am
by Shield
Icons on Windows are stored in a resource section and are referenced by ID / index and not by filename.
The "filename" of the icon is basically the filename of the executable itself, so I doubt that there is a way
to retrieve it.
Re: Retrieve embedded icon filename?
Posted: Thu Dec 04, 2014 3:17 pm
by chi
Thanks to both of you for your explanations! I already searched a few files with a hex editor but couldn't find anything related to the icon name. I was hoping that there's a magic function somewhere I don't know. Guess I have to stick with "App.ico" as description
