A little problem..

02/12/2010 22:17 AngelOfYourNight#1
I have a form with a typical "login form"

what i want to know is when a check box is checked i want it to remember what is in the user-name and password box's..

Here is the needed info:
Code:
$Username = GUICtrlCreateLabel("Username:", 16, 24, 55, 17)
$Password = GUICtrlCreateLabel("Password:", 16, 56, 55, 17)
$Remember = GUICtrlCreateLabel("Remember", 96, 80, 79, 17)
02/13/2010 12:32 | Moep |#2
write an ini with the login data.
02/13/2010 13:50 AngelOfYourNight#3
Quote:
Originally Posted by | Moep | View Post
write an ini with the login data.
Care to elaborate that?
02/13/2010 16:39 | Moep |#4
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
02/13/2010 16:57 Pwneres#5
this is also important
Code:
#include<GuiConstants.au3>

$checkbox = GUICtrlCreateCheckbox("")

if $checkbox =  $GUI_CHECKED Then

EndIf
02/13/2010 21:37 AngelOfYourNight#6
Quote:
Originally Posted by | Moep | View Post
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Thanks, i have read both and now have what i think is a code that should work... however it doesn't seem to work :/
Quote:
Originally Posted by Pwneres View Post
this is also important
Code:
#include<GuiConstants.au3>

$checkbox = GUICtrlCreateCheckbox("")

if $checkbox =  $GUI_CHECKED Then

EndIf
Thankyou, i was missing the "if $checkbox = $GUI_CHECKED Then" i had something similar however neither seem to be working, when I enter a test username and password nothing is written to my "settings.ini"..
Code:
if $Remember =  $GUI_CHECKED Then
IniWrite ( "Settings.ini", "Data", "key", $username )
IniWrite ( "Settings.ini", "Data", "key", $password )
EndIf
Is this right or not?
02/13/2010 23:23 kknb#7
do you mean like this?
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 201, 120, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("iniwrite", 8, 8, 57, 17)
$Label1 = GUICtrlCreateLabel("Name:", 8, 32, 35, 17)
$Input1 = GUICtrlCreateInput("", 72, 32, 121, 21)
$Label2 = GUICtrlCreateLabel("Password:", 8, 64, 53, 17)
$Input2 = GUICtrlCreateInput("", 72, 64, 121, 21)
$start = GUICtrlCreateButton("start", 72, 96, 121, 21)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $start
			start()
	EndSwitch
WEnd

Func start()
	If GUICtrlRead($Checkbox1) = $gui_checked Then
		IniWrite("Settings.ini", "Data", "name", GUICtrlRead($Input1))
		IniWrite("Settings.ini", "Data", "password", GUICtrlRead($Input2))
		TrayTip("saved", "settings saved", 10, 1)
	Else
		TrayTip("not saved", "settings not saved", 10, 2)
	EndIf
EndFunc