Function Reference


_WinAPI_GetUserGeoID

Retrieves information about the geographical location of the user

#include <WinAPILocale.au3>
_WinAPI_GetUserGeoID ( )

Return Value

Success: The geographical location identifier of the user.
Failure: (-1) GEOID_NOT_AVAILABLE.

See Also

Search GetUserGeoID in MSDN Library.

Example

Example 1

#include <APILocaleConstants.au3>
#include <WinAPILocale.au3>

Local $iID = _WinAPI_GetUserGeoID()

ConsoleWrite('ID:        0x' & Hex($iID) & @CRLF)
ConsoleWrite('Latitude:  ' & _WinAPI_GetGeoInfo($iID, $GEO_LATITUDE) & @CRLF)
ConsoleWrite('Longitude: ' & _WinAPI_GetGeoInfo($iID, $GEO_LONGITUDE) & @CRLF)
ConsoleWrite('Name:      ' & _WinAPI_GetGeoInfo($iID, $GEO_FRIENDLYNAME) & @CRLF)
ConsoleWrite('ISO code:  ' & _WinAPI_GetGeoInfo($iID, $GEO_ISO3) & @CRLF)

Example 2

#include <APILocaleConstants.au3>
#include <Array.au3>
#include <WinAPILocale.au3>

Local $aData = _WinAPI_EnumSystemGeoID()

If Not @error Then
        Local $aData2[UBound($aData)][$GEO_PARENT]
        For $iData_idx = 0 To $aData[0]
                For $iData2_idx = 1 To $GEO_PARENT
                        $aData2[$iData_idx][$iData2_idx-1] = _WinAPI_GetGeoInfo($aData[$iData_idx], $iData2_idx)
                Next
        Next
        _ArrayDisplay($aData2, '_WinAPI_GetGeoInfo')
EndIf