Jump to content

Search the Community

Showing results for tags 'GuiCtrlCreateInput'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 13 results

  1. Hi, I'm not sure why my code suddenly breakage as previously this function was okay. But I do the re-test I found that my password field saved the input with added 3 for each character input. Example the input saved supposed "12345678901234567890" but it become "1323334353637383930313233343536373839303". This is my code; $input_password = GUICtrlCreateInput($a_password, 175, 165, 150, 18, $ES_PASSWORD) GUICtrlSetLimit($input_password,-1, 20) Local $hPW = GUICtrlGetHandle($input_password) Local $hToolTip2 = _GUIToolTip_Create(0) ; default style tooltip _GUIToolTip_AddTool($hToolTip2, 0, 'Maximum 20 characters only.' , $hPW) Have anyone know what had happen?
  2. I'm trying to assign a faint text in the background to an input field that disappears after the input has started. This should have a certain color such as gray.
  3. NEW VERSION: 17 Jun 2013 Ever wondered how to avoid input being so painful? You can type a lot of errors in a GUICtrlCreateInput, for example alphanumeric where you want only numbers and decimals, typing 10 characters where you only want 9, etc. Input masks can make your life easier and Validation can be as simple as this: GuiCtrlCreateLabel("Input Decimal(8,2)", 10, 110, 200, 15) $MyInput = GUICtrlCreateInput("",210,110,110,20) _Inputmask_add($MyInput, $iIM_INTEGER, 0, "", 8, 2) It requires only one additional line per input The UDFexample script demonstrates 13 dynamic input validations. A lot more validations can be made. Up to you to be inventive. _inputmask 1.0.0.5.zip Enhanced: Better input control - The previous versions worked well with blank fields but editing non-blank inputs was really a pain. Now the cursor remains where the edit is occurring. Once the max width is reached, no additional characters can be added. - Added beep on invalid entry. In fact I use soundplay instead of beep because beep gives a cracking sound result on my laptop. You can set beep off (put Global $bBeep = False anywhere in your script) If you prefer a true beep, you can beep it on in line 150. Minor issue: - decimal Numbers after the '.' scroll away when inserting until it bumps to the max allowed decimals. I didn't fix that yet, I don't know how to solve this ... Examples: Example 1 _inputmask - example.au3 (see zip file) Example 2: _Inputmask combining two WM_COMMAND handlers (see zip file) Thanks to Melba23 for his explanation how to combine GUIRegisterMsg WM_COMMAND handlers) If you create your own input mask that could be useful for the AutoIt community, please let me know, I will be glad to add it to the above example. GreenCan
  4. Hello Guys this is my gui and i need the numeric value typed in the highlighted inputbox. if this value is greater than 1 i need to perform some operations \ Here is the summary about that field which i got from wininfo tool i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... here i am using the valu present in the field can you guys tell me what's wrong??? or how can i get that value? My_GUI.au3
  5. in need the path/text present int above shown input box to be copied or retrieved into a variable .. how can i do that? Thanks
  6. I am having difficulties getting updated results from GUICtrlCreateInput. I wrote a small script to demonstrate what I am trying to do. This script reads a text file into an array and displays the Name and Number from the text file. The user can check a name and change the number, and the results are displayed in _ArrayDisplay. Only the Checked names are displayed in their original position. This is necessary for future plumbing. The problem with this script is the original number is returned, not the changed number. I cannot figure out how to get the updated number to be displayed. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; This script reads a text file into an array and displays the Name and Number from the text file. ; The user can check a name and change the number, and the results are displayed in _ArrayDisplay. ; Only the Checked names are displayed in their original position. This is necessary for future ; plumbing. ; ; The problem with this script is the original number is returned, not the changed number. I cannot ; figure out how to get the updated number to be displayed. ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include-once #include <MsgBoxConstants.au3> #include <array.au3> #include <Date.au3> #include <WinAPIFiles.au3> #include <AutoItConstants.au3> #include <Misc.au3> #include <File.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Local $iMax = 6 ;Default number of Videos - 1 for the array counter Dim $aTextFile[$iMax][2] ; [start with 5 entries][Name, Number] Don't get confused! [Row][Column] Local $i = 0 Local $iLeft = 30 Local $iTop = 30 Local $sName Local $sNumber Local $aArray Local $iMaxCol = 5 Local $iRow = 0 Local $iCol = 0 Local $aNumberCount[$iMaxCol][2] $aArray1 = ReadFile() $aNamesNumbers = DisplayNames($aArray1) _ArrayDisplay($aNamesNumbers) ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; ReadFile() places the contents of the NameNumber.txt file in an array ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Func ReadFile() Local $sFileData = @ScriptDir & "\NameNumber.txt" Local $iStrReturn = 0 Local $aArrayFile Local $aTextFile[$iMaxCol][2] Local $aName Local $sCheckBox1 Const $iL = 10 ; Count from Left for GUI so all buttons line up Local $sFill Local $iA = 0, $iN = 0 ; Put the Names into an Array _FileReadToArray($sFileData, $aArrayFile) For $iA = 0 To $aArrayFile[0] ; Step through the array looking for Names If StringInStr($aArrayFile[$iA], "Name:") Then $aName = StringSplit($aArrayFile[$iA],":") $sFill = $aName[2] If UBound($aTextFile) <= $iRow Then ; Resize the array when $iRow is equal to the element count in the array to prevent subscript error ReDim $aTextFile[UBound($aTextFile) + 1][$iMaxCol] EndIf $aTextFile[$iRow][$iCol] = $sFill $iRow += 1 EndIf Next $iCol = 1 $iRow = 0 $sFill = "" For $iA = 1 To $aArrayFile[0] ; Step through the array looking for Numbers If StringInStr($aArrayFile[$iA], "Number:") Then $aName = StringSplit($aArrayFile[$iA],":") $sFill = $aName[2] If UBound($aTextFile) <= $iRow Then ; Resize the array when $iRow is equal to the element count in the array to prevent subscript error ReDim $aTextFile[UBound($aTextFile) + 1][$iMaxCol] EndIf $aTextFile[$iRow][$iCol] = $sFill $iRow += 1 EndIf Next Return $aTextFile EndFunc ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Display the Name and Number ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Func DisplayNames($aArray1) Local $aName[$iMax] Local $aNumbers[$iMax] $iMMCount = UBound($aArray1) $iMMCount -=1 Local $iWidth = 300 Local $iLength = 300;$iMMCount * 30 GUISetFont(12) $hGUI = GUICreate("Edit / Update Number Test", $iWidth, $iLength, -1, -1) GUICtrlCreateLabel(" Name Number",1,5) ;$iTop += 30 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Display Name with a Checkbox. Only Checked Names should be saved. ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For $i = 0 to $iMMCount Step 1 $sNameText = $aArray1[$i][0] $iNameLength = StringLen($sNameText) $aName[$i] = GUICtrlCreateCheckbox($sNameText,$iLeft, $iTop) $iTop += 30 Next ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Display the number from the text file below each name. Allow the user to change the number and display the ; new number. ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $iLeft = 60 GUIStartGroup() $iTop = 28 For $i = 0 to $iMMCount Step 1 $sNumberText = $aArray1[$i][1] $aNumberCount[$i][1] = $sNumberText $aNumberCount[$i][0] = GUICtrlCreateInput($sNumberText,$iLeft, $iTop, 50,18, $GUI_DOCKAUTO) GUICtrlSetPos($aNumberCount[$i][0],200) $iTop += 30 Next ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Read the checked names and (possibly updated) number ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $iMMCount = UBound($aNumberCount) $iMMNewCount = $iMMCount - 1 Local $aGUICheckbox[$iMMCount] Local $aCheckedNameNumber[$iMMCount][2] $iLeft = 30 Local $idCloseGUI = GUICtrlCreateButton("Close",$iLeft, $iTop) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idCloseGUI For $i = 0 To $iMMNewCount Step 1 Switch GUICtrlRead($aName[$i]) Case $GUI_CHECKED $aCheckedNameNumber[$i][0] = $aArray1[$i][0] Case $GUI_UNCHECKED EndSwitch Switch GUICtrlRead($aNumberCount[$i][0]) Case $aCheckedNameNumber[$i][1] = GUICtrlRead($aNumberCount[$i][1]) EndSwitch Next ExitLoop EndSwitch WEnd For $i = 0 to $iMMNewCount step 1 GUICtrlRead($aNumberCount[$i][0]) If $aCheckedNameNumber[$i][0] <> "" Then $aCheckedNameNumber[$i][1] = $aNumberCount[$i][1] EndIf Next GUIDelete($hGUI) Return $aCheckedNameNumber EndFunc This is the text file I am reading. If you want to try this out put the NameNumber.txt file in your script directory. It's attached to the post. * This is a dummy file with a Name and Number * The only purpose of this file is to read the updated Number. Name:Taggart Number:916 Name:Mongo Number:90 Name:Hedley Lamarr Number:22 Name:Bart Number:9999 Name:The Waco Kid Number:2244 If I change the number, the original number is displayed at the end, not the updated/modified number. I need the modified number to be displayed. Thanks in advance for any assistance! Jibberish NameNumber.txt
  7. Global $l = GUICtrlCreateInput("3", 16, 48, 25, 22, $ES_NUMBER) Global $p = GUICtrlCreateInput("3", 56, 48, 25, 22, $ES_NUMBER) $go = GUICtrlCreateButton("Start", 136, 48, 83, 25) Global $m = GUICtrlCreateInput("1", 96, 48, 25, 22, $ES_NUMBER) Case $go $l = Number(GUICtrlRead($l)) $p = Number(GUICtrlRead($p)) $m = Number(GUICtrlRead($m)) Then I say consolewrite: ConsoleWrite(" l: " & $l & " p: " & $p & " m: " & $m & @LF); And first time when I hit Start ($go) button it gives me default numbers and works fine l: 3 p: 3 m: 1 But then I hit Start again and no need to change the numbers in input it gives me: l: 68 p: 68 m: 0 Then I hit again Start and this is result: l: 0 p: 0 m: 0 from this moment it is all the time 0 (zero) so what could be this?
  8. Hi all, I have the following snippet of code that sort of works but isn’t doing exactly what I want. expand popup #include <GuiConstants.au3> Global $gGUIWidth = 250 Global $gGUIHeight = 150 Initial() Func Initial()    ; Create the initial GUI    $BaseGUI = GUICreate("", $gGUIWidth, $gGUIHeight, -1, -1, -1, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)    GUISetState(@SW_SHOW, $BaseGUI)    ; Create a field for entering the current value    GUICtrlCreateLabel("Current Value:",  10, 10)    $CurrentValueFld = GUICtrlCreateInput("", 10, 40, 215, 20, $ES_NUMBER)    GUICtrlSetState($CurrentValueFld, $GUI_FOCUS)    ; Create Calculate button    Local $CalculateButton = GUICtrlCreateButton("Calculate", 10, 70, 75, 25)    GUICtrlSetState($CalculateButton, $GUI_DISABLE)    ; Watch the value field and determine if the value is greater than 0 and if so, enable Calculate button    $i = 0    Do       $CurrentValue = GUICtrlRead($CurrentValueFld)       If $CurrentValue > 0 Then          GUICtrlSetState($CalculateButton, $GUI_ENABLE + $GUI_FOCUS)          $i = 1       EndIf    until $i = 1    ;Loop until the user exits and check for ESC, "X", or Begin button    While 1       $InitialGUIMsg = GUIGetMsg()       If $InitialGUIMsg = $GUI_EVENT_CLOSE Then          Exit       EndIf    WEnd EndFunc I want to be able to: Start with focus in the value field (it is doing this now) Allow for more than one digit to be entered into the field (it is sort of doing this now but I have to bring focus back to the field) Enable the Calculate button and give focus to it once a value is entered into the value field (it is doing this now) but keep the cursor in the value field so the more digits can be entered (it is not doing this now) Be able to hit ESC or “X” to close the dialog at any time (this only works after I enter a digit in the value field Basically, I want to be able to allow the user to enter one or more digits and hit ENTER or SPACE (while the cursor is still in the value field) to push the Calculate button. I assume I need to bring focus to the button but maybe I don't and can get away with assigning hotkeys for ENTER and SPACE to push the Calculate button while keeping focus in the value field. If you could, please add comments in your code as to what the changes are doing if they aren't obvious to a noobish programmer. Thanks for any help you can offer on this.
  9. As the title states, is there a way to detect which inputbox is "selected" like: if IsSelectedForWritingEtc($MyInputBox) then xxxx i was searching some without success, all my results were like how to read or and write to a inputbox. /T
  10. I'm creating a small MsgBox-style GUI window for a login, and I'm giving my $Username input box the default text "DOMAIN\Username". When I run it, the default text is highlighted as expected, but it'd be nicer if I could highlight only the username portion. I realize I could use multiple input fields, but I'd rather not. I'm currently accomplishing this by: GUISetState(@SW_SHOW) Send("{END}+{LEFT 8}")and that technically works, but I was wondering if there was a "right" way to do this.
  11. Function Reference _GUICtrlInputCueBanner.au3 Creates a cuebanner/placehold (background comment) in the control using Call Back! Sintax: _GuiCtrlInput_SetCueBanner( iCtrlID, "sText", iFrontColor, iBackColor ) _GuiCtrlInput_UnSetCueBanner( iCtrlID ) Supports: ; GUICtrlCreateInput() function! Downloads: Version: 0.9b _GUICtrlInputCueBanner_(RedirectLink).html (Previous downloads: 31) Note: Functions renamed, see fixes below! Works on Windows XP! Usage example is included! Sample: Fixes: Regards, João Carlos.
  12. I have 2 input boxes and no matter which box I move first the entire text is being selected on creation and I would like to prevent it.; Search for record #. Global $inpFindRec = GUICtrlCreateInput("Record#", 406,10, 75, 21) ; Label record # to search for. GUICtrlSetColor($inpFindRec, 0xCACACA) Global $hImgFindRec = GUICtrlCreatePic(@ScriptDir & '\Images\FindUp.bmp', 481, 10, 26, 21) ; Image search record #. ; Search for record data. Global $inpSearchRec = GUICtrlCreateInput("Search", 510,10, 127, 21) GUICtrlSetColor($inpSearchRec, 0xCACACA) Global $hImgSearchRec = GUICtrlCreatePic(@ScriptDir & '\Images\SearchUp.bmp', 637, 10, 26, 21) ; Image search record #.
  13. So I have tested a bit of code that allows me to store login and password information and use it later on to login. See Code below Func LoginInfo() Local $User, $Password Local $btn, $msg Global $Usr, $Pwd GUICreate(" User Name and Password for ESQ", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1) $User = GUICtrlCreateInput("", 10, 5, 300, 20) $Password = GUICtrlCreateInput("", 10, 35, 300, 20,0x0020) $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn ExitLoop EndSelect WEnd $Usr = GUICtrlRead($User) $Pwd = GUICtrlRead($Password) ;MsgBox(4096, "User and Password", GUICtrlRead($User)) ;MsgBox(0,"Password",GUICtrlRead($Password)) EndFunc LoginInfo() #include <IE.au3> MsgBox(4096, "User and Password", $Usr) MsgBox(0,"Password",$Pwd) $URL = "https://google.com" $IE = _IECreate($URL, 0, 0, 0) $HWND = _IEPropertyGet($IE, "hwnd") WinSetState($HWND,"",@SW_MAXIMIZE) _IEAction($IE, "visible") _IELoadWait($IE) Sleep(1000) Sleep(1000) MouseClick("Left",-685,274) Send($Usr) Sleep(1000) MouseClick("Left",-685,296) Send($Pwd) Sleep(500) Send(@CR) Once I use this working code in my larger program it fails. It won't store the login and password information, nor will it wait for rest of the program until the login information is entered. What am I doing wrong?
×
×
  • Create New...