Jump to content
nacerbaaziz

Change the keyboard language in custom window

Recommended Posts

nacerbaaziz

Hi friends, I have a question, please.
I have created a window containing a edit box
I need to know how to change the keyboard language,
e.g :
if a user open the  script  it will be change the keyBord language   in window automatically into English
I found more examples but didn't work with me .
Note:  
 I use the windows 10 os
Please help me .
thanks in advance to all
with my Greetings and my appreciation for all users and admins

Share this post


Link to post
Share on other sites
nacerbaaziz

Hi again.
Dear I have a query
Do I need the title of the window or window Handle
Thank you very much

Share this post


Link to post
Share on other sites
VIP
$hWnd = GUICreate() 
; Or
$hWnd = WinGetHandle()


_WinAPI_SetKeyboardLayout ( $hWnd, $iLanguage [, $iFlags = 0] )

;~  The input locale identifier $iLanguage:
;~ 0x0436 - Afrikaans
;~ 0x041C - Albanian
;~ 0x0401 - Arabic
;~ 0x1401 - Arabic Algeria
;~ 0x3C01 - Arabic Bahrain
;~ 0x0C01 - Arabic Egypt
;~ 0x0801 - Arabic Iraq
;~ 0x2C01 - Arabic Jordan
;~ 0x3401 - Arabic Kuwait
;~ 0x3001 - Arabic Lebanon
;~ 0x1001 - Arabic Libya
;~ 0x1801 - Arabic Morocco
;~ 0x2001 - Arabic Oman
;~ 0x4001 - Arabic Qatar
;~ 0x0401 - Arabic Saudi Arabia
;~ 0x2801 - Arabic Syria
;~ 0x1C01 - Arabic Tunisia
;~ 0x3801 - Arabic U.A.E
;~ 0x2401 - Arabic Yemen
;~ 0x042B - Armenian
;~ 0x044D - Assamese
;~ 0x082C - Azeri Cyrillic
;~ 0x042C - Azeri Latin
;~ 0x042D - Basque
;~ 0x0813 - Belgian Dutch
;~ 0x080C - Belgian French
;~ 0x0445 - Bengali
;~ 0x0416 - Portuguese (Brazil)
;~ 0x0402 - Bulgarian
;~ 0x0455 - Burmese
;~ 0x0423 - Byelorussian (Belarusian)
;~ 0x0403 - Catalan
;~ 0x0C04 - Chinese Hong Kong SAR
;~ 0x1404 - Chinese Macau SAR
;~ 0x0804 - Chinese Simplified
;~ 0x1004 - Chinese Singapore
;~ 0x0404 - Chinese Traditional
;~ 0x041A - Croatian
;~ 0x0405 - Czech
;~ 0x0406 - Danish
;~ 0x0413 - Dutch
;~ 0x0C09 - English Australia
;~ 0x2809 - English Belize
;~ 0x1009 - English Canadian
;~ 0x2409 - English Caribbean
;~ 0x1813 - English Ireland
;~ 0x2009 - English Jamaica
;~ 0x1409 - English New Zealand
;~ 0x3409 - English Philippines
;~ 0x1C09 - English South Africa
;~ 0x2C09 - English Trinidad
;~ 0x0809 - English U.K.
;~ 0x0409 - English U.S.
;~ 0x3009 - English Zimbabwe
;~ 0x0425 - Estonian
;~ 0x0438 - Faeroese
;~ 0x0429 - Farsi
;~ 0x040B - Finnish
;~ 0x040C - French
;~ 0x2C0C - French Cameroon
;~ 0x0C0C - French Canadian
;~ 0x300C - French Cote d'Ivoire
;~ 0x140C - French Luxembourg
;~ 0x340C - French Mali
;~ 0x180C - French Monaco
;~ 0x200C - French Reunion
;~ 0x280C - French Senegal
;~ 0x1C0C - French West Indies
;~ 0x240C - French Congo (DRC)
;~ 0x0462 - Frisian Netherlands
;~ 0x083C - Gaelic Ireland
;~ 0x043C - Gaelic Scotland
;~ 0x0456 - Galician
;~ 0x0437 - Georgian
;~ 0x0407 - German
;~ 0x0C07 - German Austria
;~ 0x1407 - German Liechtenstein
;~ 0x1007 - German Luxembourg
;~ 0x0408 - Greek
;~ 0x0447 - Gujarati
;~ 0x040D - Hebrew
;~ 0x0439 - Hindi
;~ 0x040E - Hungarian
;~ 0x040F - Icelandic
;~ 0x0421 - Indonesian
;~ 0x0410 - Italian
;~ 0x0411 - Japanese
;~ 0x044B - Kannada
;~ 0x0460 - Kashmiri
;~ 0x043F - Kazakh
;~ 0x0453 - Khmer
;~ 0x0440 - Kirghiz
;~ 0x0457 - Konkani
;~ 0x0412 - Korean
;~ 0x0454 - Lao
;~ 0x0426 - Latvian
;~ 0x0427 - Lithuanian
;~ 0x042F - FYRO Macedonian
;~ 0x044C - Malayalam
;~ 0x083E - Malay Brunei Darussalam
;~ 0x043E - Malaysian
;~ 0x043A - Maltese
;~ 0x0458 - Manipuri
;~ 0x044E - Marathi
;~ 0x0450 - Mongolian
;~ 0x0461 - Nepali
;~ 0x0414 - Norwegian Bokmol
;~ 0x0814 - Norwegian Nynorsk
;~ 0x0448 - Oriya
;~ 0x0415 - Polish
;~ 0x0816 - Portuguese
;~ 0x0446 - Punjabi
;~ 0x0417 - Rhaeto-Romanic
;~ 0x0418 - Romanian
;~ 0x0818 - Romanian Moldova
;~ 0x0419 - Russian
;~ 0x0819 - Russian Moldova
;~ 0x043B - Sami Lappish
;~ 0x044F - Sanskrit
;~ 0x0C1A - Serbian Cyrillic
;~ 0x081A - Serbian Latin
;~ 0x0430 - Sesotho
;~ 0x0459 - Sindhi
;~ 0x041B - Slovak
;~ 0x0424 - Slovenian
;~ 0x042E - Sorbian
;~ 0x040A - Spanish (Traditional)
;~ 0x2C0A - Spanish Argentina
;~ 0x400A - Spanish Bolivia
;~ 0x340A - Spanish Chile
;~ 0x240A - Spanish Colombia
;~ 0x140A - Spanish Costa Rica
;~ 0x1C0A - Spanish Dominican Republic
;~ 0x300A - Spanish Ecuador
;~ 0x440A - Spanish El Salvador
;~ 0x100A - Spanish Guatemala
;~ 0x480A - Spanish Honduras
;~ 0x4C0A - Spanish Nicaragua
;~ 0x180A - Spanish Panama
;~ 0x3C0A - Spanish Paraguay
;~ 0x280A - Spanish Peru
;~ 0x500A - Spanish Puerto Rico
;~ 0x0C0A - Spanish Spain (Modern Sort)
;~ 0x380A - Spanish Uruguay
;~ 0x200A - Spanish Venezuela
;~ 0x0430 - Sutu
;~ 0x0441 - Swahili
;~ 0x041D - Swedish
;~ 0x081D - Swedish Finland
;~ 0x100C - Swiss French
;~ 0x0807 - Swiss German
;~ 0x0810 - Swiss Italian
;~ 0x0428 - Tajik
;~ 0x0449 - Tamil
;~ 0x0444 - Tatar
;~ 0x044A - Telugu
;~ 0x041E - Thai
;~ 0x0451 - Tibetan
;~ 0x0431 - Tsonga
;~ 0x0432 - Tswana
;~ 0x041F - Turkish
;~ 0x0442 - Turkmen
;~ 0x0422 - Ukrainian
;~ 0x0420 - Urdu
;~ 0x0843 - Uzbek Cyrillic
;~ 0x0443 - Uzbek Latin
;~ 0x0433 - Venda
;~ 0x042A - Vietnamese
;~ 0x0452 - Welsh
;~ 0x0434 - Xhosa
;~ 0x0435 - Zulu

 


