EnumDesktops function
Applies to: desktop apps only
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.
Syntax
BOOL WINAPI EnumDesktops( __in_opt HWINSTA hwinsta, __in DESKTOPENUMPROC lpEnumFunc, __in LPARAM lParam );
Parameters
- hwinsta [in, optional]
-
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. For more information, see Window Station Security and Access Rights.
If this parameter is NULL, the current window station is used.
- lpEnumFunc [in]
-
A pointer to an application-defined EnumDesktopProc callback function.
- lParam [in]
-
An application-defined value to be passed to the callback function.
Return value
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. Call GetLastError to get extended error information.
If the callback function fails, the return value is zero. The callback function can call SetLastError to set an error code for the caller to retrieve by calling GetLastError.
Remarks
The EnumDesktops function enumerates only those desktops for which the calling process has the DESKTOP_ENUMERATE access right. For more information, see Desktop Security and Access Rights.
The EnumDesktops function repeatedly invokes the lpEnumFunc callback function until the last desktop is enumerated or the callback function returns FALSE.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | EnumDesktopsW (Unicode) and EnumDesktopsA (ANSI) |
See also
- CreateWindowStation
- Desktops
- EnumDesktopProc
- GetProcessWindowStation
- OpenWindowStation
- Window Station and Desktop Functions
Send comments about this topic to Microsoft
Build date: 2/3/2012