Code:
Num = %Numv%
trying to set Num (the checkbox) to Numv (thevalue from the ini file)
cosider the follwing if statement
Code:
if Num = 1
{
<some iniwrite code>
}
which does work
since:
checked = 1
unchecked = 0
meaning that there must be a way to check a checkbox by assigning a 1 to it
found the solution, tx for your help, using Guicontrol, now it works like a charm

working code [full]
Code:
/* code for the config utility which will be used by the password generator
By: Frosty
*/
#singleinstance force
IniRead, Numv, settings.ini, settings, numbers
IniRead, Smlv, settings.ini, settings, sletters
IniRead, Cplv, settings.ini, settings, cletters
Gui, Add, CheckBox, vNum x6 y7 w100 h30 , Numbers
Gui, Add, CheckBox, vSml x6 y57 w100 h30 , Small Letters
Gui, Add, CheckBox, vCpl x6 y107 w100 h30 , Capital letters
Gui, Add, Text, x126 y7 w130 h90 , Welcome to the Password Generator Utility, use the checkboxes on the left to configure what you want in your passwords, then click ok to save the changes
Gui, Add, Button,vSave gOk x126 y107 w60 h30 , Ok
Gui, Add, Button,gCancel x196 y107 w60 h30 , Cancel
Gui, Show, x131 y91 h147 w267, PGCU
if Numv = 1
{
GuiControl, , Button1,1
}
if Smlv = 1
{
GuiControl, , Button2,1
}
if Cplv = 1
{
GuiControl, , Button3,1
}
return
Cancel:
ExitApp
Ok:
{
gui,submit
if Num = 0
{
if Sml = 0
{
if Cpl = 0
{
MsgBox,0,Warning, Config has detected that all checkboxes are unchecked, this means that the password generator will not work with the selected configuration! Please check your configuration before attempting to save again. Now returning you to the config utility
IniRead, Numv, settings.ini, settings, numbers
IniRead, Smlv, settings.ini, settings, sletters
IniRead, Cplv, settings.ini, settings, cletters
Gui, Show, x131 y91 h147 w267, PGCU
if Numv = 1
{
GuiControl, , Button1,1
}
if Smlv = 1
{
GuiControl, , Button2,1
}
if Cplv = 1
{
GuiControl, , Button3,1
}
return
}
}
}
Num:
if Num = 1
{
iniwrite,1,settings.ini,settings,numbers
}
else if Num = 0
{
iniwrite,0,settings.ini,settings,numbers
}
Sml:
if Sml = 1
{
iniwrite,1,settings.ini,settings,sletters
}
else if Sml = 0
{
iniwrite,0,settings.ini,settings,sletters
}
Cpl:
If Cpl = 1
{
iniwrite,1,settings.ini,settings,cletters
}
Else if Cpl = 0
{
iniwrite,0,settings.ini,settings,cletters
}
ExitApp
}
any questions with this code let me know, and ill tell you what it does
no more problems here, just maybe some feedback/improvements
tx again