Regards,
 

Share this post


Link to post
Share on other sites
nacerbaaziz

Hi
I tried and it didn't work with me
can you help me to set the keybord language to the english if i open this script
please

 

 

local $HWND = GUICreate("english to arabic translator", 400, 400)
GUICtrlCreateLabel("Write the English text here: ", 50, 10, 150, 60)
local $Input = GUICtrlCreateInput("", 50, 30, 200, 60)
local $Translate = GUICtrlCreateButton("&Translate", 0, 100, 50, 50, 0x01)
local $exit = GUICtrlCreateButton("&exit", 100, 100, 50, 50)


GUISetState(@sw_show, $HWND)
while 1
switch GUIGetMSG()
case $exit
exit
EndSwitch
Wend

Share this post


Link to post
Share on other sites
VIP

Sample scripts (Bing Translator API) for English to Arabic OR Any lanuage to Arabic Translator :

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPISys.au3>

#Region ### START GUI section ### Form=
Global $hWnd = GUICreate("English to Arabic Translator", 630, 162, -1, -1)
GUICtrlCreateLabel("Write the English text here:", 10, 2, 246, 17)
Global $eInput = GUICtrlCreateEdit("", 8, 25, 250, 100, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetData(-1, "Language text!")
GUICtrlCreateLabel("وقد ترجم النص إلى العربية:", 368, 2, 252, 17, $SS_RIGHT, $WS_EX_LAYOUTRTL)
Global $eOutput = GUICtrlCreateEdit("", 368, 25, 250, 100, BitOR($ES_RIGHT, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL), $WS_EX_LAYOUTRTL)
GUICtrlSetData(-1, "")
Global $bTranslate = GUICtrlCreateButton("Translate/ترجمه", 268, 25, 88, 50, $BS_DEFPUSHBUTTON)
Global $bCopy = GUICtrlCreateButton("Copy/نسخ", 268, 88, 88, 33)
Global $labStatus = GUICtrlCreateLabel("Ready!", 10, 134, 608, 21)

GUISetState(@SW_SHOW)
#EndRegion ### START GUI section ### Form=

Global Const $iLanguage = 0x0409
_WinAPI_SetKeyboardLayout($hWnd, $iLanguage)

Global $sTextToTranslated, $sTextTranslatedToArabic

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $bCopy
            $sTextToTranslated = GUICtrlRead($eOutput)
            MsgBox(64, "Copy to clipboard", ClipPut($sTextToTranslated) ? "Text translated has copy to Cliboard" : "Copy to Cliboard ERROR", Default, $hWnd)
        Case $bTranslate
            GUICtrlSetData($labStatus, "Translating...")

            GUICtrlSetData($eOutput, "")
            $sTextToTranslated = GUICtrlRead($eInput)
            $sTextTranslatedToArabic = _TranslateEnglishToArabic($sTextToTranslated)
            GUICtrlSetData($eOutput, $sTextTranslatedToArabic)

            GUICtrlSetData($labStatus, "Done!")
    EndSwitch
    Sleep(10)
WEnd

Func _TranslateEnglishToArabic($sEnglish = "")
    Local $sTranslated = BingTranslator($sEnglish, "en", "ar")
    Return $sTranslated
EndFunc   ;==>_TranslateEnglishToArabic

Func BingTranslator($sText, $sFrom = "auto", $sTo = "en")
    Local $sClient = "http://api.microsofttranslator.com/V2/Http.svc/"
    Local $appID = 'appId=68D088969D79A8B23AF8585CC83EBA2A05A97651'
    Local $Data = BinaryToString(StringToBinary($sText, 4))
    If $sFrom == "auto" Then
        $sFrom = InetRead($sClient & 'Detect?' & $appID & "&text=" & $Data, 3)
        $sFrom = StringRegExpReplace(BinaryToString($sFrom, 4), ".*>(.*)<.*", "$1")
    EndIf
    Local $Result = InetRead($sClient & 'Translate?' & $appID & "&from=" & $sFrom & "&to=" & $sTo & "&text=" & $Data, 3)
    $Result = StringRegExpReplace(BinaryToString($Result, 4), ".*>(.*)<.*", "$1")
    Return $Result
EndFunc   ;==>BingTranslator

 


Regards,
 

Share this post


Link to post
Share on other sites
VIP

I can not edit posts!
Forum fails with Arabic!

Script fixed:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPISys.au3>

#Region ### START GUI section ### Form=
Global $hWnd = GUICreate("English to Arabic Translator", 630, 162, -1, -1)
GUICtrlCreateLabel("Write the English text here:", 10, 2, 246, 17)
Global $eInput = GUICtrlCreateEdit("", 8, 25, 250, 100, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetData(-1, "Language text!")
GUICtrlCreateLabel("Arabic Text translated:", 368, 2, 252, 17, $SS_RIGHT)
Global $eOutput = GUICtrlCreateEdit("", 368, 25, 250, 100, BitOR($ES_RIGHT, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL), $WS_EX_LAYOUTRTL)
GUICtrlSetData(-1, "")
Global $bTranslate = GUICtrlCreateButton("Translate", 268, 25, 88, 50, $BS_DEFPUSHBUTTON)
Global $bCopy = GUICtrlCreateButton("Copy", 268, 88, 88, 33)
Global $labStatus = GUICtrlCreateLabel("Ready!", 10, 134, 608, 21)

GUISetState(@SW_SHOW)
#EndRegion ### START GUI section ### Form=

Global Const $iLanguage = 0x0409
_WinAPI_SetKeyboardLayout($hWnd, $iLanguage)

Global $sTextToTranslated, $sTextTranslatedToArabic

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $bCopy
            $sTextToTranslated = GUICtrlRead($eOutput)
            MsgBox(64, "Copy to clipboard", ClipPut($sTextToTranslated) ? "Text translated has copy to Cliboard" : "Copy to Cliboard ERROR", Default, $hWnd)
        Case $bTranslate
            GUICtrlSetData($labStatus, "Translating...")

            GUICtrlSetData($eOutput, "")
            $sTextToTranslated = GUICtrlRead($eInput)
            $sTextTranslatedToArabic = _TranslateEnglishToArabic($sTextToTranslated)
            GUICtrlSetData($eOutput, $sTextTranslatedToArabic)

            GUICtrlSetData($labStatus, "Done!")
    EndSwitch
    Sleep(10)
WEnd

Func _TranslateEnglishToArabic($sEnglish = "")
    Local $sTranslated = BingTranslator($sEnglish, "en", "ar")
    Return $sTranslated
EndFunc   ;==>_TranslateEnglishToArabic

Func BingTranslator($sText, $sFrom = "auto", $sTo = "en")
    Local $sClient = "http://api.microsofttranslator.com/V2/Http.svc/"
    Local $appID = 'appId=68D088969D79A8B23AF8585CC83EBA2A05A97651'
    Local $Data = BinaryToString(StringToBinary($sText, 4))
    If $sFrom == "auto" Then
        $sFrom = InetRead($sClient & 'Detect?' & $appID & "&text=" & $Data, 3)
        $sFrom = StringRegExpReplace(BinaryToString($sFrom, 4), ".*>(.*)<.*", "$1")
    EndIf
    Local $Result = InetRead($sClient & 'Translate?' & $appID & "&from=" & $sFrom & "&to=" & $sTo & "&text=" & $Data, 3)
    $Result = StringRegExpReplace(BinaryToString($Result, 4), ".*>(.*)<.*", "$1")
    Return $Result
EndFunc   ;==>BingTranslator

 


Regards,
 

Share this post


Link to post
Share on other sites
nacerbaaziz

thank you very very very very much dear for the helpful responses

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • bowker
      By bowker
      Hi! Is there a way for me to set the value for my slider? I am getting the value for my slider with
       
      Local $strText = _UIA_getPropertyValue($oUIElement, $UIA_LegacyIAccessibleValuePropertyId) MsgBox(0,"",$strText)  
    • nacerbaaziz
      By nacerbaaziz
      Hello
      Can we pause and resume the download in the InetGet function?
      If is possible, what is the solution please?
      I used this code To manage the download

      #include <INet.au3> func _downloader($name, $linc, $filepath, $RTLF = false, $link = false) global $downloader = GUICreate("downloader", 400, 200, -1, -1, $WS_CLIPCHILDREn, $RTLF, $link) global $path = $filePath $labelTxt = GUICtrlCreateLabel("downloading " & $name, 50, 10, 200, 20) global $labelTxt0 = GUICtrlCreateLabel("downloaded size 0 MB " & "OF 0 MB", 50, 60, 300, 20) global $Progress = "" global $sText = ""     For $i = 1 To Random(5, 20, 1) ; Return an integer between 5 and 20 to determine the length of the string.         $sText &= Chr(Random(65, 122, 1)) ; Return an integer between 65 and 122 which represent the ASCII characters between a (lower-case) to Z (upper-case). next global $labelTxt2 = GUICtrlCreateInput("0%", 50, 80, 50, 20) _GUICtrlEdit_SetReadOnly(-1, true) GUIStartGroup("") global $beep = GUICtrlCreateCheckBox("use the progress beep notification", 150, 120, 200, 20) GUIStartGroup("") $button = GUICtrlCreateButton("Cancel', 130, 150, 180, 25, 0x01) $iIndex = 0 global $Target global $url GUIStartGroup("") global $Progress = GUICtrlCreateProgress(50, 90, 150, 20) global $Target = $filepath global $url = $linc global $path = $filepath global $hDownloadNo = _RSMWare_GetData($url, $Target) global $status = false AdlibRegister("SetProgress") global $onprogress = false, $curent = false GUISetState(@sw_Show) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $button $asc = MsgBox(4132,"exit download?","if you click yes the downloading will be cancel, do you want to cancel it ?") if $asc = 6 then AdlibUnRegister("SetProgress") GUIDelete() If $hDownloadNo <> 0 Then InetClose($hDownloadNo) exitLoop endIf EndSwitch if $status = -1 then $status = 0 $hDownloadNo = _RSMWare_GetData($url, $Target) $onprogress = false $curent = false elseIf $Status = 1 then $status = $path GUIDelete() AdlibUnRegister("SetProgress") exitLoop endIf WEnd return $status endFunc Func _RSMWare_GetData($url, $Target) Local $hDownload = InetGet($url, $Target, 1, 1) Return $hDownload EndFunc ;==>_RSMWare_GetData Func SetProgress() Local $state If $hDownloadNo <> 0 Then $state = InetGetInfo($hDownloadNo) If @error = 0 Then $infor = "downloaded size " & Round(Execute(InetGetInfo($hDownloadNo, $INET_DOWNLOADREAD) / 1048576), 2) & " MB of " & Round(Execute(InetGetInfo($hDownloadNo, $INET_DOWNLOADSIZE) / 1048576), 2) & " MB " $onprogress = Round(Ceiling(($state[0] / $state[1]) * 100)) if not (InetGetInfo($hDownloadNo, $INET_DOWNLOADSIZE) = 0) then if $onProgress <= 0 then $onProgress = 0 GUICtrlSetData($Progress, $onProgress) GUICtrlSetData($labelTxt0, $infor) GUICtrlSetData($labelTxt2, $onProgress & "%") if _isChecked($beep) then if $onprogress > $curent then beep((100 + $onprogress * 20), 100) $curent = $onprogress endIf endIf endIf If $state[2] Then If $state[3] Then InetClose($hDownloadNo) $status = 1 else InetClose($hDownloadNo) $status = -1 endIf endIf EndIf endIf EndFunc ;==>SetProgress
    • rcmaehl
      By rcmaehl
      A UDF with Extended Functions for Window Management
       
      Notes:
      Fixes WinGetClassList's barbaric returning of a @LF separated string instead of an array.
       
      Potential Uses:
      Automating applications that change their controls' handles/classes on each launch (e.g. half of Cisco's programs)
       
      Functions:
      _WinGetClassList
      _WinGetClassNNList
      _WindowGetHandleList
      _WindowGetHandleListFromPos
       
      Download: 
      WindowEx.zip  (v0.4)
       
      Changelog:
      10/04/2016 (v0.4): _WinGetClassNNList Fixed : Not Returning an Index when using $2D_ARRAY _WinGetClassNNList Fixed : Not Properly returning $aArray[x][1] on Classes with instances > 9 when using $2D_ARRAY 10/03/2016 (v0.3): _WinGetClassList Added : Exactly the same as WinGetClassList but returns a more civilized Array _WinGetClassNNList Added : Returns Classes and their instances in either a 1D or 2D array depending on Flags _WindowGetHandleList Renamed: _WinGetHandleList SCRIPT BREAKING! _WindowGetHandleListFromPos Renamed: _WinGetHandleListFromPos SCRIPT BREAKING! 10/01/2016 (v0.2): WindowsExConstants.au3 Added : Flags in _WindowGetHandleListFromPos _WindowGetHandleListFromPos Removed: ConsoleWrite left in during debug _WindowGetHandleListFromPos Added : Flag for if part of a Control is at $X, $Y return it as well. 10/01/2016 (v0.1): _WindowGetHandleList Added : Retrieves the handles of classes from a window. _WindowGetHandleListFromPos Added : Retrieves the handles of classes at a specific position from a window. Known and Reported Bugs:
      None reported To Do:
      To Be Decided. Opinions welcome! Upcoming Changes:
      To Be Decided.
    • VollachR
      By VollachR
      Hi,
      I'm looking for a way to take a number value from a Row2 of a 2D array and according to this check if files that appear in rows 3-11 in the array exists.
      For example, if the number in Row2 is 5 I need to check for the files in Row 3-6 only, if it is 6 than rows 3-7 and so on.
      I thought on using a FOR loop but I have very little experience with those.
      Can you suggest the best way to do what I need?
      BTW, the files in Rows 3-11 will usually have blank value for any row above the number in Row2 (e.g. Row2 = 5 so Rows3-6 will have values but 8-11 be empty), The values I need are in Column 1 of the array, the name of the key from the INI file that the array was created from is in Column 0.
      Full Example:
      Row2 of Array:
      Col0 = Games# - Col1 = 5
      Rows3-6
      Col0 = Exe2 - Col1 = Path To File
      Col0 = Exe3 - Col1 = Path To File
      Col0 = Exe4 - Col1 = Path To File
      Col0 = Exe5 - Col1 = Path To File
      I need that if Row2 is 5 to check these above for rows if the file exists, if it was 6 then the next row as well and so on up until number 10 in Row2 as it can't go above 10.
      So basically for whatever number in Row2 from 2-10 need to check 1-9 rows from 3-11 to see if the files in Col1 exists and if any of them don't exist it should call a function that shows an error message.
      I'm pretty sure I have the first line of the for look correct:
      For $i = 1 To $aAIO[2][1] Just not sure how to continue from there, also not sure if $i should be equal 1 or 2.
      Help will be appreciated.
    • VollachR
      By VollachR
      Hi,
      I've written a specialty INI file editor for a specific set of INI files related to a bigger script I'm working on.
      I'm trying to create a verification script that checks the ini files structure and format and gives an error if they are not in expected format.
      What I did so far is create a couple of custom arrays, each with the list of Sections expected in the files and I use IniReadSectionNames in order to read the sections from the selected INI file and compare it to the array.
      It works fine, excepts it only gives an error if one or more of the sections in the custom array is missing, if they all exist but there are other additional sections that shouldn't be there it doesn't give an error and continue to open the editor screen.
      Here are the relevant part of my script:
      The Custom Verification Arrays:
      ;Creating Arrays for INI Verification Global $aSettingsVerify[7] $aSettingsVerify[1] = "Conversion" $aSettingsVerify[2] = "AIO" $aSettingsVerify[3] = "Data" $aSettingsVerify[4] = "Redist" $aSettingsVerify[5] = "Split" $aSettingsVerify[6] = "Autorun" Global $aDataVerify[6] $aDataVerify[1] = "Compression" $aDataVerify[2] = "Exclude" $aDataVerify[3] = "LangExclude" $aDataVerify[4] = "PreCommands" $aDataVerify[5] = "PostCommands" The IniReadSectionNames verification part:
      Case $OK If StringInStr($ActiveConfig, "Settings.ini") Then $CheckArray1 = IniReadSectionNames($ActiveConfig) $CheckArray2 = _ArrayCompare($aSettingsVerify, $CheckArray1) $CheckArray3 = UBound($CheckArray2, 1) If $CheckArray3 = 1 Then GUIDelete($ConfigStart) SettingsGUI() EndIf If $CheckArray3 > 1 Then WrongIni() EndIf EndIf If StringInStr($ActiveConfig, "Data") Then $CheckArray1 = IniReadSectionNames($ActiveConfig) $CheckArray2 = _ArrayCompare($aDataVerify, $CheckArray1) $CheckArray3 = UBound($CheckArray2, 1) If $CheckArray3 = 1 Then GUIDelete($ConfigStart) DataGUI() EndIf If $CheckArray3 > 1 Then WrongIni() EndIf EndIf The Function that performs the compare: (Found it in another thread on this forums somewhere by using Google Search)
      ;Compares Imported INI file with the Verification array Func _ArrayCompare(ByRef $a1, ByRef $a2) Local $nOldSize = UBound($a2) Local $a3[$nOldSize], $nNewSize = $nOldSize For $i = 0 To UBound($a1) - 1 For $j = 0 To $nOldSize - 1 If Not $a3[$j] And ($a1[$i] = $a2[$j]) Then $a3[$j] = 1 $nNewSize -= 1 EndIf Next Next Local $a4[$nNewSize], $j = 0 For $i = 0 To $nOldSize - 1 If Not $a3[$i] Then $a4[$j] = $a2[$i] $j += 1 EndIf Next Return $a4 EndFunc ;==>_ArrayCompare  
      Any way to make a check if there are sections other than the ones in the Verification Array and produce an error?
      Thanks
×