ControlGetText Fast ?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
ronkwan
Posts: 8
Joined: 04 Nov 2016, 03:41

ControlGetText Fast ?

Post by ronkwan » 13 Nov 2023, 21:15

According to the doc, " ControlGetText always retrieves the text using the slow mode ... ". I would like to know if it's possible to override this setting and let ControlGetText run at a faster speed? Or it needs a source code level change?

Thank you.
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: ControlGetText Fast ?

Post by mikeyww » 13 Nov 2023, 22:17

Not fast enough?

Code: Select all

#Requires AutoHotkey v2.0
winTitle := 'ahk_exe notepad.exe'
ctl      := 'Edit1'
start := A_TickCount
ControlGetText(ctl, winTitle)
MsgBox 'Elapsed time: ' A_TickCount - start ' ms', 'Result', 64
image231113-2217-001.png
Output
image231113-2217-001.png (11.74 KiB) Viewed 498 times
ronkwan
Posts: 8
Joined: 04 Nov 2016, 03:41

Re: ControlGetText Fast ?

Post by ronkwan » 13 Nov 2023, 22:35

Hi mikeyww,

In your case, yes. In my case, no. My "Elapsed time" would be 100ms at best, usually over 150~250+ ms. Please understand I have a reason to ask such question. I need to get multiple lines of text out of a control and I am looking for ways to make it run faster.
just me
Posts: 9574
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: ControlGetText Fast ?

Post by just me » 14 Nov 2023, 04:05

SetTitleMatchMode wrote: Parameters
Speed
Specify one of the following words to indicate how the WinText and ExcludeText parameters should be matched
Do you use this parameters? Show the relevant code, please.
Post Reply

Return to “Ask for Help (v2)”