i like to understand how saving the last used settings of my gui works, most in the help is to overwhelming to me and i so not know where to begin to tackle this
this is part of a bigger project i am trying to figure out, to keep it simple i made a simple gui with just 2 things that need to be saved
1 you can click in the left box and set a new hotkey that you then store by clicking the copy button, the user can make it any key or combination
2 you can also choose to turn the hotkey off in case the user does not want that hotkey
these 2 things i like to save so that on next launch it is set like that, this would allow me to write hotkey tools for programs i use that are tweak able
any help would be appreciated
Code: Select all
#SingleInstance, force
Copy_Hotkey :="NumpadDiv"
hotkey, %Copy_Hotkey% , Copy
Gui,1: +Alwaysontop
Gui,1: Color, Black
Gui,1: Font, cBlack s12
Gui,1: Add, Text, x5 y10 w193 h30 center cWhite, Current Key
Gui,1: Add, Text, x200 y10 w150 h30 center cWhite, Update / HotKey
Gui,1: Add, Text, x+10 w50 h30 center cWhite, On/Off
Gui,1: Add,Hotkey, x10 y40 vCopy_Hotkey, %Copy_Hotkey%
Gui,1:Add,Button, x+10 w150 h28 vUpdate_Copy_Button gUpdate_Copy_Button ,Copy
Gui,1:Add,Checkbox, cWhite x+30 w30 h29 vLock1 gUnlockCopy,
Gui,1:Show, w427 h75, Save Test
Gui,1:Submit,NoHide
return
GuiClose:
ExitApp
return
UnlockCopy:
Lock1:=!Lock1
if(Lock1=1)
{
GuiControl,1:Disable,Copy_Hotkey
Hotkey, %Copy_Hotkey%, Copy, Off
GuiControl,1:Disable,Update_Copy_Button
}
if(Lock1=0)
{
GuiControl,1:Enable,Copy_Hotkey
hotkey, %Copy_Hotkey% , Copy, on
GuiControl,1:Enable,Update_Copy_Button
}
return
Update_Copy_Button:
GuiControlGet, New_Key , 1:, Copy_Hotkey
If(New_Key !=Copy_Hotkey)
{
hotkey, %Copy_Hotkey% , Copy, off
Copy_Hotkey := New_Key
hotkey, %Copy_Hotkey% , Copy, on
}
return
Copy:
tooltip, hey i work
return