GetProcessWindowStation function

Retrieves a handle to the current window station for the calling process.

Syntax


HWINSTA WINAPI GetProcessWindowStation(void);

Parameters

This function has no parameters.

Return value

If the function succeeds, the return value is a handle to the window station.

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

Remarks

The system associates a window station with a process when the process is created. A process can use the SetProcessWindowStation function to change its window station.

The calling process can use the returned handle in calls to the GetUserObjectInformation, GetUserObjectSecurity, SetUserObjectInformation, and SetUserObjectSecurity functions.

Do not close the handle returned by this function.

A service application is created with an associated window station and desktop, so there is no need to call a USER or GDI function to connect the service to a window station and desktop.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

GetThreadDesktop
GetUserObjectInformation
GetUserObjectSecurity
SetProcessWindowStation
SetUserObjectInformation
SetUserObjectSecurity
Window Station and Desktop Functions
Window Stations

 

 

Community Additions

ADD
Show:
© 2014 Microsoft