you have a different problem. but first:
paik1002 wrote:
So how do I get text at x100 y200 using control functions, given a targetClassNN?
if you're satisfied moving the mouse, then CyLON's way is probably best
alternatively you could loop through all controls with
WinGet,,ControlList and then
ControlGetPos,x,y,w,h and check if the coordinate falls within the control's rect. but i THINK this has the problem if multiple controls are stacked on top of each other. consider a Tab control, with a text box inside a tab. the coordinate of the textbox would technically also fall inside the tab control also.
you could also try
handle:= DllCall("WindowFromPoint", Int,x, Int,y) and then ControlGetText with the ahk_id %handle%
but now...
paik1002 wrote:
A known classNN of an application, say targetClassNN, has a bunch of cells populated with text data, meaning that each of the data cells do not have unique ClassNNs.
ControlGetText is usually going to be used on a Static text control, or an Edit textbox control, or something like that. if you have ONE control that contains MULTIPLE textbox cells, then its probably some type of custom built control, and not a standard windows control. in which case, even if ControlGetText DID support coordinates, its unlikely it retrieve the data you'd want. because, the coordinate would just specify the single control, in which case i'd think ControlGetText would simply return ALL of the text, for all boxes. its kinda like a spreadsheet. if the actual spreadsheet grid is one big single control with one classNN, then when you ask to get the "text" of that big control, what are you really asking? to get the text of everything in that control.
so really, you want to get the text of one sub-textbox of a control. its weird because most controls aren't really built like that. normally each box has its own individual classNN. since this is a weird custom situation, the only solution i could think of is the most hackish way possible: click on box, send ^a, send ^c, move mouse back. i have to do this for my app because some games don't expose individual control classNN's for their textboxes and such. the entire game window is just one single control. it sucks