Jump to content
nooneclose

[SOLVED] Can't click on my inputs?

Recommended Posts

Posted (edited)

Why can I not click on either of my input fields?

#Region ### START Koda GUI section ### Form=
    Global $Form1 = GUICreate("Form1", 730, 437, 192, 124)
    ;GUISetFont(14, 800, 0, "MS Sans Serif")
    GUISetBkColor(0xC0DCC0)
    Global $Label1 = GUICtrlCreateLabel("Enter your Password. UserName is auto filled", 62, 40, 604, 41, $SS_CENTER)
    GUICtrlSetFont(-1, 26, 800, 0, "MS Sans Serif")

    Global $Label2 = GUICtrlCreateLabel("User Name:", 120, 130, 604, 31, $SS_LEFT)
    GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
    Global $Label3 = GUICtrlCreateLabel("Password:", 135, 210, 604, 31, $SS_LEFT)
    GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")

    Global $Input1 = GUICtrlCreateInput(@UserName, 274, 130, 185, 32)
    GUICtrlSetFont(-1, 14, 800, 1, "MS Sans Serif")
    Global $Input2 = GUICtrlCreateInput("Password", 274, 210, 185, 32, $ES_PASSWORD)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    
    Global $OK     = GUICtrlCreateButton("OK", 274, 270, 185, 57)
    GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
    
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit

            Case $OK
                Global $UserName = GUICtrlRead($Input1)
                Global $PassWord = GUICtrlRead($Input2)
                ExitLoop
        EndSwitch
    WEnd

    ; Delete the GUI window
    GUIDelete()

 

Edited by nooneclose

Share this post


Link to post
Share on other sites
Posted (edited)
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>

Global $UserName = @UserName, $PassWord = "Password"

; Scaling :
Global $g_fDPIBase     = 0.96, $g_fDPI = 1 ; scale factor
Global $g_iAppliedDPI = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics", "AppliedDPI")
If Not @error Then
    $g_fDPIBase = $g_iAppliedDPI/100
    $g_fDPI     = Round($g_fDPIBase/$g_iAppliedDPI*100, 2)
EndIf

#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 730, 437, 192, 124)
;GUISetFont(14 * $g_fDPI, 800, 0, "MS Sans Serif")
GUISetBkColor(0xC0DCC0)
Global $Label1 = GUICtrlCreateLabel("Enter your Password. UserName is auto filled", 62, 40, 604, 41, $SS_CENTER)
GUICtrlSetFont(-1, 16 * $g_fDPI, 800, 0, "MS Sans Serif")

Global $Label2 = GUICtrlCreateLabel("Username:", 120, 130, 170, 31, $SS_LEFT)
GUICtrlSetFont(-1, 20 * $g_fDPI, 800, 0, "MS Sans Serif")
Global $Label3 = GUICtrlCreateLabel("Password:", 120, 210, 170, 31, $SS_LEFT)
GUICtrlSetFont(-1, 20 * $g_fDPI, 800, 0, "MS Sans Serif")

Global $Input1 = GUICtrlCreateInput($UserName, 300, 130, 185, 32)
GUICtrlSetFont(-1, 14 * $g_fDPI, 800, 1, "MS Sans Serif")
Global $Input2 = GUICtrlCreateInput($PassWord, 300, 210, 185, 32, $ES_PASSWORD)
GUICtrlSetFont(-1, 14 * $g_fDPI, 800, 0, "MS Sans Serif")

