Jump to content

GuiCtrlCreateLabel problem


Didonet
 Share

Recommended Posts

This is a part from my script. When i click OK button i get messages like 4107, 4105...

Where is the problem!?

Func encrypt($do, $text)
    Return _StringEncrypt ( $do, $text, "1ida2xfybwnxkdt3", 1 )
EndFunc


Func login_settings()
        Global $reg_user
        Global $reg_pass
        Global $username
        Global $password
        Global $login_subbmit
        
    If $reg_user = "" OR $reg_pass = "" Then
        GuiCreate("Настройки за логин", 200, 175)
        GuiCtrlCreateLabel("some text", 5, 5, 200, 100) 
        GuiCtrlCreateLabel("user", 15, 100)
        GuiCtrlCreateLabel("pass", 15, 122)
        $username_form = GUICtrlCreateInput("", 80, 98, 100, 18)
        GUICtrlSetState(-1,$GUI_FOCUS)
        $password_form = GUICtrlCreateInput("", 80, 120, 100, 18, 0x0020)
        $login_subbmit = GuiCtrlCreateButton("OK", 70, 150, 60, 20)
        
        GuiSetState()
        While 1
        $msg = GUIGetMsg()
            Select
            Case $msg = $login_subbmit
                msgBox(0x0 , '', $InputPass)
                msgbox(0, '', $username_form)
                msgbox(0, '', $password_form)
                msgbox(0, '', encrypt(1, $username_form))
        ;       RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "uname", "REG_SZ", encrypt(1, $username))
        ;       RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "passwd", "REG_SZ", encrypt(1, $password))
                $reg_user = $username
                $reg_pass = $password
                ;GuiDelete()
                ExitLoop
            Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
            EndSelect
        WEnd
        GuiDelete()
        ;MsgBox(0, "", "No user or pass set!")
    EndIf
EndFunc
Link to comment
Share on other sites

when you want to read values from gui controls you have to use GuiCtrlRead() so i guess:

(i maybe missing something)

Func encrypt($do, $text)
    Return _StringEncrypt ( $do, $text, "1ida2xfybwnxkdt3", 1 )
EndFunc
Func login_settings()
        Global $reg_user
        Global $reg_pass
        Global $username
        Global $password
        Global $login_subbmit
        
    If $reg_user = "" OR $reg_pass = "" Then
        GuiCreate("Настройки за логин", 200, 175)
        GuiCtrlCreateLabel("some text", 5, 5, 200, 100) 
        GuiCtrlCreateLabel("user", 15, 100)
        GuiCtrlCreateLabel("pass", 15, 122)
        $username_form = GUICtrlCreateInput("", 80, 98, 100, 18)
        GUICtrlSetState(-1,$GUI_FOCUS)
        $password_form = GUICtrlCreateInput("", 80, 120, 100, 18, 0x0020)
        $login_subbmit = GuiCtrlCreateButton("OK", 70, 150, 60, 20)
        
        GuiSetState()
        While 1
        $msg = GUIGetMsg()
            Select
            Case $msg = $login_subbmit
                msgBox(0x0 , '', GuiCtrlRead($InputPass))
                msgbox(0, '', GuiCtrlRead($username_form))
                msgbox(0, '', GuiCtrlRead($password_form))
                msgbox(0, '', encrypt(1, $username_form))
    ;       RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "uname", "REG_SZ", encrypt(1, $username))
    ;       RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "passwd", "REG_SZ", encrypt(1, $password))
                $reg_user = $username
                $reg_pass = $password
            ;GuiDelete()
                ExitLoop
            Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
            EndSelect
        WEnd
        GuiDelete()
    ;MsgBox(0, "", "No user or pass set!")
    EndIf
EndFunc
Link to comment
Share on other sites

This is a part from my script. When i click OK button i get messages like 4107, 4105...

Where is the problem!?

CODE: AutoIt

Cool, looks like we're making some progress with reading the Help file and your code is starting to look more like the examples in the Help file. :) If you're not using SciTE4AutoIt3 then you need to download it and use that for your au3 scripts.

Thanks for the code, but only giving us the 2 functions without the rest of the code is a little useless. In its current state we can't tell if you're using the correct #includes or if you've correctly declared your variables. If this is all of your code, then I've just given you a clue with what's wrong with your script :).

Link to comment
Share on other sites

Cool, looks like we're making some progress with reading the Help file and your code is starting to look more like the examples in the Help file. :) If you're not using SciTE4AutoIt3 then you need to download it and use that for your au3 scripts.

Thanks for the code, but only giving us the 2 functions without the rest of the code is a little useless. In its current state we can't tell if you're using the correct #includes or if you've correctly declared your variables. If this is all of your code, then I've just given you a clue with what's wrong with your script :P.

I have tested everything and i just know where is the problem, but i can't find it, thats the reason i give u only 2 functions.

@Gif, Tnx! :)

Edited by Didonet
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...