I'm trying to force a window to close by pressing it's "Cancel" button, but I'm having a hard time using either ControlSend or ControlClick to accomplish this. I know what the control is called via Window Spy, and I know I have my syntax/names correct. I've had problems like this before with this particular program's popup windows not responding well to Controlsend. I could just send a couple of {Tab}'s, but I'd rather be precise about it.
So, here's my question. Can you use the CONTROL text, rather than the window text to control where a command is sent?
Here's my current code:
ControlSend, TmtBitBtn2, {Enter} ahk_class TROListForm
Here's what Window Spy says about this button:
( Now Under Mouse Cursor )
ClassNN: TmtBitBtn2
Text: Cancel
Color: 0xF0F0F0 (Blue=F0 Green=F0 Red=F0)
Is there any way I can use the text "Cancel" instead of the ClassNN?
Thanks! Paul