Function Reference


_WinAPI_GetProcessWindowStation

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

#include <WinAPISys.au3>
_WinAPI_GetProcessWindowStation ( )

Return Value

Success: Handle to the window station for the current process.
Failure: 0, call _WinAPI_GetLastError() to get extended error information.

Remarks

Do not close the handle returned by this function.

See Also

Search GetProcessWindowStation in MSDN Library.

Example

#include <APISysConstants.au3>
#include <WinAPIProc.au3>
#include <WinAPISys.au3>

Local $a_hObj[2] = [_WinAPI_GetProcessWindowStation(), _WinAPI_GetThreadDesktop(_WinAPI_GetCurrentThreadId())]

For $i = 0 To 1
        If Not $i Then
                ConsoleWrite('-------------------------------' & @CRLF)
        EndIf
        ConsoleWrite('Handle: ' & $a_hObj[$i] & @CRLF)
        ConsoleWrite('Type:   ' & _WinAPI_GetUserObjectInformation($a_hObj[$i], $UOI_TYPE) & @CRLF)
        ConsoleWrite('Name:   ' & _WinAPI_GetUserObjectInformation($a_hObj[$i], $UOI_NAME) & @CRLF)
        ConsoleWrite('-------------------------------' & @CRLF)
Next