by garry » 13 Aug 2023, 11:18
une example ... enregistrer les paramètres sélectionnés
Code: Select all
;- Modified=20230813
;- Created =20140412
SplitPath,a_scriptname, name, dir, ext, name_no_ext, drive
F1=%a_scriptdir%\%name_no_ext%.ini
;-----------
I=12 ;- total checkboxes
src=Gloria Lasso ;- search for preselect
;-----------
Gui,2: Color,Black, Black
Gui,2: Font, CDefault s14, Lucida Console
Loop,%i%
{
IniRead, Ch%A_Index%, %f1%, ss, Cb%A_Index% , 0
If (Ch%A_Index% = 1)
Cb%A_Index% = Checked
Else
Cb%A_Index% =
}
Gui,2: Show, x100 y5 w350 h500, %name_no_ext%
Gui,2: Add, Edit, x20 y5 w315 h27 cWhite vSearch,%src%
Gui,2: Add, CheckBox, x20 y40 vCh1 %cb1% cYellow, Google
Gui,2: Add, CheckBox, x20 y65 vCh2 %cb2% cYellow, Google I``m feeling lucky
Gui,2: Add, CheckBox, x20 y90 vCh3 %cb3% cYellow, Bing Pictures
Gui,2: Add, CheckBox, x20 y115 vCh4 %cb4% cYellow, Flickr Pictures
Gui,2: Add, CheckBox, x20 y140 vCh5 %cb5% cYellow, Google Pictures
Gui,2: Add, CheckBox, x20 y165 vCh6 %cb6% cYellow, Google SEARCH fr
Gui,2: Add, CheckBox, x20 y190 vCh7 %cb7% cYellow, Google NEWS fr
Gui,2: Add, CheckBox, x20 y215 vCh8 %cb8% cYellow, Google PDF
Gui,2: Add, CheckBox, x20 y240 vCh9 %cb9% cYellow, Google Video
Gui,2: Add, CheckBox, x20 y265 vCh10 %cb10% cYellow, Youtube Video
Gui,2: Add, CheckBox, x20 y290 vCh11 %cb11% cYellow, Wikipedia
Gui,2: Add, CheckBox, x20 y310 vCh12 %cb12% cYellow, Charmap
Gui,2: Add, CheckBox, x20 y400 vCh98 gCheckAll cYellow, Select All
Gui,2: Add, CheckBox, x20 y425 vCh99 gUnCheckAll cYellow, De-Select All
Gui,2: Add, Button, x10 y465 w100 h26 gAA ,Start
GuiControl,2:Focus,search
return
;--------------------------
CheckAll:
Loop, %i%
GuiControl,2:, Ch%A_Index%, 1
GuiControl,2:, Ch99, 0
Return
;--------------------------
UnCheckAll:
Loop, %i%
GuiControl,2:, Ch%A_Index%, 0
GuiControl,2:, Ch98, 0
Return
;--------------------------
AA:
Gui,2: submit, nohide
StringReplace,Search, Search, %A_space%, +, All
search=`%22%search%`%22
if Ch1
run,https://www.google.fr/search?q=%search%
if Ch2
run,https://www.google.fr/search?btnI=I`%27m+Feeling+Lucky&q=%search%
if Ch3
run,https://www.bing.com/images/search?q=%search%&FORM=HDRSC2
if Ch4
run,https://www.flickr.com/search/?q=%search%
if Ch5
run,https://www.google.fr/search?q=%search%&tbm=isch
if Ch6
{
run,https://www.google.com/search?q=%search%#q=%search%&tbm=nws&hl=fr&gl=FR&ceid=FR:fr
;run,https://www.google.com/search?q=%search%#q=%search%&tbm=nws&hl=nl ;- nederlands
}
if Ch7
run,https://news.google.com/home?hl=fr&gl=FR&ceid=FR:fr
if Ch8
{
run,https://www.google.com/search?q=%search%#q=%search%&tbm=nws&hl=fr&gl=FR&ceid=FR:fr filetype:pdf
}
if Ch9
run,https://www.google.com/search?q=%search%&tbm=vid&hl=fr&gl=FR&ceid=FR:fr
if Ch10
run,https://www.youtube.fr/results?search_query=%search%
if Ch11
{
StringReplace,search,search,+,%A_space%, All
StringUpper,search,search,T
StringReplace,search,search,%A_space%,_, All
StringReplace,Search,Search,`%22, , All
run, https://en.wikipedia.org/wiki/%search%
}
if Ch12
run,charmap ;--- open xy program
return
;--------------------------
2GuiClose:
Gui,2: Submit
Loop,%i%
{
e= % ch%a_index%
IniWrite, %e%, %f1%, ss, Cb%a_index%
}
ExitApp
;===========================================================================
une example ... enregistrer les paramètres sélectionnés
[code]
;- Modified=20230813
;- Created =20140412
SplitPath,a_scriptname, name, dir, ext, name_no_ext, drive
F1=%a_scriptdir%\%name_no_ext%.ini
;-----------
I=12 ;- total checkboxes
src=Gloria Lasso ;- search for preselect
;-----------
Gui,2: Color,Black, Black
Gui,2: Font, CDefault s14, Lucida Console
Loop,%i%
{
IniRead, Ch%A_Index%, %f1%, ss, Cb%A_Index% , 0
If (Ch%A_Index% = 1)
Cb%A_Index% = Checked
Else
Cb%A_Index% =
}
Gui,2: Show, x100 y5 w350 h500, %name_no_ext%
Gui,2: Add, Edit, x20 y5 w315 h27 cWhite vSearch,%src%
Gui,2: Add, CheckBox, x20 y40 vCh1 %cb1% cYellow, Google
Gui,2: Add, CheckBox, x20 y65 vCh2 %cb2% cYellow, Google I``m feeling lucky
Gui,2: Add, CheckBox, x20 y90 vCh3 %cb3% cYellow, Bing Pictures
Gui,2: Add, CheckBox, x20 y115 vCh4 %cb4% cYellow, Flickr Pictures
Gui,2: Add, CheckBox, x20 y140 vCh5 %cb5% cYellow, Google Pictures
Gui,2: Add, CheckBox, x20 y165 vCh6 %cb6% cYellow, Google SEARCH fr
Gui,2: Add, CheckBox, x20 y190 vCh7 %cb7% cYellow, Google NEWS fr
Gui,2: Add, CheckBox, x20 y215 vCh8 %cb8% cYellow, Google PDF
Gui,2: Add, CheckBox, x20 y240 vCh9 %cb9% cYellow, Google Video
Gui,2: Add, CheckBox, x20 y265 vCh10 %cb10% cYellow, Youtube Video
Gui,2: Add, CheckBox, x20 y290 vCh11 %cb11% cYellow, Wikipedia
Gui,2: Add, CheckBox, x20 y310 vCh12 %cb12% cYellow, Charmap
Gui,2: Add, CheckBox, x20 y400 vCh98 gCheckAll cYellow, Select All
Gui,2: Add, CheckBox, x20 y425 vCh99 gUnCheckAll cYellow, De-Select All
Gui,2: Add, Button, x10 y465 w100 h26 gAA ,Start
GuiControl,2:Focus,search
return
;--------------------------
CheckAll:
Loop, %i%
GuiControl,2:, Ch%A_Index%, 1
GuiControl,2:, Ch99, 0
Return
;--------------------------
UnCheckAll:
Loop, %i%
GuiControl,2:, Ch%A_Index%, 0
GuiControl,2:, Ch98, 0
Return
;--------------------------
AA:
Gui,2: submit, nohide
StringReplace,Search, Search, %A_space%, +, All
search=`%22%search%`%22
if Ch1
run,https://www.google.fr/search?q=%search%
if Ch2
run,https://www.google.fr/search?btnI=I`%27m+Feeling+Lucky&q=%search%
if Ch3
run,https://www.bing.com/images/search?q=%search%&FORM=HDRSC2
if Ch4
run,https://www.flickr.com/search/?q=%search%
if Ch5
run,https://www.google.fr/search?q=%search%&tbm=isch
if Ch6
{
run,https://www.google.com/search?q=%search%#q=%search%&tbm=nws&hl=fr&gl=FR&ceid=FR:fr
;run,https://www.google.com/search?q=%search%#q=%search%&tbm=nws&hl=nl ;- nederlands
}
if Ch7
run,https://news.google.com/home?hl=fr&gl=FR&ceid=FR:fr
if Ch8
{
run,https://www.google.com/search?q=%search%#q=%search%&tbm=nws&hl=fr&gl=FR&ceid=FR:fr filetype:pdf
}
if Ch9
run,https://www.google.com/search?q=%search%&tbm=vid&hl=fr&gl=FR&ceid=FR:fr
if Ch10
run,https://www.youtube.fr/results?search_query=%search%
if Ch11
{
StringReplace,search,search,+,%A_space%, All
StringUpper,search,search,T
StringReplace,search,search,%A_space%,_, All
StringReplace,Search,Search,`%22, , All
run, https://en.wikipedia.org/wiki/%search%
}
if Ch12
run,charmap ;--- open xy program
return
;--------------------------
2GuiClose:
Gui,2: Submit
Loop,%i%
{
e= % ch%a_index%
IniWrite, %e%, %f1%, ss, Cb%a_index%
}
ExitApp
;===========================================================================
[/code]