Re: Get Class ImageList
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Sun, 3 Sep 2006 20:48:08 +0200
"[Joe]" <Joe@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:158F3917-9C35-487F-8910-059C413331C4@xxxxxxxxxxxxxxxx
| Hi,
| How can I get the System class ImageList from C# application, I want to
| receive this image list used in device manager ?
| I find a C API :
|
| WINSETUPAPI BOOL WINAPI
| SetupDiGetClassImageList(
| OUT PSP_CLASSIMAGELIST_DATA ClassImageListData);
|
| How I can call this API from C# ?
|
| Thanks
| Joe
Not sure why you ever wanna use this from C# but here it goes:
[DllImport("setupapi.dll")]
static extern int SetupDiGetClassImageList(out PSP_CLASSIMAGE_DATA
ClassImageList);
public struct PSP_CLASSIMAGE_DATA {
public uint cbSize; // size of this struct
public IntPtr ImageList; // Handle
public uint Reserved;
}
don't forget to destroy the list when done (see
SetupDiDestroyClassImageList).
Willy.
.
- Prev by Date: Re: Octal number to int number
- Next by Date: Re: C# solution in MTS / MSMQ?
- Previous by thread: Return string from c++ dll - interop services
- Next by thread: Re: Get Class ImageList
- Index(es):
Relevant Pages
|