Jump to content
Shirdish_chakravarthi

how to retrieve data/text from GUICtrlCreateInput into a variable?

Recommended Posts

Shirdish_chakravarthi

get.PNG

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

 

Share this post


Link to post
Share on other sites
Shirdish_chakravarthi

@argumentum i was able to do it using your help "ControlGetText()" thanks

  • Like 1

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

  • Similar Content

    • vin1
      By vin1
      i need a script that can replace words in text with other words from a words list
      it has to have 2 edit boxes input/output and a button "run"
      from word_list.txt it choses which word to replace with. words are separated with commas for multiple choice
       

       
       

       
       
      ; AutoIt GUI Example ; Created: 17/01/2005 - CyberSlug ; Modifed: 05/12/2011 - guinness ; Modifed: 09/06/2014 - mLipok #Region INCLUDE #include <AVIConstants.au3> #include <GuiConstantsEx.au3> #include <TreeViewConstants.au3> #EndRegion INCLUDE #Region GUI GUICreate("Sample GUI", 400, 420) GUISetIcon(@SystemDir & "\mspaint.exe", 0) #EndRegion GUI #Region EDIT GUICtrlCreateEdit(@CRLF & " Sample Edit Control", 10, 10, 380, 175) GUICtrlSetTip(-1, '#Region EDIT') #EndRegion EDIT #Region EDIT2 GUICtrlCreateEdit(@CRLF & " Sample Edit Control", 10, 185, 380, 175) GUICtrlSetTip(-1, '#Region EDIT') #EndRegion EDIT2 #Region BUTTON GUICtrlCreateButton("Sample Button", 10, 360, 100, 30) GUICtrlSetTip(-1, '#Region BUTTON') #EndRegion BUTTON #Region GUI MESSAGE LOOP GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() #EndRegion GUI MESSAGE LOOP  
    • Ambient
      By Ambient
      I have tried several way sto get this to work to no avail. Any help would be appreciated. #include <ListViewConstants.au3> #include <GuiListView.au3> #include "GuiListViewEx.au3" $idItem = GUICtrlCreateListViewItem($r & " | " & $c & $adoRs.Fields("TransactionAmount").value & " | " & $Timestamp & " | " & _StringProper($adoRs.Fields("Tillid").value) & @CRLF & @CRLF & "Card Number : " & $cardnum & " " , $idListView) ConsoleWrite( "IDITEM" & $idItem) If STRINGLEFT($adoRs.Fields("TransactionAmount").value,1)= "-" Then Consolewrite(" String is Negative" & @CRLF) ;Drops in Here as expected ;GUICtrlSetColor(-1, $COLOR_RED) ; Colour line if item is negative this didn' work $TxC= _GUICtrlListView_SetTextColor($hListView, $CLR_RED) ; I also tried $TxC= _GUICtrlListView_SetTextColor(-1, 0xFF0000) CONSOLEWRITE("TEXTCOLOUR RETURNED " & $TxC & @crlf) ; This is returning True ELSE Consolewrite(" String is NOT Negative" & @CRLF) EndIf  
    • Jefrey
      By Jefrey
      Needed a way to store global temporary & permanent information and came up with this.
      This is inspired by NodeJS's store and store2 packages, as well as W3 specs' localStorage and sessionStorage, offering multiple ways of usage.
      This is not related to any browser's storage, nor will allow you to access or modify browsers storage - although this is possible and not a hard task, this is not what this UDF is intended to do.
      This UDF offers functions for temporary storage (that gets cleaned up once the application is shutdown) that is kept on memory using ScriptingDictionary, as well as for permanent storage, that is saved on the harddisk as an encrypted file.
      sessionStorage (temporary storage)
      It's useful to keep application state and temporary settings accessible by any part of your script (although it could also be done with a global variable, I still prefer this method).
      You have multiple ways, at your choice, to:
      ; add or modify a key sessionStorage("foo", "bar") store("foo", "bar") sessionStorage_set("foo", "bar") sessionStorage_setItem("foo", "bar") ; read a key (returns false if key does not exist) $read = sessionStorage("foo") $read = store("foo") $read = sessionStorage_get("foo") $read = sessionStorage_getItem("foo") ; delete a key sessionStorage_remove("foo") ; delete all keys sessionStorage_clear() sessionStorage_clearAll() localStorage (permanent storage)
      It's useful to store user-defined settings.
      ; initialize ; this is optional, but allows you to control ; how things are going to be saved localStorage_startup([file where you want the settings to be saved], [crypt password]) ; by default, if not supplied, if supplied the "Default" keyword (or if you dont initialize), ; the file will be a random-named file (based on @ScriptFullPath) at user's %APPDATA% ; and the password will also be based on @ScriptFullPath ; you can set only the crypt password if you want: ; localStorage_startup(Default, "mypassword") ; the usage is the same as sessionStorage ; add or modify a key localStorage("foo", "bar") store2("foo", "bar") ; notice the '2' localStorage_set("foo", "bar") localStorage_setItem("foo", "bar") ; read a key (returns false if key does not exist) $read = localStorage("foo") $read = store2("foo") $read = localStorage_get("foo") $read = localStorage_getItem("foo") ; delete a key localStorage_remove("foo") ; delete all keys localStorage_clear() localStorage_clearAll() Download
    • AndyS19
      By AndyS19
      I want to copy just the selected text in an input control and put it to the clipboard, but GuiCtrlRead() always reads all of the text in the control.
      In this test code, when I highlight a  portion of the left control's text and press ^C, I want to copy just that text to the clipboard; but when I highlight a  portion of the right control's text and press ^C, I want to copy all of its text to the clipboard.
      #include <Debug.au3> _DebugSetup(@ScriptName & "_debug.txt", False, 2, "") _DebugOut("=============== " & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & " ====================") #include <GUIConstants.au3> #include <WinAPI.au3> #include <Array.au3> Opt("GUICloseOnESC", 1) ; ESC closes GUI? (0 = no, 1 = yes) Opt("GUIOnEventMode", 1) ; Set OnEvent mode Opt('MustDeclareVars', 1) OnAutoItExitRegister("Event_GUIClose") Opt("GUIEventOptions", 1) ;0=default, 1=just notification, 2=GuiCtrlRead tab index Opt("WinTitleMatchMode", -2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Global $hWnd_MainWin, $iID_Left, $iID_Right _Main() Func _Main() $hWnd_MainWin = GUICreate("test7", 200, 300) $iID_Left = GUICtrlCreateInput("AAA BBB CCC (get Selected text)", 10, 30, 200, 25) GUICtrlSetOnEvent($iID_Left, "handle_left_btn") $iID_Right = GUICtrlCreateInput("DDD EEE FFF (get All text)", 10, 60, 200, 25) GUICtrlSetOnEvent($iID_Right, "handle_right_btn") Local $aAccelKeys[1][2] = [["^c", $hWnd_MainWin]] GUISetAccelerators($aAccelKeys) GUISetOnEvent($GUI_EVENT_CLOSE, 'Event_GUIClose') GUISetState() ; Make everything visible While 1 Sleep(127) WEnd EndFunc ;==>_Main Func handle_CTRL_C_key() ConsoleWrite("+++: handle_CTRL_C_key() entered" & @CRLF) Local $hCtrl, $ctrlID, $control_classname, $text $control_classname = ControlGetFocus($hWnd_MainWin) $hCtrl = ControlGetHandle($hWnd_MainWin, "", $control_classname) $ctrlID = _WinAPI_GetDlgCtrlID($hCtrl) If ($ctrlID = $iID_Left) Then $text = GUICtrlRead($ctrlID) ClipPut($text) ConsoleWrite("+++: Copied selected text:" & @CRLF & "==>" & $text & "<==" & @CRLF) ElseIf ($ctrlID = $iID_Right) Then $text = GUICtrlRead($ctrlID) ClipPut($text) ConsoleWrite("+++: Copied all text:" & @CRLF & "==>" & $text & "<==" & @CRLF) EndIf EndFunc ;==>handle_CTRL_C_key Func Event_GUIClose() Exit (99) EndFunc ;==>Event_GUIClose Func handle_left_btn() ConsoleWrite("+++: handle_left_btn() entered" & @CRLF) EndFunc ;==>handle_left_btn Func handle_right_btn() ConsoleWrite("+++: handle_right_btn() entered" & @CRLF) EndFunc ;==>handle_right_btn
       
    • jdegraff
      By jdegraff
      I'm trying to add a bit of functionality to the FastStone File Rename dialog. I can access every control that I need to except the one that contains the files to be renamed. If I do some exploring in a vbScript shell I get
      :c  = "TTntTreeView.UnicodeClass1"
      :?aut.ControlTreeView(win,"",c,"GetItemCount","","")
      5
      You can see that the treeview control reports having five items, which is the number displayed. If I manually select (mouse) item #3 I can see the result by
      :?aut.ControlTreeView(win,"",c,"GetSelected","1","")
      #3
      But I do not know how to get the text for the selected item. If "#3" is the item reference then I should be able to
      :?aut.ControlTreeView(win,"",c,"GetText","1","#3")
      or
      :?aut.ControlTreeView(win,"",c,"GetText","1","#3")
      if I go strictly by the help file, but it returns nothing.
      :?aut.ControlTreeView(win,"",c,"Exists","","3")
      1
      So it appears that item 3 exists, but
      :?aut.ControlTreeView(win,"",c,"GetText","","3")
      does not have any text???
      :?aut.ControlTreeView(win,"",c,"Exists","","9")
      1
      and it also appears item 9 exists (it does not)
      :?aut.ControlTreeView(win,"",c,"Select","","")
      1
      causes the first item to be selected, as does
      :?aut.ControlTreeView(win,"",c,"Select","","3")
      1
      Here is the output from the Window Info tool
      >>>> Window <<<<
      Title:  Batch Image Convert / Rename
      Class:  TBatchConvert
      Position:   501, 83
      Size:   760, 520
      Style:  0x16CD0000
      ExStyle:    0x00010100
      Handle: 0x0000000001950796
      >>>> Control <<<<
      Class:  TTntTreeView.UnicodeClass
      Instance:   1
      ClassnameNN:    TTntTreeView.UnicodeClass1
      Name:   
      Advanced (Class):   [CLASS:TTntTreeView.UnicodeClass; INSTANCE:1]
      ID: 37030040
      Text:   
      Position:   354, 79
      Size:   378, 188
      ControlClick Coords:    108, 86
      Style:  0x54010039
      ExStyle:    0x00000200
      Handle: 0x0000000002350898
      >>>> Mouse <<<<
      Position:   970, 279
      Cursor ID:  0
      Color:  0xE1E1E1
      >>>> StatusBar <<<<
      >>>> ToolsBar <<<<
      >>>> Visible Text <<<<
      Batch Rename
      ...
      D:\temp\picsave\
      Images + Videos (*.jpg;*.jpe;*.jpeg;*.bmp;*.gif;*.tif;*.tiff;*.cur;*.ico;*.png;*.pcx;*.jp2;*.j2k;*.tga;*.ppm;*.wmf;*.psd;*.crw;*.nef;*.cr2;*.orf;*.raf;*.dng;*.mrw;*.pef;*.srf;*.arw;*.rw2;*.x3f;*.sr2;*.srw;*.nrw;*.rwl;*.eps;*.avi;*.mpeg;*.mpg;*.wmv;*.mov;*.mp4;*.mts;*.mkv;*.m4v)
      Search and Replace
      Use Filename Template
      No Sort
      Clear
      Remove
      Add All
      Add
      Preview
      Close
      Rename
      No Change
      ?
       
       


×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.