Global $OK = GUICtrlCreateButton("OK", 274, 270, 185, 57)
GUICtrlSetFont(-1, 20 * $g_fDPI, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While True
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $OK
            $UserName = GUICtrlRead($Input1)
            $PassWord = GUICtrlRead($Input2)
            MsgBox(0, "Values", "Username = " & $UserName & @CRLF & "Password = " & $PassWord)
            ExitLoop

    EndSwitch
WEnd

; Delete the GUI window
GUIDelete()

 

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By learner123
      Hi All,
       
      I am new to this AUTO IT and I have created a script that will open an app,enter pin and copy the code generated to clipboard. My java code call this autoIT script and use the copied generated code from clipboard.
      This works fine when server  window is on focus. My server is an windows server. 
      But when I minimize or disconnect the server, the script opens the app.exe but doesn't copy any value to clipboard.  
      Can anyone help me on this 😐
       
      Run("C:\Program Files (x86)\RSA SecurID Software Token\SecurID.exe")
      Local $hWnd=WinWait("abc - RSA SecurID Token") ; waits until the window is the active window
      $hWin = WinGetHandle("abc - RSA SecurID Token");
      ControlSend($hWnd,"","","1111") ; simulates pressing the Home key
      ControlSend($hWnd,"","","{ENTER}");
      ControlSend($hWnd,"","","^c");
      Sleep(1000) ;
      ControlSend($hWnd,"","","^c");
       
    • By TXTechie
      Hello Everyone,
      I've developed my own GUI using AutoIt and I'm allowing users to minimize the GUI, but I also want to include some kind of timer so that it will automatically restore the GUI after something like 30 minutes or an hour. However, I also want them to be able to manually restore the GUI by clicking the application's icon in the taskbar.
      I've searched through the forums, but I'm not sure how to get started.
      Any ideas or functions to research are appreciated!
      Regards,
      TX Techie
    • By learner123
      Hi All,
      So I have created a small autoIT script to enter pin into a RSA token(app which generate new code every 30 second), and copy the generated code.
      I have a java application which requires this code so every time my java-code requires this RSA code, it runs the autoIT script and the copied generated code is then used in my java application. 
      I have deployed this code on a windows server and it works fine when I am logged in and the window is on focus, But as soon as I schedule task and disconnect the server (not logged out only disconnect), or even minimize the server window, the autoIT scripts fails and its not able to copy the value.
       
      Please find below the code for AUTOIT.
       
      WinActivate("rsa - RSA SecurID Token") ; activates the window that has old in the tilte bar
      WinWaitActive("rsa - RSA SecurID Token") ; waits until the window is the active window
      Send("1111") ; simulates pressing the Home key, enters password to get the code
      Send("{ENTER}") ; simulates pressing the Enter key
      Sleep(1000) ;
      Send("^c") ; simulates pressing the CTRL+c keys (copy)
       
      Also I saw some post regarding that WINACTIVE only works when window is active. But my below AUTO IT script to handle windows pop up  works perfectly fine when the server is disconnected. 
       
      Opt("WinTitleMatchMode", 1)
      WinWait("https://url","","10")
      WinWaitActive("https://url","","10")
      Sleep(2000)
      Send("userid")
      Sleep(1000)
      Send("{TAB}")
      Sleep(1000)
      Send("passwrd")
      Send("{TAB}")
      Sleep(500)
      Send("{ENTER}")
       
       
    • By JuanFelipe
      Hello gyus, I try to make a code to login in a web page in my job, buy i can’t understand why my form is blocked, this is my code: 
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <StringConstants.au3> #include <WindowsConstants.au3> #include <WinAPIFiles.au3> #include <FileConstants.au3> #include <File.au3> #include <Array.au3> #include <IE.au3> #include <Excel.au3> #include <GuiEdit.au3> #include <GuiStatusBar.au3> #include <DateTimeConstants.au3> #include <Date.au3> #Region ### START Koda GUI section ### Form=C:\noentry\koda_1.7.3.0\Forms\spoa.kxf $Form1 = GUICreate("Eva y Vehículos", 1200, 1000, 10, 10) $prueba = GUICtrlCreateButton("Prueba",10,990,50,20) ;VARIABLES ========================================================================================== $psi = "https://psi.policia.gov.co/PSI/Login.aspx?ReturnUrl=%2fPSI#no-back-button" $chequeVehiculos = "https://psi.policia.gov.co/PSI/frm_lista_chk.aspx" $evaluacionEva = "https://psi.policia.gov.co/PSI/eva_frmver.aspx" $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj ($oIE, 10, 10, 1180, 980) ;GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) $oIE.navigate($psi) ;_IELoadWait($oIE) _InicioSesion() #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $prueba _InicioSesion() EndSwitch WEnd Func _InicioSesion() Local $username = _IEGetObjByName($oIE, "txtUsuario") Local $pass = _IEGetObjByName($oIE, "txtClave") Local $logina = _IEGetObjByName($oIE, "btnIngresar") $username.value="example" $pass.value="examplepass" _IEAction($logina, 'click') _IELoadWait($oIE) MsgBox(16,"","") EndFunc  
×
×
  • Create New...