User32EnumDesktops Method
Enumerates all desktops associated with the specified window station of the calling process.
The function passes the name of each desktop, in turn, to an application-defined callback function.
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("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool EnumDesktops(
IntPtr hWinsta,
DelegatesEnumDesktopProc enumFunc,
IntPtr lParam
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function EnumDesktops (
hWinsta As IntPtr,
enumFunc As DelegatesEnumDesktopProc,
lParam As IntPtr
) As Boolean
Dim hWinsta As IntPtr
Dim enumFunc As DelegatesEnumDesktopProc
Dim lParam As IntPtr
Dim returnValue As Boolean
returnValue = User32.EnumDesktops(hWinsta,
enumFunc, lParam)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool EnumDesktops(
IntPtr hWinsta,
DelegatesEnumDesktopProc^ enumFunc,
IntPtr lParam
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member EnumDesktops :
hWinsta : IntPtr *
enumFunc : DelegatesEnumDesktopProc *
lParam : IntPtr -> bool
No code example is currently available or this language may not be supported.
- hWinsta IntPtr
-
A handle to the window station whose desktops are to be enumerated.
This handle is returned by the CreateWindowStation,
GetProcessWindowStation, or OpenWindowStation function,
and must have the WINSTA_ENUMDESKTOPS access right.
If this parameter is Zero, the current window station is used.
- enumFunc DelegatesEnumDesktopProc
-
A pointer to an application-defined DelegatesEnumDesktopProc callback function.
- lParam IntPtr
-
An application-defined value to be passed to the callback function.
Boolean
If the function succeeds, it returns the nonzero value returned by the
callback function that was pointed to by lpEnumFunc.
If the function is unable to perform the enumeration, the return value is zero.
If the callback function fails, the return value is zero.
The callback function can call
SetLastError(Win32ErrorCode) to set an error code for the
caller to retrieve by calling
GetLastWin32Error.