SetupApiSetupDiLoadDeviceIcon Method
Retrieves an icon for a specified device.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("SetupApi.dll", SetLastError = true)]
public static bool SetupDiLoadDeviceIcon(
IntPtr deviceInfoSet,
ref SetupApiDeviceInfo refDeviceInfoData,
int width,
int height,
int flags,
ref IntPtr refIcon
)
<DllImportAttribute("SetupApi.dll", SetLastError := true>]
Public Shared Function SetupDiLoadDeviceIcon (
deviceInfoSet As IntPtr,
ByRef refDeviceInfoData As SetupApiDeviceInfo,
width As Integer,
height As Integer,
flags As Integer,
ByRef refIcon As IntPtr
) As Boolean
Dim deviceInfoSet As IntPtr
Dim refDeviceInfoData As SetupApiDeviceInfo
Dim width As Integer
Dim height As Integer
Dim flags As Integer
Dim refIcon As IntPtr
Dim returnValue As Boolean
returnValue = SetupApi.SetupDiLoadDeviceIcon(deviceInfoSet,
refDeviceInfoData, width, height,
flags, refIcon)
public:
[DllImportAttribute(L"SetupApi.dll", SetLastError = true)]
static bool SetupDiLoadDeviceIcon(
IntPtr deviceInfoSet,
SetupApiDeviceInfo% refDeviceInfoData,
int width,
int height,
int flags,
IntPtr% refIcon
)
[<DllImportAttribute("SetupApi.dll", SetLastError = true)>]
static member SetupDiLoadDeviceIcon :
deviceInfoSet : IntPtr *
refDeviceInfoData : SetupApiDeviceInfo byref *
width : int *
height : int *
flags : int *
refIcon : IntPtr byref -> bool
No code example is currently available or this language may not be supported.
- deviceInfoSet IntPtr
-
A handle to the device information set that contains the device information element that represents the
device for which to retrieve an icon.
- refDeviceInfoData SetupApiDeviceInfo
-
A pointer to an SetupApiDeviceInfo structure that specifies the
device information element in deviceInfoSet parameter.
- width Int32
-
The width, in pixels, of the icon to be retrieved.
Use the system metric index SM_CXICON to specify a default-sized icon
or use the system metric index SM_CXSMICON to specify a small icon.
The system metric indexes are defined in Winuser.h,
and their associated values can be retrieved by a call to the GetSystemMetrics function.
(The GetSystemMetrics function is documented in the Microsoft Windows SDK.)
- height Int32
-
The height, in pixels, of the icon to be retrieved.
Use SM_CXICON to specify a default-sized icon
or use SM_CXSMICON to specify a small icon.
- flags Int32
-
Not used. Must set to zero.
- refIcon IntPtr
-
A pointer to a handle to an icon that receives a handle to the icon that this function retrieves.
After the application that calls this function is finished using the icon,
the application must call DestroyIcon(IntPtr) to delete the icon.
Boolean
Returns
if it succeeds in retrieving the icon for the specified device,
or
otherwise.
To get extended error information, call
GetLastWin32Error.