CloseWindowStation function

Closes an open window station handle.

Syntax

BOOL CloseWindowStation(
  HWINSTA hWinSta
);

Parameters

hWinSta

A handle to the window station to be closed. This handle is returned by the CreateWindowStation or OpenWindowStation function. Do not specify the handle returned by the GetProcessWindowStation function.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Windows Server 2003 and Windows XP/2000:  This function does not set the last error code on failure.

Remarks

The CloseWindowStation function will fail if the handle being closed is for the window station assigned to the calling process.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Window Station and Desktop Functions

Window Stations