Share via


CloseWindowStation 函式 (winuser.h)

關閉開啟的視窗月臺句柄。

語法

BOOL CloseWindowStation(
  [in] HWINSTA hWinSta
);

參數

[in] hWinSta

要關閉之視窗月臺的句柄。 CreateWindowStation 或 OpenWindowStation 函式會傳回此句柄。 請勿指定 GetProcessWindowStation 函式所傳回的句柄。

傳回值

如果函式成功,則傳回非零的值。

如果此函式失敗,則傳回值為零。 若要取得擴充的錯誤資訊,請呼叫 GetLastError

Windows Server 2003 和 Windows XP/2000: 此函式不會在失敗時設定最後一個錯誤碼。

備註

如果關閉的句柄是指派給呼叫進程的視窗月臺, CloseWindowStation 函式將會失敗。

規格需求

需求
最低支援的用戶端 Windows 2000 專業版 [僅限傳統型應用程式]
最低支援的伺服器 Windows 2000 Server [僅限傳統型應用程式]
目標平台 Windows
標頭 winuser.h (包括 Windows.h)
程式庫 User32.lib
Dll User32.dll
API 集合 ext-ms-win-ntuser-windowstation-l1-1-0 (於 Windows 8)

另請參閱

視窗月臺和桌面函式

視窗月臺