# Function Reference

# _WinAPI_GetObjectNameByHandle

Retrieves a name of the specified object

#include <WinAPIHObj.au3>
_WinAPI_GetObjectNameByHandle ( $hObject )

## Parameters

$hObject | A handle to the object to obtain its name.

## Return Value

Success: | The name of the object.
Failure: | Empty string and sets the @error flag to non-zero, @extended flag may contain the NTSTATUS error code.

## See Also

Search ZwQueryObject in MSDN Library.

## Example

    #include <WinAPIFiles.au3>
    #include <WinAPIHObj.au3>

    Local $sFile = @ScriptFullPath
    Local $hFile = _WinAPI_CreateFile(@ScriptFullPath, 2, 0, 6)

    ConsoleWrite('File:   ' & $sFile & @CRLF)
    ConsoleWrite('Handle: ' & $hFile & @CRLF)
    ConsoleWrite('Type:   ' & _WinAPI_GetObjectNameByHandle($hFile) & @CRLF)

    _WinAPI_CloseHandle($hFile)