Export (0) Print
Expand All
0 out of 3 rated this helpful - Rate this topic

EnumWindowStations function

Enumerates all window stations in the current session. The function passes the name of each window station, in turn, to an application-defined callback function.


BOOL WINAPI EnumWindowStations(
  _In_  WINSTAENUMPROC lpEnumFunc,
  _In_  LPARAM lParam


lpEnumFunc [in]

A pointer to an application-defined EnumWindowStationProc 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.


The EnumWindowStations function enumerates only those window stations for which the calling process has the WINSTA_ENUMERATE access right. For more information, see Window Station Security and Access Rights.

EnumWindowStations repeatedly invokes the lpEnumFunc callback function until the last window station is enumerated or the callback function returns FALSE.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Winuser.h (include Windows.h)





Unicode and ANSI names

EnumWindowStationsW (Unicode) and EnumWindowStationsA (ANSI)

See also

Window Station and Desktop Functions
Window Stations



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.