You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, download files, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
If you are new to .NET CF programming, most likely one of the issues that will cause you to pull your hair out is dealing with ICONs. :? Why does something so small cause so much trouble? Well, because for each icon you want to display, you gotta make two! One big one for the Program directory and a small one for the start menu/folder. Along with those headaches is attaching the ICON to your program.
But what about documents dependent upon your program? How do you attach an icon associated with the document in your application?
Well, that's what Alex Feinman answers in his latest article over at OpenNETCF Creating Icon object from Win32 icon handle in .NET Compact Framework. "One of the commonly asked questions related to Compact Framework interoperability with the native OS is how to obtain an Icon object given HICON. For example, you want to display an icon associated with the document in your application. You can retrieve HICON using ExtractIconEx or SHGetFileInfo, but what next? The only Icon constructor implemented in CF takes a stream that is expected to contain an .ico file. This means that we need to rebuild the .ico file from an icon handle."