This syntax doesn't work with AHK v2.02:
ControlGetText, OutputVar [, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
I suppose there is no "OutputVar" parameter for the function ControlGetText(), but that is just a guess, as is how to specify the control from which to read the text. Is there an easier way to find and specify the control that is active when the hotkey is pressed?
Code: Select all
Ins::
{
FocusedHwnd := ControlGetFocus("A")
FocusedClassNN := ControlGetClassNN(FocusedHwnd)
textcontent := ControlGetText(FocusedClassNN) ; [i]What parameters does this function take?[/i]
Send(FocusedHwnd) ; [i]contains: "132654"[/i]
Send(FocusedClassNN) ; [i]contains: "Edit1"[/i]
Send(textcontent) ; [i]Yields: "Error: Target Window not found"[/i]
Return
}
[I find AHK extremely difficult to use. I used 4 years ago and managed to get something out of it after having spent lots of time with the cryptic syntax. Now with v2 there's no real documentation anymore.]