Jump to content
Sign in to follow this  
Cybertek

retrieving data from a GUICtrlCreateInput

Recommended Posts

Cybertek

Hello all,

I am fairly new to autoit and I need some help

I have created a gui to enter some info like employee id and I am having a problem understanding how to put this info into an .ini file to be read by another portion of a script. here is what I have so far and nothing seems to send the info from the input screen to the ini file

$sIni = @DesktopDir & "\Notes Setup.ini"

Dim $aData2[3][2] = [ [ "EmployeeID", "" ], [ "Server", "" ], [ "Password", "" ] ]

IniWriteSection($sIni, "Notes Variables", $aData2, 0)

#include <GUIConstantsEx.au3>

#include <EditConstants.au3>

Opt('MustDeclareVars', 0)

Example()

Func Example()

Local $file1, $file2, $file3, $btn, $msg

GUICreate("Notes Setup.ini", 300, 185)

GUICtrlCreateLabel("Employee ID", 10, 20)

$file1 = GUICtrlCreateInput("", 10, 35, 150, 20)

;GUICtrlRead($file1, 1) some tests

;IniWrite("C:\users\*******\desktop\Notes Setup.ini", "Notes Variables", "EmployeeID") some tests

GUICtrlCreateLabel("Domino Server", 10, 60)

$file = GUICtrlCreateInput("", 10, 75, 150, 20)

GUICtrlCreateLabel("Password", 10, 100)

$file = GUICtrlCreateInput("", 10, 115, 150, 20, $ES_PASSWORD, 0x0020)

$btn = GUICtrlCreateButton("OK", 125, 150, 60)

GUISetState()

$msg = 0

While $msg <> $GUI_EVENT_CLOSE

$msg = GUIGetMsg()

Select

Case $msg = $btn

ExitLoop

EndSelect

WEnd

MsgBox(4096, "Notes Setup", "Starting Notes Setup")

EndFunc

Can someone help me out with this I am a little stumped

Thanks,

Cybertek

Share this post


Link to post
Share on other sites
Andreik

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>

Opt('MustDeclareVars', 0)

Example()

Func Example()

Local $file1, $file2, $file3, $btn, $msg
$sIni = @DesktopDir & "\Notes Setup.ini"

GUICreate("Notes Setup.ini", 300, 185)
GUICtrlCreateLabel("Employee ID", 10, 20)
$file1 = GUICtrlCreateInput("", 10, 35, 150, 20)
;GUICtrlRead($file1, 1) some tests
;IniWrite("C:\users\*******\desktop\Notes Setup.ini", "Notes Variables", "EmployeeID") some tests
GUICtrlCreateLabel("Domino Server", 10, 60)
$file2 = GUICtrlCreateInput("", 10, 75, 150, 20)
GUICtrlCreateLabel("Password", 10, 100)
$file3 = GUICtrlCreateInput("", 10, 115, 150, 20, $ES_PASSWORD, 0x0020)
$btn = GUICtrlCreateButton("OK", 125, 150, 60)

GUISetState()
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
Case $msg = $btn
IniWrite($sIni,"Notes Variable","Employee ID",GUICtrlRead($file1))
IniWrite($sIni,"Notes Variable","Domino Server",GUICtrlRead($file2))
IniWrite($sIni,"Notes Variable","Password",GUICtrlRead($file3))
ExitLoop
EndSelect
WEnd

MsgBox(4096, "Notes Setup", "Starting Notes Setup")
EndFunc

Edited by Andreik

When the words fail... music speaks

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.