luis713 Posted August 9, 2019 Share Posted August 9, 2019 I was looking in Autoit's library but couldn't find a way to find a text when using "_GUICtrlEdit_Create", there is a similar function "_GUICtrlEdit_Find" but it doesn't help me because I want to find the text and get the start/end position, the function before calls a window and I need to automate it. I have done this using "_GUICtrlRichEdit" but I have several problems using it, it appears and disappears, so now I'm trying to do it using _GUICtrlEdit Link to comment Share on other sites More sharing options...
Nine Posted August 9, 2019 Share Posted August 9, 2019 Maybe posting the code you have now would help us to help you... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
InnI Posted August 9, 2019 Share Posted August 9, 2019 #include <GuiEdit.au3> #include <ButtonConstants.au3> #include <ScrollBarsConstants.au3> $GUI = GUICreate("Find in Edit") $Edit = _GUICtrlEdit_Create($GUI, "", 5, 5, 390, 350, BitOR(0x003010C4, $ES_NOHIDESEL)) $Inp = GUICtrlCreateInput("", 5, 365, 345) _GUICtrlEdit_SetCueBanner(GUICtrlGetHandle($Inp), "String to search") $Btn = GUICtrlCreateButton("Find", 355, 365, 40, 25, $BS_DEFPUSHBUTTON) GUISetState() $Text = "The start value can be greater than the end value." & @CRLF & _ "The lower of the two values specifies the character position of the first character in the selection." & @CRLF & _ "The higher value specifies the position of the first character beyond the selection." _GUICtrlEdit_SetText($Edit, $Text) Do Switch GUIGetMsg() Case -3 Exit Case $Btn $Line = GUICtrlRead($Inp) $Start = StringInStr(_GUICtrlEdit_GetText($Edit), $Line) - 1 $End = $Start + StringLen($Line) _GUICtrlEdit_SetSel($Edit, $Start, $End) _GUICtrlEdit_Scroll($Edit, $SB_SCROLLCARET) EndSwitch Until 0 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now