here is a simple example with 3 different inputs, 1, 2 and 3.
and what i'm trying to do is, save last entered values in *.ini file, so when opening the programme next time, it load and show the last entered values.
please help.
Code: Select all
SetWorkingDir %A_ScriptDir%
iniFile = Temp.ini
Gui, Add, Text, x12 y9 w360 h40, > AutoHotKey Forum < try to save the tree values, and show the after app`nreload.
Gui, Add, GroupBox, x22 y49 w350 h80, Inputs
Gui, Add, Edit, x32 y69 w100 h20 Number,
Gui, Add, Text, x32 y99 w100 h20 vInput1, Input 1
Gui, Add, Edit, x152 y69 w100 h20 Number vInput2,
Gui, Add, Text, x152 y99 w100 h20, Input 2
Gui, Add, DropDownList, x262 y69 w100 h60 vInput3 Choose2, Yes|No
Gui, Add, Text, x262 y99 w100 h20, Input 3
Gui, Add, Button, x250 y129 w100 h20 gReload, Reload
Gui, Add, Button, x32 y129 w100 h20 gSave, Save
Gui +AlwaysOnTop
Gui, Show, xCenter yCenter, Save Value
Return
GuiClose:
{
ExitApp
}
return
Reload:
{
Reload
}
return
Save:
{
GuiControlGet, Input1
GuiControlGet, Input2
GuiControlGet, Input3
IniWrite, %Input1%, %iniFile%, Section, Key
IniWrite, %Input2%, %iniFile%, Section, Key
IniWrite, %Input3%, %iniFile%, Section, Key
IniRead, ReadReporting, %iniFile%, Section, Key
IniRead, ReadXmax, %iniFile%, Xmax, Section, Key
IniRead, ReadXmin, %iniFile%, Xmin, Section, Key
GuiControl, Text, ControlID , Value
GuiControl, Text, ControlID , Value
GuiControl, Text, ControlID , Value
}