Function Reference


_GUICtrlListBox_GetLocale

Retrieves the current locale

#include <GuiListBox.au3>
_GUICtrlListBox_GetLocale ( $hWnd )

Parameters

$hWnd Control ID/Handle to the control

Return Value

Returns the high order word contains the country code and the low order word contains the language identifier.

Related

_GUICtrlListBox_GetLocaleCountry, _GUICtrlListBox_GetLocaleLang, _GUICtrlListBox_GetLocalePrimLang, _GUICtrlListBox_GetLocaleSubLang, _GUICtrlListBox_SetLocale

Example

Example 1

#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    ; Create GUI
    GUICreate("List Box Get/Set Locale (v" & @AutoItVersion & ")", 400, 296)
    Local $idListBox = GUICtrlCreateList("", 2, 2, 396, 296)
    GUISetState(@SW_SHOW)

    ; Show locale, country code, language identifier, primary language id, sub-language id
    MsgBox($MB_SYSTEMMODAL, "Information", _
            "Locale .................: " & _GUICtrlListBox_GetLocale($idListBox) & @CRLF & _
            "Country code ........: " & _GUICtrlListBox_GetLocaleCountry($idListBox) & @CRLF & _
            "Language identifier..: " & _GUICtrlListBox_GetLocaleLang($idListBox) & @CRLF & _
            "Primary Language id : " & _GUICtrlListBox_GetLocalePrimLang($idListBox) & @CRLF & _
            "Sub-Language id ....: " & _GUICtrlListBox_GetLocaleSubLang($idListBox))

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

Example 2

#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIConv.au3>
#include <WinAPILangConstants.au3>

Example()

Func Example()
    ; Create GUI
    GUICreate("List Box Get/Set Locale (v" & @AutoItVersion & ")", 400, 296)
    Local $idListBox = GUICtrlCreateList("", 2, 2, 396, 296)
    GUISetState(@SW_SHOW)

    Local $iLocale = _WinAPI_MAKELCID(_WinAPI_MAKELANGID($LANG_DUTCH, $SUBLANG_DUTCH), $SORT_DEFAULT)

    MsgBox($MB_SYSTEMMODAL, "Information", "Previous Locale: " & _GUICtrlListBox_SetLocale($idListBox, $iLocale))

    $iLocale = _WinAPI_MAKELCID(_WinAPI_MAKELANGID($LANG_ENGLISH, $SUBLANG_ENGLISH_US), $SORT_DEFAULT)

    MsgBox($MB_SYSTEMMODAL, "Information", "Previous Locale: " & _GUICtrlListBox_SetLocale($idListBox, $iLocale))

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example