# Function Reference

# _WinAPI_GetUserObjectInformation

Retrieves information about the specified window station or desktop object

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

## Parameters

$hObject | Handle to the window station or desktop object.
$iIndex | The information to be retrieved. The parameter can be one of the following values. $UOI_FLAGS $tagUSEROBJECTFLAGS structure containing information about a window station or desktop handle. $UOI_HEAPSIZE The size of the desktop heap, in KB. $UOI_IO 1 if the object is a handle to the desktop that is receiving input from the user, 0 otherwise. $UOI_NAME The name of the object, as a string. $UOI_TYPE The type of the object, as a string. $UOI_USER_SID 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.

## Example

    #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