Okay, I have a pointer to an array of icons being passed out by phiconLarge, and phiconSmall. How do I move through the array?Code:UINT ExtractIconEx( LPCTSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons );
I'm actually going to be trying to do this in C#
Also, does anyone know the values for these. To retrieve the dimensions of the large and small icons, use the function with the SM_CXICON, SM_CYICON, SM_CXSMICON, and SM_CYSMICON flags.Code:#region Win32 API (UnManaged) [DllImport("User32")] private static extern bool DestroyIcon( IntPtr hIcon ); [DllImport("Shell32")] private static extern uint ExtractIconEx( LPCTSTR lpszFile, int nIconIndex, IntPtr *phiconLarge, IntPtr *phiconSmall, uint nIcons ); #endregion
I don't have the needed header on my system to look it up.Code:#region Bit Flag Enumerations /// <summary> /// To retrieve the dimensions of the large and small icons, use the function with the SM_CXICON, SM_CYICON, SM_CXSMICON, and SM_CYSMICON flags. /// </summary> [Flags] enum SM { SM_CXICON, SM_CYICON, SM_CXSMICON, SM_CYSMICON } #endregion
I know this could be an API or C# thread, but I thought who better to ask than the experts... On the C# side of things though. Will releaseing the System.Drawing.Icon I plan to load from my Icon Handle sufice or should I call DestroyIcon? Or could I say open the icon from the handle draw it into a new managed icon and then destroy the icon I first opened? I'm planning to Open the Icons and throw them into an ImageList.




Reply With Quote