Function Reference


Creates a window station object, associates it with the calling process, and assigns it to the current session

#include <WinAPISys.au3>
_WinAPI_CreateWindowStation ( [$sName = '' [, $iAccess = 0 [, $iFlags = 0 [, $tSecurity = 0]]]] )


$sName [optional] The name of the window station to be created. Window station names are case-insensitive and cannot contain backslash characters (\).
Only members of the Administrators group are allowed to specify a name.
If this parameter is empty string (Default), the system forms a window station name using the logon session identifier for the calling process.
$iAccess [optional] The type of access the returned handle has to the window station. This parameter can be one or more of the following values:
$iFlags [optional] The optional flags. It can be zero (Default) or the following value:
$tSecurity [optional] $tagSECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If this parameter is 0 (Default), the handle cannot be inherited.

Return Value

Success: Handle to the newly created window station. If the specified window station already exists, the function succeeds and returns a handle to the existing window station.
Failure: 0, call _WinAPI_GetLastError() to get extended error information.


After you are done with the handle, you must call _WinAPI_CloseWindowStation() to free the handle.



See Also

Search CreateWindowStation in MSDN Library.