We are stuck here between a rock and a hard place and need some guidance for a solution or workaround.
We have a popular 10 year old Win16 GUI application, which is a free GUI frontend tool our hosting customers may give to their users to connect to their hosting systems. It has worked for all of Microsoft's Windows Win32/Win16 operations systems.
Under VISTA 32 bit installations, we are hearing two problems when running the Win16 application. The 2nd one is not as critical, but the 1st one we would like the address.
While we do have plans to port the application to WIN32. we need a temporary solution today. The VISTA reports are starting to come in and we did not expect VISTA 32 bit installations to have a problems under WIN32/WIN16. I can understand VISTA 64 bit, but not VISTA 32 bit.
In short, our WIN16 GUI applet calls ExtractIcon() to extract the first icon from special and specific 16 bit EXE files. Under VISTA 32 bit, ExtractIcon() returns a NULL resource handle, thus the icon can not be displayed.
Although under the current MSDN programming reference docs, I see it does indicate ExtractIcon() will not work for 16 bit files, however, this is only true under VISTA. This was never the case before.
So I am trying to figure out why this is a problem under VISTA and if there a way to get around this problem?
I would appreciate any insight or information, technical or method we can try to resolve this problem.
Santronics Software, Inc.
From ExtractIcon's documentation (http://msdn2.microsoft.com/en-us/library/ms648068.aspx):
This function is not supported for icons in 16-bit executables and DLLs.
It doesn't say "will not work". "Not supported" means "use it at your own risk; it may be dropped in the future". It seems that the future is now.
You can try to use the LoadImage API (http://msdn2.microsoft.com/en-us/library/ms648072.aspx)
Thank you for you feedback.
In principle, when we see documentation saying "not supported", we simply don't touch it. Since this is new to the .NET/VISTA MSDN reference, not older Win32/WIN16 references, what wasn't clear was whether the "not supported" statement applied to a 64/32 bit application extracting icons from 16 bit modules only, not within a pure 16 bit to 16 bit operations, i.e. Win16 applet is using the Win16 ExtractionIcon() function to extract icons from Win16 exes and dlls.
In addition, unless we can change the OS source code, VISTA32 Explorer is not extracting the 16 bit executable icon to display the short cut image on the desktop.
Hopefully, Microsoft can see the light, be reasonable and rectified this simple concept and functionality in future updates.
Hector Santos, CTO