Jump to content

Help here with input boxs (noob)


Recommended Posts

ok here is my script well this will be part of a larger part when it is done testing. But we offer contracts for unlimited support for one year. we are trying ot put a tag in that we can only read because the gui will be password protected. I am trying to find out how to use a gui input box and read the date entered and put it in our reg key this is what i have but it will not put the date in.

#Region ### START Koda GUI section ### Form=C:\Autoit files\Forms\User information.kxf

$Form1 = GUICreate("Form1", 633, 447, 193, 125)

$Group1 = GUICtrlCreateGroup("User account information", 72, 32, 369, 161)

$Input1 = GUICtrlCreateInput("Joined On", 160, 48, 177, 21)

$Button1 = GUICtrlCreateButton("Write Information", 192, 72, 99, 25, 0)

$Button2 = GUICtrlCreateButton("Read information", 192, 104, 99, 25, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

;Write unlimited info

Select

Case $nMsg = $GUI_EVENT_CLOSE

Case $nMsg = $Button1

$var = $Input1

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Tune-up pros\", "Unlimited computer", "REG_SZ", "Unlimited member")

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Tune-up pros\", "Date", "REG_SZ", $var)

EndSelect

Edited by RyanOlson
Link to comment
Share on other sites

ok here is my script well this will be part of a larger part when it is done testing. But we offer contracts for unlimited support for one year. we are trying ot put a tag in that we can only read because the gui will be password protected. I am trying to find out how to use a gui input box and read the date entered and put it in our reg key this is what i have but it will not put the date in.

#Region ### START Koda GUI section ### Form=C:\Autoit files\Forms\User information.kxf

$Form1 = GUICreate("Form1", 633, 447, 193, 125)

$Group1 = GUICtrlCreateGroup("User account information", 72, 32, 369, 161)

$Input1 = GUICtrlCreateInput("Joined On", 160, 48, 177, 21)

$Button1 = GUICtrlCreateButton("Write Information", 192, 72, 99, 25, 0)

$Button2 = GUICtrlCreateButton("Read information", 192, 104, 99, 25, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

;Write unlimited info

Select

Case $nMsg = $GUI_EVENT_CLOSE

Case $nMsg = $Button1

$var = $Input1

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Tune-up pros\", "Unlimited computer", "REG_SZ", "Unlimited member")

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Tune-up pros\", "Date", "REG_SZ", $var)

EndSelect

Maybe this

;#include <windowsconstants.au3>
;#include <GUIConstantsEx.au3>

#Region ### START Koda GUI section ### Form=C:\Autoit files\Forms\User information.kxf
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$Group1 = GUICtrlCreateGroup("User account information", 72, 32, 369, 161)
$Input1 = GUICtrlCreateInput("Joined On", 160, 48, 177, 21)
$Button1 = GUICtrlCreateButton("Write Information", 192, 72, 99, 25, 0)
$Button2 = GUICtrlCreateButton("Read information", 192, 104, 99, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $var = GUICtrlRead($Input1)
        ;Write unlimited info
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Tune-up pros\", "Unlimited computer", "REG_SZ", "Unlimited member")
            RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Tune-up pros\", "Date", "REG_SZ", $var)
        ;Exit
    EndSwitch
WEnd
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...