; With QizuL ; you can learn vocables and other things by making a short multiple choice quiz. ; ; The program simply loads easy configurated textfiles and show their content. ; ; You have 2 modes :[list] ; 1. The easy way shows a random question and a short time later the answer. ; No Quiz! ; Then this starts again. ; Its something like a help for memorize. ; ; 2. At second you can show a little quiz or better a multiple choice question.[/list] ; ; It works like a cardbox. Take randomly a card out of the box. ; Try to answer the question on it. ; If the answer on the back is correct you take the card away. ; If the answer is false put the card back in the cardbox. ; If there is only one false answered or none card in the box ; the box is filled again. ; ; The program is a little bit extended. ; You can change answer to questions randomly. ; So if you want to learn vocables you can decide ; if you want to see randomly both languages or only one. ; And you can comment lines out in the textfiles (; as first char). ;some links: ;qizul: http://www.autohotkey.net/~haichen/vokabel/qizul.ahk ;forum: http://de.autohotkey.com/forum/topic2379.html ;Scriptmerge: http://www.autohotkey.com/forum/topic18545.html] ;CmnDlg: http://www.autohotkey.com/forum/topic17230.html ;loadVarsFromIni:http://www.autohotkey.com/forum/post-41881.html#41881] ;activaid: http://www.heise.de/ct/activaid/default_en.shtml ;Leo: http://dict.leo.org/ #Persistent programName = qizul OutputDebug, Line=%A_LineNumber% ProgramName= %programName% ;IniWrite, %CustomColor%, %INIfile%, config, CustomColor merker= IniVar = ( [config] Wmin=1000 Wmax=100000 Anzeigedauer=5000 transparency=240 x=280 y=132 spform=C11 quizz=1 notrandom=0 CustomColor=0x9fd0e8 appendFalse=0 [lang] actualLang=de possibleLangs=de,en [de] MenulanguageTitel = Sprachwahl quizzGroupbox1 = ?? Frage ?? quizzGroupbox2 = Auswahl quizzButtonOK= weiter quizzTitel1= Quizul quizzGroupbox3 = Auswertung quizzcorrect = Richtig quizzfalse = Leider falsch. Richtig ist: quizzanswer = Antwort quizzTitel2 = Qizul Antwort OptionsGroupBox1 = Quiz Textdatei(en) OptionsButtonFile = Quiz Datei(en) OptionsOpen = Öffnen OptionsGroupBox2 = Transparenz OptionsGroupBox3 = Erscheinungszeiten OptionsTime = Wechselzeit OptionsChangeTime = Es dauert minimal Wmin ms und höchstens Wmax ms bis eine neue Vokabel erscheint. OptionsText1 = Anzeigedauer in ms der Vokabeltexte OptionsGroupBox4 = Erscheinungsbild im nicht-Quizmodus OptionsRadioLeft = Linksbündig OptionsRadioCenter = Zentriert OptionsShowmodus = Quiz Modus OptionsButtonsave = Aktualisieren und speichern OptionsTitle = Qizul Optionen OptionsLangDe = Deutsch OptionsLangEn = English OptionsGroupBox5 = Sprache - Language OptionsQuizRandom0 = Zufällig OptionsQuizRandom1 = Nur die rechte Seite OptionsQuizRandom2 = Nur die linke Seite OptionsQuizColor = Hintergrundfarbe OptionsButtonreset = Ursprüngliche Einstellungen OptionsCmnDlg = Mit Strg oder Shift können mehrere Dateien gewählt werden Optionsbddy1 = undurchsichtig Optionsbddy2 = durchsichtig OptionsQuizAppendFalse = Falsch beantwortete Fragen werden in false.txt gespeichert. tipxtext = Datei aus Menü entfernen TrTitel = QizuL TrSettings = Einstellungen TrPause = Pause TrWeiter = Weiter TrEnd = Exit [en] MenulanguageTitel = choice language quizzGroupbox1 = ?? question ?? quizzGroupbox2 = choices quizzButtonOK= go quizzTitel1= qizul quizzGroupbox3 = appraisal quizzcorrect = accurate quizzfalse = sorry! sadly wrong. accurately it is: quizzanswer = answer quizzTitel2 = quizul answer OptionsGroupBox1 = quiz textfile OptionsButtonFile = load file(s) OptionsOpen = open OptionsGroupBox2 = transparency OptionsGroupBox3 = time of appearance OptionsTime = changetime OptionsChangeTime = not more than Wmin ms and at most Wmax ms until a vocabel appears. OptionsText1 = display duration in ms for the text. OptionsGroupBox4 = appearance without quizmode OptionsRadioLeft = left-aligned OptionsRadioCenter = centered OptionsShowmodus = Quiz Mode OptionsButtonsave = update and save OptionsTitle = quizul options OptionsLangDe = deutsch OptionsLangEn = english OptionsGroupBox5 = Language - Sprache OptionsQuizRandom0 = Random OptionsQuizRandom1 = only the left side OptionsQuizRandom2 = only the right side OptionsQuizColor = Backgroundcolor OptionsButtonreset = reset to original settings OptionsCmnDlg = Select several files with Strg or shift Optionsbddy1 = opaque Optionsbddy2 = lucent OptionsQuizAppendFalse = false answered questions are saved in false.txt tipxtext = detach file from menu TrTitel = QizuL TrSettings = settings TrPause = pause TrWeiter = farther TrEnd = Exit ) IniVarOri :=IniVar xs := 100 ys := 200 x :=xs y := ys qr := 0 qf := 0 Toggle := true quizz := true startdir = %A_ScriptDir%\ INIfile = %A_ScriptDir%\%programName%.ini Gosub, inilang Return inilang: Gui, Submit, NoHide IfNotExist, %INIfile% { loadVarsFromIniVar(IniVar,"lang") loadVarsFromIniVar(IniVar,actualLang) Gui,5:Add, GroupBox, x10 h70 w120 vOgb5, %OptionsGroupBox5% StringSplit, LangString, possibleLangs, `,%A_Space%%A_Tab%`n`r Loop,%LangString0% { r1 := (LangString%a_index% = actualLang) ? 1 : 0 Gui,5:Add, Radio, vChkLang%a_index% x30 yp+20 Checked%r1% , % LangString%a_index% } Menualt:=MenulanguageTitel Gui,5:Add, Button,x20 yp+30 gsavelang vsavelang,OK Gui,5:Show, ,Language - Sprache WinGetPos , X, Y, ,GH , Language - Sprache GH := GH -70 WinMove, Language - Sprache, , , , GW2 GuiControl, 5:Move, Ogb5, h%gH% }Else Gosub, main Return savelang: Gui, Submit, NoHide loop,%LangString0% { if (ChkLang%a_index%) { actualLang := LangString%a_index% } } Gui,5:Destroy Gosub, main Return main: Gui, Submit, NoHide Gosub, initiate Gosub, showVocabel If (!quizz) SetTimer, showVocabel, %Wechselzeit% Menu, tray, NoStandard Menu, tray, add,%TrTitel%, void Menu, tray, add,%TrSettings%, options Menu, tray, add Menu, tray, add, %TrPause%, pause Menu, Tray, Default,%TrPause% Menu, tray, add Menu, tray, add, %TrEnd%, GuiClose Return initiate: IfNotExist, %INIfile% { FileAppend, %IniVar%,%INIfile% IniWrite, %actualLang%, %INIfile%, lang, actualLang res := CmnDlg_Open("", "Select several files with STRG or SHIFT", "(*.txt)", "", startdir, "txt", "ALLOWMultiSELECT FILEMUSTExist HIDEReadOnly") If (res <> ""){ StringSplit, MyPathArray, res, `n IniWrite, %MyPathArray0%,%INIfile%, config, MyPathArray0 Loop, %MyPathArray0% { path = % MyPathArray%a_index% T = MyPathArray%a_index% IniWrite, %path%,%INIfile%, config, %t% } } Else { MsgBox, Exit ExitApp } FileRead, IniVar, %iniFile% }Else { Gosub, update FileRead, IniVar, %iniFile% StringSplit, LangString, possibleLangs, `,%A_Space%%A_Tab%`n`r } loadVarsFromIniVar(IniVar,"config") loadVarsFromIniVar(IniVar,"lang") loadVarsFromIniVar(IniVar,actualLang) Loop, %MyPathArray0% { IfNotExist,% MyPathArray%a_index% { Sleep, 200 res := CmnDlg_Open("", "Select several files with STRG or SHIFT", "(*.txt)", "", startdir, "txt", "ALLOWMultiSELECT FILEMUSTExist HIDEReadOnly") If (res <> ""){ StringSplit, MyPathArray, res, `n IniWrite, %MyPathArray0%,%INIfile%, config, MyPathArray0 z=0 Loop, %MyPathArray0% { z++ path = % MyPathArray%z% T = MyPathArray%z% IniWrite, %path%,%INIfile%, config, %t% } } ;FileRead, IniVar, %iniFile% } } Return update: Gui, Submit, NoHide loadVarsFromIniVar(IniVarOri,"lang") items1 := loadVarsFromIniVar(IniVarOri,actualLang) IfExist, %INIfile% { FileRead, IniVar, %iniFile% loadVarsFromIniVar(IniVar,"lang") items := loadVarsFromIniVar(IniVar,actualLang) } If (items <> items1){ FileMove, %iniFile%, %A_ScriptDir%\%programName%%a_now%.ini MsgBox, IniFile is updated Reload } Return showVocabel: Gui,Submit, NoHide Random, randfile , 1, %MyPathArray0% FileRead, Contents, % MyPathArray%randfile% Contents := fmakedata(contents) StringSplit, Block_en, Contents, ¢ If (q%randfile% ="" ) { str= Loop, % Block_en0 { str = %str%%a_Space%Block_en%a_index%-%randfile% } str%randfile% := str strg%randfile% := str q%randfile% :=1 gesamt += Block_en0 } gg:=str%randfile% ggg:=strg%randfile% tester:=testfunc(str%randfile%,id1) c:=testdelfunc(strg%randfile%,tester) d =%c% id2= n1:=testfunc(d,id2) n2:=testfunc(d,id2) OutputDebug, tester<%tester%< `nid1=<%id1%< `ngg=%gg%< `n`n StringSplit, Block, tester,- StringSplit, d1, n1,- StringSplit, d2, n2,- test := fgetrandomvocabel(%Block1%,notRandom) ;Randomlinksrechts 012 StringSplit, test, test, ¢ maintext := test1 subtext := test2 subtext1 := test3 rand1 := test4 rand2 := test5 If (quizz) Gosub,simpleshow3 Else Gosub,simpleshow Return simpleshow3: SetTimer, showVocabel, off Random, rand4 , 1, 3 Gui, 3:Destroy Gui, 3:Submit, NoHide thisBlock := %d11% subtextdummy1 := fgetdummyvocabel(rand2,thisBlock) thisBlock := %d21% subtextdummy2 := fgetdummyvocabel(rand2,thisBlock) Gui, 3:Color, %CustomColor% Gui,3: -SysMenu +ToolWindow Gui, 3:Add, GroupBox, x10 h30 vgb1, %quizzGroupBox1% Gui, 3:Add, text, x20 y20 ,%maintext% Gui, 3:Add, GroupBox, x10 h130 vgb2, %quizzGroupBox2% If (rand4 = 1){ Gui, 3:Add, Radio, vMyRadio x20 yp+30 ,%subtext1% Gui, 3:Add, Radio,x20 yp+30 ,%subtextdummy2% Gui, 3:Add, Radio, x20 yp+30 ,%subtextdummy1% } Else If (rand4 = 2){ Gui, 3:Add, Radio, vMyRadio x20 yp+30 ,%subtextdummy2% Gui, 3:Add, Radio, x20 yp+30 ,%subtext1% Gui, 3:Add, Radio, x20 yp+30 ,%subtextdummy1% } Else If (rand4 = 3){ Gui, 3:Add, Radio, vMyRadio x20 yp+30 ,%subtextdummy2% Gui, 3:Add, Radio, x20 yp+30 ,%subtextdummy1% Gui, 3:Add, Radio, x20 yp+30 ,%subtext1% } Gui, 3:Add, Button, Default yp+60 gsimpleshow4 ,%quizzButtonOK% Gui, 3:Show,x%x% y%y%, %quizzTitel1% WinGetPos , X, Y,GW ,GH , %quizzTitel1% GW += -25 GuiControl, 3:Move, gb1, x10 w%gw% GuiControl, 3:Move, gb2, x10 w%gw% WinSet, Transparent, %transparency%, %quizzTitel1% WinSet, AlwaysOnTop, , %quizzTitel1% Return simpleshow4: Gui, 3:Submit, NoHide IfWinExist, %quizzTitel1% WinGetPos , X, Y, , , %quizzTitel1% Gui, 3:Destroy Gui, 4:Submit, NoHide Gui,4: -SysMenu +ToolWindow Gui, 4:Color, %CustomColor% zaehler++ zaehler := (zaehler<=gesamt) ? zaehler : 0 Gui, 4:Add, GroupBox, x20 h30 vgb3, %quizzGroupBox3% If (myRadio = rand4){ qr++ Gui, 4:Add, text, cGreen x20 yp+15 , %quizzcorrect% %qr%:%qf% %zaehler%/%gesamt% ;Fileappend, %maintext% = %subtext%`n`n,correct.txt } Else{ qf++ Gui, 4:Add, text,cRed x20 yp+15 ,%qr%:%qf% %zaehler%/%gesamt% %quizzfalse% str%randfile% .= a_Space . tester bb:=str%randfile% ; outputdebug,<%id1%< id1:=testdelfunc(id1,tester) OutputDebug,<%id1%< <%tester%< ; ;OutputDebug,<%tester%< bb=%bb% If (appendFalse) FileAppend, %maintext% = %subtext%`n`n,false.txt } Gui, 4:Add, GroupBox, x10 yp+20 h40 vgb4, %quizzGroupBox1% Gui, 4:Add, text, x20 yp+20 ,%maintext% Gui, 4:Add, GroupBox, x10 h30 vgb5, %quizzanswer% Gui, 4:Add, text, x20 yp+15 ,%subtext% Gui, 4:Add, text, x10 , Gui, 4:Show, x%x% y%y% , %quizzTitel2% WinGetPos , X, Y,GW ,GH , %quizzTitel2% GW += -25 GH += -25 -40 -50 -10 GuiControl, 4:Move, gb3, x10 w%gw% GuiControl, 4:Move, gb4, x10 w%gw% GuiControl, 4:Move, gb5, x10 w%gw% h%GH% WinSet, Transparent, %transparency%, %quizzTitel2% WinSet, AlwaysOnTop, , %quizzTitel2% Sleep %Anzeigedauer% Gui, 4:Destroy If (Toggle) SetTimer, showVocabel, on Return simpleshow: If (Toggle){ If (x>A_ScreenWidth or x<0) x:= xs If (y>A_ScreenHeight or y<0) y:= ys SplashImage , ,x%x% y%y% M %SpForm%, , %maintext%,%programName% WinSet, Transparent, %transparency%, %programName% Sleep %Anzeigedauer% IfWinExist, %programName% WinGetPos , X, Y, , , %programName% } If (Toggle){ SplashImage , ,x%x% y%y% M %SpForm%, %subtext%,%maintext% ,%programName% WinSet, Transparent, %transparency%, %programName% Sleep %Anzeigedauer% IfWinExist, %programName% WinGetPos , X, Y, , , %programName% SplashImage, Off } Return ;--------------------------- ;Options related ;--------------------------- options: Gui, 2:Submit, NoHide wg := 60 line:= 3 + MyPathArray0 Gui, 2:Add, GroupBox, r%line% vOgb1, %OptionsGroupBox1% Gui, 2:Add, Button,xp+10 yp+20 gnewPath vO_path,%OptionsButtonFile% Gui, 2:Add, text,x15 y40 , Loop,%MyPathArray0% { Gui, 2:Add, Button,x20 yp+20 vopen%a_index% gnotepad,%OptionsOpen% ToolTip , Text, 20, Gui, 2:Add, Button,xp+50 yp+0 vdetach%a_index% gdetach,x Gui, 2:Add, text, xp+20 yp+5 vopentext%a_index%, % MyPathArray%a_index% } Gui, 2:Add, text,x-200 y-300 vbddy1,`n`n`n%Optionsbddy2% Gui, 2:Add, text, x-200 y-300 vbddy2,`n`n`n%Optionsbddy1% Gui, 2:Add, GroupBox, x10 h60 w%wg% vOgb2, %OptionsGroupBox2% Gui, 2:Add, edit, xp+10 yp+20 w50 R1 ReadOnly vtedit,%transparency% Gui, 2:Add, Slider,xp+100 yp+0 w255 Buddy1bddy1 Buddy2bddy2 gslide vMySlider Range1-255 , %transparency% Gui, 2:Add, GroupBox, x10 h130 w%wg% vOgb3, %OptionsGroupBox3% Gui, 2:Add, edit,xp+10 yp+20 R1 w50 vWmin,%Wmin% Gui, 2:Add, text, xp+60 yp+3 ,- Gui, 2:Add, edit,xp+15 yp-3 R1 w50 vWmax,%Wmax% Gui, 2:Add, text,xp+60 yp+3 ,%OptionsTime% StringReplace, OptionsChangeTime, OptionsChangeTime,Wmax, %Wmax% StringReplace, OptionsChangeTime, OptionsChangeTime,Wmin, %Wmin% Gui, 2:Add, text,x20 yp+30 ,%OptionsChangeTime% Gui, 2:Add, edit,xp+0 yp+30 R1 w50 vAnzeigedauer,%Anzeigedauer% Gui, 2:Add, text,xp+60 yp+3 ,%OptionsText1% Gui, 2:Add, GroupBox, x10 h70 w%wg% vOgb4, %OptionsGroupBox4% If (SpForm = "C00"){ Gui, 2:Add, Radio, vtextleft Checked xp+10 yp+20, %OptionsRadioLeft% Gui, 2:Add, Radio, vtextCenter xp+0 yp+20,%OptionsRadioCenter% }Else{ Gui, 2:Add, Radio, vtextleft xp+10 yp+20, %OptionsRadioLeft% Gui, 2:Add, Radio, vtextCenter Checked xp+0 yp+20,%OptionsRadioCenter% } Gui, 2:Add, GroupBox, x10 h110 w%wg% vOgb6, %OptionsShowmodus% If (quizz) Gui, 2:Add, Checkbox, Checked vquizz xp+10 yp+20, %OptionsShowmodus% Else Gui, 2:Add, Checkbox, vquizz xp+10 yp+20, %OptionsShowmodus% If (notRandom = 0) { Gui, 2:Add, Radio, vtextnr0 Checked xp+120 yp+0 Section, %OptionsQuizRandom0% Gui, 2:Add, Radio, vtextnr1 xp+0 yp+20,%OptionsQuizRandom1% Gui, 2:Add, Radio, vtextnr2 xp+0 yp+20,%OptionsQuizRandom2% }Else If (notRandom = 1) { Gui, 2:Add, Radio, vtextnr0 xp+120 yp+0 Section, %OptionsQuizRandom0% Gui, 2:Add, Radio, vtextnr1 Checked xp+0 yp+20,%OptionsQuizRandom1% Gui, 2:Add, Radio, vtextnr2 xp+0 yp+20,%OptionsQuizRandom2% }Else If (notRandom = 2) { Gui, 2:Add, Radio, vtextnr0 xp+120 yp+0 Section, %OptionsQuizRandom0% Gui, 2:Add, Radio, vtextnr1 xp+0 yp+20,%OptionsQuizRandom1% Gui, 2:Add, Radio, vtextnr2 Checked xp+0 yp+20,%OptionsQuizRandom2% }Else { Gui, 2:Add, Radio, vtextnr0 Checked xp+120 yp+0 Section, %OptionsQuizRandom0% Gui, 2:Add, Radio, vtextnr1 xp+0 yp+20,%OptionsQuizRandom1% Gui, 2:Add, Radio, vtextnr2 xp+0 yp+20,%OptionsQuizRandom2% } Gui, 2:Add, Button,xp+160 ys+0 gcolor vColor,%OptionsQuizColor% Gui, 2:Add, Checkbox, vappendFalse Checked%appendFalse% x20 yp+70,%OptionsQuizAppendFalse% Gui, 2:Add, GroupBox,Section x10 h50 w%wg% vOgb5, %OptionsGroupBox5% Gui, 2:Add, text, x-20 yp+10, Loop,%LangString0% { r1 := (LangString%a_index% = actualLang) ? 1 : 0 Gui,2:Add, Radio, vChkLang%a_index% xp+40 ys+20 Checked%r1% , % LangString%a_index% } Menualt:=MenulanguageTitel Gui, 2:Add, Button,x20 yp+50 gsave vsave,%OptionsButtonsave% Gui, 2:Add, Button,xp+160 yp+0 greset vreset,%OptionsButtonreset% Gui, 2:Show, , %OptionsTitle% WinGetPos , X, Y,GW , , %OptionsTitle% GW2 := GW +10 GW += -15 WinMove, %OptionsTitle%, , , , GW2 GuiControl, 2:Move, Ogb1, w%gw% GuiControl, 2:Move, Ogb2, w%gw% GuiControl, 2:Move, Ogb3, x10 w%gw% GuiControl, 2:Move, Ogb4, x10 w%gw% GuiControl, 2:Move, Ogb5, x10 w%gw% GuiControl, 2:Move, Ogb6, x10 w%gw% SetTimer, Tip, 2000 Return color: If CmnDlg_Color( customColor := 0xEEAA99 ){ ; Gui, 2:Color, %CustomColor% Gui, 3:Color, %CustomColor% Gui, 4:Color, %CustomColor% } Return detach: l=0 Loop,%MyPathArray0% { i := a_index * 2 + 2 MouseGetPos, , , , Control IfInString, Control, %i% { j:= i-1 k:=a_index +1 GuiControl, 2:Hide, Button%i% GuiControl, 2:Hide, Button%j% GuiControl, 2:Hide, static%k% } Else{ l++ MyPathArray%l% :=MyPathArray%a_index% } } MyPathArray0 := l SetTimer, Tip, off Gui, 2:Destroy Gosub, options Return notepad: Loop,%MyPathArray0% { i := a_index *2 + 1 MouseGetPos, , , , Control IfInString, Control, %i% Run, % MyPathArray%a_index% } Return newPath: if (MyPathArray1 <>""){ SplitPath, MyPathArray1,, startdir startdir =%startdir%\ } res := CmnDlg_Open("", OptionsCmnDlg, "(*.txt)", "", startdir, "txt", "ALLOWMultiSELECT FILEMUSTExist HIDEReadOnly") If (res <>"") { StringSplit, MyArray, res, `n newA0:= MyArray0 + MyPathArray0 o=0 Loop, %newA0% If (a_index >MyPathArray0){ o++ MyPathArray%a_index% := MyArray%o% } MyPathArray0 := newA0 Gui, 2:Destroy Gosub, options } Return Tip: Gui, 2:Submit, NoHide MouseGetPos, , , , Control i= Tip = Loop,%MyPathArray0% { i := a_index * 2 + 2 ctr =Button%i% If (Control = ctr) Tip = %tipxtext% } If Control <> %LastCtrl% { ToolTip, %Tip% LastCtrl = %Control% } Return reset: loadVarsFromIniVar(IniVarOri,"config") Gosub,save Return save: Gui,Submit, NoHide IniWrite, %Wmin%, %INIfile%, config, Wmin IniWrite, %Wmax%, %INIfile%, config, Wmax IniWrite, %Anzeigedauer%, %INIfile%, config, Anzeigedauer IniWrite, %transparency%, %INIfile%, config, transparency IniWrite, %x%, %INIfile%, config, x IniWrite, %y%, %INIfile%, config, y IniWrite, %CustomColor%, %INIfile%, config, CustomColor IniWrite, %appendFalse%, %INIfile%, config, appendFalse Loop,%LangString0% { If (ChkLang%a_index%) { actualLang := LangString%a_index% IniWrite, %actualLang%, %INIfile%, lang, actualLang ;loadVarsFromIniVar(IniVar,actualLang) ;gosub,updateLang ;reload } } If (textnr0) notRandom := 0 Else If (textnr1) notRandom := 1 Else If (textnr2) notRandom := 2 If (textleft) SpForm = C00 Else SpForm = C11 IniWrite, %notRandom%, %INIfile%, config, notRandom IniWrite, %actualLang%, %INIfile%, lang, actualLang IniWrite, %SpForm%, %INIfile%, config, SpForm IniWrite, %quizz%, %INIfile%, config, quizz IniWrite, %MyPathArray0%,%INIfile%, config, MyPathArray0 Loop, 100 { path = MyPathArray%a_index% IniDelete, %INIfile%, config ,%path% } Loop, %MyPathArray0% { path = % MyPathArray%a_index% T = MyPathArray%a_index% IniWrite, %path%,%INIfile%, config, %t% } Reload Return slide: Gui, Submit, NoHide GuiControl,2:,tedit ,%MySlider% transparency := MySlider Return ;--------------------------- ;Options related end ;--------------------------- ;--------------------------- ;Tray related ;--------------------------- pause: If (Toggle){ Toggle := False Menu, tray,Rename, %TrPause% , %TrWeiter% Gui, 3:Destroy Gui, 4:Destroy IfWinExist, %programName% WinGetPos , X, Y, , , %programName% SplashImage, Off SetTimer, showVocabel, off }Else{ Toggle := True Menu, tray,Rename, %TrWeiter% ,%TrPause% Gosub, showVocabel SetTimer, showVocabel, on } Return void: Return ;--------------------------- ;Tray related end ;--------------------------- esc:: GuiEscape: GuiClose: IniWrite, %x%, %INIfile%, config, x IniWrite, %y%, %INIfile%, config, y ExitApp Return 2GuiEscape: 2GuiClose: SetTimer, Tip, off Gui,2:Destroy Return ;--------------------------- ;Functions ;--------------------------- fmakedata(contents) { Contents := RegExReplace(contents, "m)^;(.*)$") StringReplace, Contents, Contents, `r, `n, All StringReplace, Contents, Contents, `n`n, `n, All Loop { StringReplace, contents, contents,`n`n`n,`n`n, UseErrorLevel If ErrorLevel = 0 ; No more replacements needed. Break } StringReplace, Contents, Contents, `n`n, ¢, All contents = %contents% Return contents } fgetrandomvocabel(thisblock,notrandom){ If (notRandom = 1) rand2 := 1 Else If (notRandom = 2) rand2 := 2 Else If (notRandom = 0) Random, rand2 , 1, 2 Random, Wechselzeit , %Wmin%, %Wmax% StringReplace, test, thisBlock, `n, ¢, All StringSplit, VocLine, test, ¢ If (rand2 = 1){ StringSplit, testt, VocLine1, = maintext = %testt1% subtext := thisBlock subtext1 := testt2 }Else { Random, rand3 , 1, %VocLine0% StringSplit, Voc, VocLine%rand3%,= maintext = %Voc2% subtext := Voc1 subtext1 := subtext } Return maintext . "¢" . subtext . "¢" . subtext1 . "¢" . rand1 . "¢" . rand2 } fgetrandomvocabel1(contents,notrandom){ StringSplit, Block_en, Contents, ¢ Random, rand1 , 1, %Block_en0% If (notRandom = 1) rand2 := 1 Else If (notRandom = 2) rand2 := 2 Else If (notRandom = 0) Random, rand2 , 1, 2 Random, Wechselzeit , %Wmin%, %Wmax% thisBlock := Block_en%rand1% StringReplace, test, thisBlock, `n, ¢, All StringSplit, VocLine, test, ¢ If (rand2 = 1){ StringSplit, testt, VocLine1, = maintext = %testt1% subtext := thisBlock subtext1 := testt2 }Else { Random, rand3 , 1, %VocLine0% StringSplit, Voc, VocLine%rand3%,= maintext = %Voc2% subtext := Voc1 subtext1 := subtext } Return maintext . "¢" . subtext . "¢" . subtext1 . "¢" . rand1 . "¢" . rand2 } fgetdummyvocabel(rand2,thisblock){ StringReplace, test, thisBlock, `n, ¢, All StringSplit, VocLine, test, ¢ If (rand2 = 1){ StringSplit, testt, VocLine1, = subtextdummy := testt2 }Else { Random, rand3 , 1, %VocLine0% StringSplit, Voc, VocLine%rand3%,= subtextdummy := Voc1 } Return subtextdummy } loadVarsFromIniVar(iniVar,iniSectionsToLoad) ; from not-logged-in-daonlyfreez ; http://www.autohotkey.com/forum/post-41881.html#41881 { global local loadEm loadEm = 0 Counter := 0 Loop, Parse, iniVar, `n, `r { ; Scan for section, if the line is a section, get section name, ; compare to iniSectionsToLoad, set loadEm flag If A_LoopField Contains [ { If A_LoopField Contains ] { StringMid, anIniSection, A_LoopField, InStr(A_LoopField,"]")-1, StrLen(A_LoopField)-2, L ; Get Section name If anIniSection in %iniSectionsToLoad% ; is it in our matchlist? loadEm = 1 Else loadEm = 0 If iniSectionsToLoad = ; is it empty? -> get nothing ;all loadEm = 0 ;1 } } ; Set key and value of the line to a variable named like the key ; and with the value of the key If loadEm = 1 { If A_LoopField Contains = { Counter++ StringSplit, Fiel, A_LoopField, = field =%field1%= StringSplit, Field, A_LoopField, = ,%A_Space%%A_Tab%`n`r ;after the last comma its from Haichen :-) %Field1% := Fiel2 } } } Return Counter } testdelfunc(string,delstring) { string=%string% delstring=%delstring% StringSplit, splitter,string,%A_Space%,%A_Space% strg= Loop, %splitter0% If (delstring<>splitter%a_index%) strg .= A_Space . splitter%a_index% string = %strg% Return %string% } testfunc(ByRef string,ByRef x) { string =%string% StringSplit, splitter,string,%A_Space%,%A_Space% If (splitter0 =1){ z := splitter1 x .=A_Space . z y= %x% string = %x% x= }Else{ Random,rand1,1,%splitter0% z := splitter%rand1% x .=A_Space . z y = %x% strg= Loop, %splitter0% If (z<>splitter%a_index%) strg .= A_Space . splitter%a_index% string = %strg% } ;outputdebug, %splitter0% %x% ;outputdebug, ,hallo rand1=%rand1% <%splitter0%< <%string%< z=%z%< y=%y%< Return %z% ; y } ;--------------------------- ;Functions end ;--------------------------- ;--------------------------- ;Includes ;--------------------------- ;==================== START: #Include CmnDlg.ahk :B1AD529B-BF4E-477F-8B9F-3080CAC55AE3 ; Title: CmnDlg ; *Common Operating System dialogs* ;---------------------------------------------------------------------------------------------- ; Function: Color ; Display standard color dialog ; ; Parameters: ; pColor - Initial color and output in RGB format, ; hGui - Optional handle to parents HWND ; ; Returns: ; False if user canceled the dialog or if error occurred ; ; CmnDlg_Color(ByRef pColor, hGui=0){ ;covert from rgb clr := ((pColor & 0xFF) << 16) + (pColor & 0xFF00) + ((pColor >> 16) & 0xFF) VarSetCapacity(sCHOOSECOLOR, 0x24, 0) VarSetCapacity(aChooseColor, 64, 0) NumPut(0x24, sCHOOSECOLOR, 0) ; DWORD lStructSize NumPut(hGui, sCHOOSECOLOR, 4) ; HWND hwndOwner (makes dialog "modal"). NumPut(clr, sCHOOSECOLOR, 12) ; clr.rgbResult NumPut(&aChooseColor,sCHOOSECOLOR, 16) ; COLORREF *lpCustColors NumPut(0x00000103, sCHOOSECOLOR, 20) ; Flag: CC_ANYCOLOR || CC_RGBINIT nRC := DllCall("comdlg32\ChooseColorA", str, sCHOOSECOLOR) ; Display the dialog. if (errorlevel <> 0) || (nRC = 0) return false clr := NumGet(sCHOOSECOLOR, 12) oldFormat := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. ;convert to rgb pColor := (clr & 0xff00) + ((clr & 0xff0000) >> 16) + ((clr & 0xff) << 16) StringTrimLeft, pColor, pColor, 2 loop, % 6-strlen(pColor) pColor=0%pColor% pColor=0x%pColor% SetFormat, integer, %oldFormat% return true } ;---------------------------------------------------------------------------------------------- ; Function: Find / Replace ; Display standard Find and Replace dialog boxes. ; ; Parameters: ; hGui - Handle to parents HWND ; lbl - Label used for communication with dialog. CmnDlg_Event, CmnDlg_FindWhat and CmnDlg_Flags hold the dialog data ; flags - Creation flags, see below. ; deff - Default text to be displayed at the start of the dialog box in find edit box ; defr - Default text to be displayed at the start of the dialog box in replace edit box ; ; Flags: ; String containing list of creation flags. You can use "-" prefix to hide that GUI field. ; ; d - down radio button selected in Find dialog ; w - whole word selected ; c - match case selected ; ; Globals: ; Dialog box is not modal, so it communicates with the script using 4 global variables: ; ; Event - "close", "find", "replace", "replace_all" ; Flags - string contaning flags about user selection; each letter means user has selected that particular GUI element. ; FindWhat - user find text ; ReplaceWith - user replace text ; ; Returns: ; Handle of the dialog or 0 if dialog can't be created. Can also return "Invalid Label" if lbl is not valid. ; CmnDlg_Find( hGui, lbl, flags="d", deff="") { static FINDMSGSTRING = "commdlg_FindReplace" static FR_DOWN=1, FR_MATCHCASE=4, FR_WHOLEWORD=2, FR_HIDEMATCHCASE=0x8000, FR_HIDEWHOLEWORD=0x10000, FR_HIDEUPDOWN=0x4000 static buf, FR, len := 256 if !Islabel(lbl) return "Invalid Label" f := 0 f |= InStr(flags, "d") ? FR_DOWN : 0 f |= InStr(flags, "c") ? FR_MATCHCASE : 0 f |= InStr(flags, "w") ? FR_WHOLEWORD : 0 f |= InStr(flags, "-d") ? FR_HIDEUPDOWN : 0 f |= InStr(flags, "-w") ? FR_HIDEWHOLEWORD :0 f |= InStr(flags, "-c") ? FR_HIDEMATCHCASE :0 if FR = VarSetCapacity(FR, 40, 0), VarSetCapacity(buf, len) if deff != buf := deff NumPut( 40, FR, 0) ;size NumPut( hGui, FR, 4) ;hwndOwner NumPut( f, FR, 12) ;Flags NumPut( &buf, FR, 16) ;lpstrFindWhat NumPut( len, FR, 24) ;wFindWhatLen CmnDlg_callback(lbl,"","","") OnMessage( DllCall("RegisterWindowMessage", "str", FINDMSGSTRING), "CmnDlg_callback" ) return DllCall("comdlg32\FindTextA", "str", FR) } ;---------------------------------------------------------------------------------------------- ; Function: Font ; Display standard font dialog ; ; Parameters: ; pFace - Initial font, output ; pStyle - Initial style, output ; pColor - Initial text color, output ; pEffects - Set to false to disable effects (strikeout, underline, color) ; hGui - Parent's handle, affects position ; ; Returns: ; False if user canceled the dialog or if error occurred ; CmnDlg_Font(ByRef pFace, ByRef pStyle, ByRef pColor, pEffects=true, hGui=0) { RegRead, LogPixels, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI, LogPixels VarSetCapacity(SLogFont, 128, 0) pEffects := pEffects ? 0x100 : 0 ;set initial name DllCall("RtlMoveMemory", "uint", &SLogFont+28, "Uint", &pFace, "Uint", 32) ;convert from rgb clr := ((pColor & 0xFF) << 16) + (pColor & 0xFF00) + ((pColor >> 16) & 0xFF) ;set intial data if InStr(pStyle, "bold") NumPut(700, SLogFont, 16) if InStr(pStyle, "italic") NumPut(255, SLogFont, 20, 1 ) if InStr(pStyle, "underline") NumPut(1, SLogFont, 21, 1) if InStr(pStyle, "strikeout") NumPut(1, SLogFont, 22, 1) if RegExMatch( pStyle, "s[1-9][0-9]*", s){ StringTrimLeft, s, s, 1 s := -DllCall("MulDiv", "int", s, "int", LogPixels, "int", 72) NumPut(s, SLogFont, 0) ; set size } else NumPut(16, SLogFont, 0) ; set default size VarSetCapacity(SChooseFont, 60, 0) NumPut(60, SChooseFont, 0) ; DWORD lStructSize NumPut(hGui, SChooseFont, 4) ; HWND hwndOwner (makes dialog "modal"). NumPut(&SLogFont, SChooseFont, 12) ; LPLOGFONT lpLogFont NumPut(0x041 + pEffects, SChooseFont, 20) ; CF_EFFECTS = 0x100, CF_SCREENFONTS = 1, CF_INITTOLOGFONTSTRUCT = 0x40 NumPut(clr, SChooseFont, 24) ; rgbColors r := DllCall("comdlg32\ChooseFontA", "uint", &SChooseFont) ; Display the dialog. if !r return false ;font name VarSetCapacity(pFace, 32) DllCall("RtlMoveMemory", "str", pFace, "Uint", &SLogFont + 28, "Uint", 32) pStyle := "s" NumGet(SChooseFont, 16) // 10 ;color old := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. pColor := NumGet(SChooseFont, 24) SetFormat, integer, %old% ;styles pStyle = VarSetCapacity(s, 3) DllCall("RtlMoveMemory", "str", s, "Uint", &SLogFont + 20, "Uint", 3) if NumGet(SLogFont, 16) >= 700 pStyle .= "bold " if NumGet(SLogFont, 20, "UChar") pStyle .= "italic " if NumGet(SLogFont, 21, "UChar") pStyle .= "underline " if NumGet(SLogFont, 22, "UChar") pStyle .= "strikeout " s := NumGet(sLogFont, 0) pStyle .= "s" Abs(DllCall("MulDiv", "int", abs(s), "int", 72, "int", LogPixels)) ;convert to rgb oldFormat := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. pColor := (pColor & 0xff00) + ((pColor & 0xff0000) >> 16) + ((pColor & 0xff) << 16) StringTrimLeft, pColor, pColor, 2 loop, % 6-strlen(pColor) pColor=0%pColor% pColor=0x%pColor% SetFormat, integer, %oldFormat% return 1 } ;----------------------------------------------------------------------------------------------- ; Function: Icon ; Display standard icon dialog. ; ; Parameters: ; sIcon - Default icon resource, output ; idx - Default index within resource, output ; hGui - Optional handle of the parent GUI. ; ; Returns: ; False if user canceled the dialog or if error occurred ; ; Remarks: ; This is simple and non-fleixibile dialog. If you need more flexibility, use instead. ; CmnDlg_Icon(ByRef sIcon, ByRef idx, hGui=0) { VarSetCapacity(wIcon, 1025, 0) If sIcon { r := DllCall("MultiByteToWideChar", "UInt", 0, "UInt", 0, "Str", sIcon, "Int", StrLen(sIcon), "UInt", &wIcon, "Int", 1025) IfEqual, r, 0, return false } r := DllCall(DllCall("GetProcAddress", "Uint", DllCall("LoadLibrary", "str", "shell32.dll"), "Uint", 62), "uint", hGui, "uint", &wIcon, "uint", 1025, "intp", (--idx)++) IfEqual, r, 0, return false Len := DllCall("lstrlenW", "UInt", &wIcon) VarSetCapacity(sIcon, len, 0) r := DllCall("WideCharToMultiByte" , "UInt", 0, "UInt", 0, "UInt", &wIcon, "Int", len, "Str", sIcon, "Int", len, "UInt", 0, "UInt", 0) IfEqual, r, 0, return false Return True } ;---------------------------------------------------------------------------------------------- ; Function: Open / Save ; Display standard Open / Save dialog ; ; Parameters: ; hGui - Parent's handle, positive number by default 0 (influences dialog position) ; Title - Dialog title ; Filter - Specify filter as with FileSelectFile. Seperate multiple filters with "|" ; DefultFilter - Index of default filter, by default 1 ; Root - Specifies startup directory and initial content of "File Name" edit. ; Directory must have trailing "\". ; DefaulltExt - Extension to append when none given ; Flags - White space separated list of flags, by default "FILEMUSTEXIST HIDEREADONLY" ; ; Flags: ; ALLOWMULTISELECT - Specifies that the File Name list box allows multiple selections ; CREATEPROMPT - If the user specifies a file that does not exist, this flag causes the dialog box to prompt the user for permission to create the file ; DONTADDTORECENT - Prevents the system from adding a link to the selected file in the file system directory that contains the user's most recently used documents. ; EXTENSIONDIFFERENT - Specifies that the user typed a file name extension that differs from the extension specified by defaulltExt ; FILEMUSTEXIST - Specifies that the user can type only names of existing files in the File Name entry field ; FORCESHOWHIDDEN - Forces the showing of system and hidden files, thus overriding the user setting to show or not show hidden files. However, a file that is marked both system and hidden is not shown. ; HIDEREADONLY - Hides the Read Only check box. ; NOCHANGEDIR - Restores the current directory to its original value if the user changed the directory while searching for files. ; NODEREFERENCELINKS - Directs the dialog box to return the path and file name of the selected shortcut (.LNK) file. If this value is not specified, the dialog box returns the path and file name of the file referenced by the shortcut. ; NOVALIDATE - Specifies that the common dialog boxes allow invalid characters in the returned file name ; OVERWRITEPROMPT - Causes the Save As dialog box to generate a message box if the selected file already exists. The user must confirm whether to overwrite the file. ; PATHMUSTEXIST - Specifies that the user can type only valid paths and file names. ; READONLY - Causes the Read Only check box to be selected initially when the dialog box is created ; SHOWHELP - Causes the dialog box to display the Help button. The hGui receives the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. ; NOREADONLYRETURN - Specifies that the returned file does not have the Read Only check box selected and is not in a write-protected directory. ; NOTESTFILECREATE - Specifies that the file is not created before the dialog box is closed. This flag should be specified if the application saves the file on a create-nonmodify network share. ; ; Returns: ; Selected FileName or Emtpy when cancelled. If more then one file is selected they are separated by new line character. ; CmnDlg_Open( hGui=0, Title="", Filter="", defaultFilter="", Root="", defaultExt="", flags="FILEMUSTEXIST HIDEREADONLY" ) { static OFN_ALLOWMULTISELECT:=0x200, OFN_CREATEPROMPT:=0x2000, OFN_DONTADDTORECENT:=0x2000000, OFN_EXTENSIONDIFFERENT:=0x400, OFN_FILEMUSTEXIST:=0x1000, OFN_FORCESHOWHIDDEN:=0x10000000, OFN_HIDEREADONLY:=0x4, OFN_NOCHANGEDIR:=0x8, OFN_NODEREFERENCELINKS:=0x100000, OFN_NOVALIDATE:=0x100, OFN_OVERWRITEPROMPT:=0x2, OFN_PATHMUSTEXIST:=0x800, OFN_READONLY:=0x1, OFN_SHOWHELP:=0x10, OFN_NOREADONLYRETURN:=0x8000, OFN_NOTESTFILECREATE:=0x10000 IfEqual, Filter, ,SetEnv, Filter, All Files (*.*) SplitPath, Root, RootFile, RootDir hFlags := 0x80000 ;OFN_ENABLEXPLORER always set loop, parse, flags,%A_TAB%%A_SPACE%,%A_TAB%%A_SPACE% if A_LoopField != hFlags |= OFN_%A_LoopField% VarSetCapacity( FN, 0xffff ) VarSetCapacity( lpstrFilter, 2*StrLen(filter)) VarSetCapacity( OFN ,90, 0) if RootFile != DllCall("lstrcpyn", "uint", &FN, "uint", &RootFile, "int", StrLen(RootFile)+1) ; Contruct FilterText seperate by \0 delta := 0 ;Used by Loop as Offset loop, Parse, Filter, | { desc := A_LoopField, ext := SubStr(A_LoopField, InStr( A_LoopField,"(" )+1, -1) lenD := StrLen(A_LoopField)+1, lenE := StrLen(ext)+1 ;including /0 DllCall("lstrcpyn", "uint", &lpstrFilter + delta, "uint", &desc, "int", lenD) DllCall("lstrcpyn", "uint", &lpstrFilter + delta + lenD, "uint", &ext, "int", lenE) delta += lenD + lenE } NumPut(0, lpstrFilter, delta, "UChar" ) ; Double Zero Termination ; Contruct OPENFILENAME Structure NumPut( 76, OFN, 0, "UInt" ) ; Length of Structure NumPut( hGui, OFN, 4, "UInt" ) ; HWND NumPut( &lpstrFilter, OFN, 12, "UInt" ) ; Pointer to FilterStruc NumPut( 0, OFN, 16, "UInt" ) ; Pointer to CustomFilter NumPut( 0, OFN, 20, "UInt" ) ; MaxChars for CustomFilter NumPut( defaultFilter, OFN, 24, "UInt" ) ; DefaultFilter Pair NumPut( &FN, OFN, 28, "UInt" ) ; lpstrFile / InitialisationFileName NumPut( 0xffff, OFN, 32, "UInt" ) ; MaxFile / lpstrFile length NumPut( 0, OFN, 36, "UInt" ) ; lpstrFileTitle NumPut( 0, OFN, 40, "UInt" ) ; maxFileTitle NumPut( &RootDir, OFN, 44, "UInt" ) ; StartDir NumPut( &Title, OFN, 48, "UInt" ) ; DlgTitle NumPut( hFlags, OFN, 52, "UInt" ) ; Flags NumPut( &defaultExt, OFN, 60, "UInt" ) ; DefaultExt res := (*&hGui = 45) ? DllCall("comdlg32\GetSaveFileNameA", "Uint", &OFN ) : DllCall("comdlg32\GetOpenFileNameA", "Uint", &OFN ) IfEqual, res, 0, return adr := &FN, f := d := DllCall("MulDiv", "Int", adr, "Int",1, "Int",1, "str"), res := "" if StrLen(d) != 3 ;windows adds \ when in root of the drive and doesn't do that otherwise d.="\" if ms := InStr(flags, "ALLOWMULTISELECT") loop if f := DllCall("MulDiv", "Int", adr += StrLen(f)+1, "Int",1, "Int",1, "str") res .= d f "`n" else { IfEqual, A_Index, 1, SetEnv, res, %d% ;if user selects only 1 file with multiselect flag, windows ignores this flag.... break } return ms ? SubStr(res, 1, -1) : SubStr(d, 1, -1) } CmnDlg_Replace( hGui, lbl, flags="", deff="", defr="") { static FINDMSGSTRING = "commdlg_FindReplace" static FR_MATCHCASE=4, FR_WHOLEWORD=2, FR_HIDEMATCHCASE=0x8000, FR_HIDEWHOLEWORD=0x10000, FR_HIDEUPDOWN=0x4000 static buf_s, buf_r, FR, len := 256 if !Islabel(lbl) return "Invalid Label" f := 0 f |= InStr(flags, "c") ? FR_MATCHCASE : 0 f |= InStr(flags, "w") ? FR_WHOLEWORD : 0 f |= InStr(flags, "-w") ? FR_HIDEWHOLEWORD :0 f |= InStr(flags, "-c") ? FR_HIDEMATCHCASE :0 if FR = VarSetCapacity(FR, 40, 0), VarSetCapacity(buf_s, len), VarSetCapacity(buf_r, len) if deff != buf_s := deff if defr != buf_r := defr NumPut( 40, FR, 0) ;size NumPut( hGui, FR, 4) ;hwndOwner NumPut( f, FR, 12) ;Flags NumPut( &buf_s, FR, 16) ;lpstrFindWhat NumPut( &buf_r, FR, 20) ;lpstrReplaceWith NumPut( len, FR, 24) ;wFindWhatLen NumPut( len, FR, 26) ;wReplaceWithLen CmnDlg_callback(lbl,"","","") OnMessage( DllCall("RegisterWindowMessage", "str", FINDMSGSTRING), "CmnDlg_callback" ) return DllCall("comdlg32\ReplaceTextA", "str", FR) } CmnDlg_Save( hGui=0, Title="", Filter="", defaultFilter="", Root="", defaultExt="", flags="" ) { return CmnDlg_Open( "-" hGui, Title, Filter, defaultFilter, Root, defaultExt, flags ) } ;=========================================== PRIVATE =============================================== CmnDlg_callback(wparam, lparam, msg, hwnd) { global CmnDlg_Event, CmnDlg_Flags, CmnDlg_FindWhat, CmnDlg_ReplaceWith static FR_DIALOGTERM = 0x40, FR_DOWN=1, FR_MATCHCASE=4, FR_WHOLEWORD=2, FR_HIDEMATCHCASE=0x8000, FR_HIDEWHOLEWORD=0x10000, FR_HIDEUPDOWN=0x4000, FR_REPLACE=0x10, FR_REPLACEALL=0x20, FR_FINDNEXT=8 static fun if (hwnd = "") return fun := wparam flags := NumGet(lparam+0, 12), CmnDlg_Flags := "" if (flags & FR_DIALOGTERM) { CmnDlg_Event := "close" gosub %fun% return } CmnDlg_Flags .= (Flags & FR_MATCHCASE) && !(Flags & FR_HIDEMATCHCASE)? "c" : CmnDlg_Flags .= (Flags & FR_WHOLEWORD) && !(Flags & FR_HIDEWHOLEWORD) ? "w" : CmnDlg_FindWhat := DllCall("MulDiv", "Int", NumGet(lparam+0, 16), "Int",1, "Int",1, "str") if (flags & FR_FINDNEXT) { CmnDlg_Event := "find" CmnDlg_Flags .= (Flags & FR_DOWN) && !(Flags & FR_HIDEUPDOWN) ? "d" : gosub %fun% return } if (flags & FR_REPLACE) or (flags & FR_REPLACEALL) { CmnDlg_Event := (flags & FR_REPLACEALL) ? "replace_all" : "replace" CmnDlg_ReplaceWith := DllCall("MulDiv", "Int", NumGet(lparam+0, 20), "Int",1, "Int",1, "str") gosub %fun% return } } ; ;Group: Examples ; ;Example1: ; ;> ;basic usage ;> ;> if CmnDlg_Icon(icon, idx := 4) ;> msgbox Icon: %icon%`nIndex: %idx% ;> ;> if CmnDlg_Color( color := 0xFF00AA ) ;> msgbox Color: %color% ;> ;> if CmnDlg_Font( font := "Courier New", style := "s16 bold underline italic", color:=0x80) ;> msgbox Font: %font%`nStyle: %style%`nColor: %color% ;> ;> res := CmnDlg_Open("", "Select several files", "", "", "c:\Windows\", "", "ALLOWMULTISELECT FILEMUSTEXIST HIDEREADONLY") ;> IfNotEqual, res, , MsgBox, %res% ;>return ; ;Example2: ;> ;create gui and set text color ;> ;> CmnDlg_Font( font := "Courier New", style := "s16 bold italic", color:=0xFF) ;> ;> Gui Font, %Style% c%Color%, %Font% ;> Gui, Add, Text, ,Hello world..... :roll: ;> Gui, Show, Autosize ;>return ; ;Group: About ; o Ver 4.03 by majkinetor. See http://www.autohotkey.com/forum/topic17230.html ; o Licenced under Creative Commons Attribution-Noncommercial . ;==================== END: #Include CmnDlg.ahk :B1AD529B-BF4E-477F-8B9F-3080CAC55AE3 ;CmnDlg: http://www.autohotkey.com/forum/topic17230.html