Jump to content

ini files


eckyecky
 Share

Recommended Posts

nevermind solved mods please delete this

can someone help me with this

$cb* is a checkbox and $tb* is an input

Func OnAutoItExit ()
    
$enableglobaluser = GUICtrlRead($cbEnableglobaluser)
$enableglobalpass = GUICtrlRead($cbEnableglobalpass)
$globaluser = GUICtrlRead($tbGlobaluser)
$globalpass = _StringEncrypt(1,GUICtrlRead($tbGlobalPass),$encryptionpass)
$enableadvercash = GUICtrlRead($cbAdvercashenabled)
$advercashuser = GUICtrlRead($tbadvercashuser)
$advercashpass = _StringEncrypt(1,GUICtrlRead($tbadvercashpass),$encryptionpass)
    
    
iniwrite($inifile,"Default","EnableGlobaluser",$enableglobaluser)
iniwrite($inifile,"Default","EnableGlobalpass",$enableglobalpass)
iniwrite($inifile,"Default","Globaluser",$globaluser)
iniwrite($inifile,"Default","Globalpass",$enableadvercash)
Iniwrite($inifile, "Default", "EnableAdvercash", $enableadvercash) 
IniWrite($inifile, "Default", "Advercashuser", $advercashuser)
IniWrite($inifile, "Default", "advercashpass", $advercashpass)
EndFunc;==>OnAutoItExit

when they all have useful stuff in the variables i get the following ini

[Default]
EnableGlobaluser=0
EnableGlobalpass=0
Globaluser=0
Globalpass=0
EnableAdvercash=0
Advercashuser=0
advercashpass=
Edited by eckyecky
Link to comment
Share on other sites

Hi eckyecky,

I'm not sure what you expected for the output data, but if you want to

have the checkbox state you need to use this piece of code:

CODE
BitAnd(GUICtrlRead($Item),$GUI_CHECKED)

It will return 0 "zero" for Not Checked and it will return 1 "one" for Checked.

Also I assume that the vars used to read the guicontrols are the handles to those controls.

If not you need to use handles to them.

Something like...

CODE
#include <GUIConstants.au3>

GUICreate("My GUI Checkbox") ; will create a dialog box or 'form' that when displayed is centered

$checkCN = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20) ;create a checkbox on the GUI created above

;^-----------------is the handle of that checkbox

$BtnCheck=GUICtrlCreateButton("Check State",10,50,120,20) ;create a button

;^-----------------is the handle of that button

GUISetState () ; will display an dialog box with 1 checkbox and one button

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $BtnCheck

MsgBox(0,"CheckBox State","The state is now " & BitAnd(GUICtrlRead($checkCN),$GUI_CHECKED) )

EndSelect

Wend

Edited by Scriptonize

If you learn from It, it's not a mistake

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...