Jump to content
Sign in to follow this  
AramisResearch

RegWrite a $variable?

Recommended Posts

AramisResearch

Forgive me, but I am learning AutoIT, so maybe I just missed something obvious here. Here is my code:

GuiCreate("Citrix Server System Setup GUI",500, 700)

$ServerName = GuiCtrlCreateLabel("Server Name", 5, 5, 150, 18)

$Input_ServerName = GuiCtrlCreateInput("", 75, 5, 100, 18)

$DomainName = GuiCtrlCreateLabel("Domain Name", 5, 35, 150, 18)

$Input_DomainName = GuiCtrlCreateInput("", 75, 35, 100, 18)

...More Stuff...

$SubmitButton = GUICtrlCreateButton ("Submit", 25, 660, 70,20)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $SubmitButton

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCS", "Servername", "REG_SZ", $Input_ServerName)

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CCS", "Domain", "REG_SZ", $Input_DomainName)

ExitLoop

Case Else

;;;

EndSelect

WEnd

What I THOUGHT I was doing was dumping whatever the user typed into the input field defined in the first few lines and writing them to the registry when they clicked on SUBMIT. Indeed, the keys are written, the valuename is written, but no matter what I type in those fields what I actually see written for a value is a number (so when I type "TESTSERVER" in that first field I get "6" in HKLM\Software\CCS\ServerName). Very bizarre.

I will also post a question in the GUI support forum that is related - I need to make nice little radio buttons, let the user click on the value in each group, and dump the value to the same set of reg keys.

Thanks,

-Chris

Edited by AramisResearch

Share this post


Link to post
Share on other sites
NELyon

Do GUICtrlRead($variable) instead of just the variable

Share this post


Link to post
Share on other sites
Briegel

You create a new control

$Input_ServerName = GuiCtrlCreateInput("", 75, 5, 100, 18)oÝ÷ Ù©Ýëmèz{b~'«rí®HíéÞÁÊ'¶º%|¨º»Ú®&äèëm触ën±íýB¶¹Qy§¢{k¢RiÛÚÇßÑڽ楢¶¥¥ø¥y&¦¦WºÚ"µÍÌÍÒ[]ÔÙ[YHHÝZPÝÜX]R[]
    ][ÝÉ][ÝË
ÍK
KLN
BÌÍÚ[]HÕRPÝXY
    ÌÍÒ[]ÔÙ[YH

Share this post


Link to post
Share on other sites
AramisResearch

Do GUICtrlRead($variable) instead of just the variable

Thank you!

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.