User32EnumDesktopWindows Method

Enumerates all top-level windows associated with the specified desktop.

It passes the handle to each window, 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", SetLastError = true)]
public static bool EnumDesktopWindows(
	IntPtr hDesktop,
	DelegatesEnumWindowsProc lpEnumFunc,
	IntPtr lParam
)

Parameters

hDesktop  IntPtr
A handle to the desktop whose top-level windows are to be enumerated.

This handle is returned by the CreateDesktop, GetThreadDesktop, OpenDesktop, or OpenInputDesktop function, and must have the DESKTOP_READOBJECTS access right.

lpEnumFunc  DelegatesEnumWindowsProc
A pointer to an application-defined callback function.
lParam  IntPtr
An application-defined value to be passed to the callback function.

Return Value

Boolean
if the function succeeds, the return value is.

If the function fails or is unable to perform the enumeration, the return value is.

To get extended error information, call GetLastWin32Error.

Remarks

See Also