Function Reference


Retrieves information about the specified window station or desktop object

#include <WinAPISys.au3>
_WinAPI_GetUserObjectInformation ( $hObject, $iIndex )


$hObject Handle to the window station or desktop object.
$iIndex The information to be retrieved. The parameter can be one of the following values.

$tagUSEROBJECTFLAGS structure containing information about a window station or desktop handle.

The size of the desktop heap, in KB.

1 if the object is a handle to the desktop that is receiving input from the user, 0 otherwise.

The name of the object, as a string.

The type of the object, as a string.

The security identifier (SID) structure as "byte[n]".

Return Value

Success: The object information. Return type depends on the information type (see above).
Failure: Sets the @error flag to non-zero, call _WinAPI_GetLastError() to get extended error information.

See Also

Search GetUserObjectInformation in MSDN Library.


#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)
    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)