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.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: 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
)

Parameters

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.

Return Value

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.

Remarks

See Also