Search the Community
Showing results for tags 'thanks trancexx'.
-
This was just a simple project for myself but may be someone else will find it interesting. #include <IE.au3> #include <Array.au3> #include <String.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Country = RegRead("HKEY_CURRENT_USER\Control Panel\International\", "sCountry") $oIE = _IECreateEmbedded() GUICreate("Country Test" , 300, 300, Default, Default, BitNOT($WS_MINIMIZEBOX) + $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN, $WS_EX_TOPMOST) GUISetBkColor(0xFFFFFF) $Txt = GUICtrlCreateLabel("Loading...Please Wait!", 0, 80, 300, 220, $SS_CENTER) $Obj = GUICtrlCreateObj($oIE, 100, 0, 100, 80) GUISetState(@SW_SHOW) $Flag = _Short_Country($Country) _IENavigate($oIE, "www.flagpedia.net/data/flags/mini/" & StringLower($Flag) & ".png") $oIE.Document.Body.Scroll = "No" $oIE.Document.Body.Style.Border = "0px" GUICtrlSetState($Obj, $GUI_DISABLE) $oIE_Read = _IECreate("www.flagpedia.net/" & StringLower($Country), 0, 0, 1, 0) $oIE_String = _StringBetween(_IEBodyReadHTML($oIE_Read), "<p>", "</p>") GUICtrlSetData($Txt, $oIE_String[0]) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _IEQuit($oIE) _IEQuit($oIE_Read) Exit EndSwitch WEnd Func _Short_Country($sCountry) Local Enum $GEO_NATION = 0x0001, $GEO_LATITUDE, $GEO_LONGITUDE, $GEO_ISO2, $GEO_ISO3, $GEO_RFC1766, $GEO_LCID, $GEO_FRIENDLYNAME, $GEO_OFFICIALNAME, $GEO_TIMEZONES, $GEO_OFFICIALLANGUAGES, $GEO_ISO_UN_NUMBER, $GEO_PARENT Local $SC_Name, $aCall For $iGEOId = 0 To 0xFFFF $aCall = DllCall("kernel32.dll", "int", "GetGeoInfoW", "long", $iGEOId, "int", $GEO_FRIENDLYNAME, "wstr", "", "int", 65536, "word", 0) If @error Then Return $SC_Name If $aCall[3] = $sCountry Then $aCall = DllCall("kernel32.dll", "int", "GetGeoInfoW", "long", $iGEOId, "int", $GEO_ISO2, "wstr", "", "int", 65536, "word", 0) If @error Then Return $SC_Name $SC_Name = $aCall[3] ExitLoop EndIf Next Return $SC_Name EndFunc