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 Rskm
      Hi, recently i created a GUI for some calculations in AutoIT.  The GUI has 2 tabs and on the first tab, it has few inputboxes where i use to click with mouse and start entering the inputs. i recently made some changes in the position of these textboxes. I made this by changing the autoit code file instead of making changes in KODA. Now i cannot click inside these textboxes with mouse. However, i can use TAB key to cycle through/enter input in these input boxes. what could have made the inputboxes not responding to mouseclicks. thanks
    • By TheDcoder
      Hi everyone,
      I am bit stumped as to why I am not able to set the time in the Date control
      #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("My GUI get date", 200, 200, 800, 200) Local $idDate = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20, $DTS_TIMEFORMAT) ; to select a specific default format Local $sStyle = "HH:mm:ss" GUICtrlSendMsg($idDate, $DTM_SETFORMATW, 0, $sStyle) ; Set time Local $iRet = GUICtrlSetData($idDate, '13:33:37') ConsoleWrite('GUICtrlSetData returned ' & ($iRet = 1 ? 'success' : 'failure') & @CRLF) GUISetState(@SW_SHOW) ; Loop until the user exits. While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox($MB_SYSTEMMODAL, "Time", GUICtrlRead($idDate)) EndFunc ;==>Example The documentation for GUICtrlSetData clearly mentions that it uses the same format as GUICtrlRead:
      But I get failure
      What gives?
      Thanks for the help in advance!
    • By malicioussoap
      back when I was still doing autohotkey you could write (in code) spanisha::á
      and whenever you were in google docs or notepad you could type (in the document) spanisha  and it instantly turns it into á 
      I tried doing this in autoit, here's what I have so far (my entire code so if this language requires a main function or a return/exit to function properly please let me know):
      ;is this a proper comment? HotKeySet ( "spanisha" , "SendAltered" ) Func SendAltered() Send("á", flag = 0); EndFunc I assume that autoit follows a sort of contemporary hotkey pressing model where you have to hold all keys at the same time? which makes this impossible. So
      I'm wondering if anyone has a workaround for this? or maybe an alternative to HotKeySet()
      I have a vague memory of someone saying that doing something like spanisha:á would work. I don't know if I'm slightly off syntax but this doesn't work.
      Also I tried doing 
      ;is this a proper comment? ;HotKeySet ( "a" , "SendAltered" ) ;spanisha::á Func SendAltered() Send("á"); EndFunc just to try and debug,
      I'm also wondering if my approach is fundamentally wrong since HotKeySet() was made for something like !^A. Or if Send() is syntactically wrong.
      I'm also noticing on these forums that specifying installation is important so to whom it may concern I downloaded both installers, editor and main files. Although I'm about to be real mad if the editor installation makes a difference.
    • By thedemons
      Introduction
      ImGui is a popular library written by ocornut, it can make awesome user interface based on directx. It is being used by many big apps/games.  The UI is nice and flexible, easy to use because of frame-by-frame drawing. So I decided to convert the entire ImGui library to AutoIt
      At first it's just an experiment, i converted some basic draw functions of imgui, compile to a dll, then using DllCall in autoit to call the functions. I was testing to see how much FPS i can get in autoit, and i was expected a low FPS, since autoit is slow. Suprisingly, the FPS turned out to be so high, it works really fast, even when drawing 1000 buttons at the same time. Features
      More than +270 functions converted from ImGui (compiled dll). Has 90% of the capability of what you can do in C++; Usable ImGuiIO and ImGuiStyle, so you can set whatever configurations you like. Preview
          
      Usage
      #include <WinAPI.au3> #include "ImGui.au3" ; Create a window Local $hwnd = _ImGui_GUICreate("AutoIt ImGui", 1024, 768) _WinAPI_ShowWindow($hwnd) ; Set style color _ImGui_StyleColorsLight() ;~ _ImGui_StyleColorsDark() Local $f_value = 5 While 1 ; when the user click close button on the window, this will return false if Not _ImGui_PeekMsg() Then Exit ; must call _ImGui_BeginFrame() _ImGui_Begin("Another window") _ImGui_Text("Hello there..") If _ImGui_Button("click me") Then $f_value = 5 _ImGui_SliderFloat("slider", $f_value, 2, 20) If _ImGui_IsItemHovered() Then _ImGui_ToolTip("what r u doing?") _ImGui_End() ; must call _ImGui_EndFrame() Wend  
      Remark
      Most of the functions were converted automatically. I haven't tested all of them yet, if some function doesn't work for you, please tell me. Still missing some features of ImGui, please tell me if you needed any. Run \tools\imgui-au3-setup.au3 to add _ImGui functions to SciTE auto-complete. Source Code
      Require: DirectX GitHub: imgui-autoit
    • By shelly
      I have to press tab to reach a selected button then double click on that
      Here's my script but its not working:
      WinActivate("Policy Decisions -- Webpage Dialog","")
      Sleep(3000)
      Send("{TAB}")
      Send("{TAB}")
      Send("{TAB}")                    // at this point its working according to my need  but double click is not working
      Mouseclick("Left",510, 320, 2, 0)

×
×
  • Create New...