Re: Use icons in shell32.dll for buttons on form?
From: Shakir Hussain (shak_at_fakedomain.com)
Date: 06/28/04
- Next message: stardv: "Override ProcessCmdKey method for DataGrid"
- Previous message: Mark G: "MFC CreateDIB and C#"
- In reply to: emde: "Use icons in shell32.dll for buttons on form?"
- Next in thread: emde: "Re: Use icons in shell32.dll for buttons on form?"
- Reply: emde: "Re: Use icons in shell32.dll for buttons on form?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 28 Jun 2004 16:16:31 -0500
Try this
[DllImport("Shell32.dll")]
public extern static int ExtractIconEx( string libName, int iconIndex,
IntPtr[] largeIcon, IntPtr[] smallIcon, int nIcons );
int numIcons = 10;//if you want 10 icons for example
IntPtr[] largeIcon = new IntPtr[numIcons ];
IntPtr[] smallIcon = new IntPtr[numIcons ];
usage -
ExtractIconEx( "shell32.dll", 0, largeIcon, smallIcon, numIcons );
//retrieve icon from array
Icon largeIico = Icon.FromHandle( largeIcon[0]);
Icon smallIco = Icon.FromHandle( smallIcon[0]);
The first parameter of ExtractIconEx can be use to get icons for exe or dll.
-- Shak (Houston) "emde" <emde@na.com> wrote in message news:#VqYzGVXEHA.1128@TK2MSFTNGP10.phx.gbl... > > Any tips on using the icons in shell32.dll as the image on a button in a > form? > > Thanks. > >
- Next message: stardv: "Override ProcessCmdKey method for DataGrid"
- Previous message: Mark G: "MFC CreateDIB and C#"
- In reply to: emde: "Use icons in shell32.dll for buttons on form?"
- Next in thread: emde: "Re: Use icons in shell32.dll for buttons on form?"
- Reply: emde: "Re: Use icons in shell32.dll for buttons on form?"
- Messages sorted by: [ date ] [ thread ]