Hello !!!
How can I know if the user has clicked in a button of a window?
Greetings,
Reimon
How can I know if the user has clicked in a button ?
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Of another window? Most likely you can't. What happens when the user clicks on that button? Maybe the outcome of pressing that button is something you can detect? e.g. if pressing that button causes a window to appear than you could have a macro recognise when that window appears ...
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
How can I know if the user has clicked in a button ?
Marcus,
OK. Thank you very much for your idea.
Greetings
Reimon
OK. Thank you very much for your idea.
Greetings
Reimon
check out this link
http://www.mjtnet.com/usergroup/viewtop ... 1421#11421
Check out this link, Of course you would need to now where on the window the button is located.
This script below is one that I made with help from the link above.
The script below will find the top x,y and bottom x,y positions and display them in a MessageModal.
start the macro.
Hold down the shift key and drag from the top left corner to the bottom right and let go.
To Close the macro, hold down the ctrl + alt + End keys.
// Set Bounds Here
Let>X1=0
Let>Y1=0
Let>X2=0
Let>Y2=0
Let>NotFalse=True
Label>MainLoop
Wait>0.2
OnEvent>KEY_DOWN,VK35,5,END
OnEvent>KEY_DOWN,VK1,1,LDownMouseClick
GetCursorPos>X1,Y1
Goto>MainLoop
//-----------
SRT>LDownMouseClick
Wait>0.2
IF>LUpLDown
GoSub>GetUpPosition
ELSE
GoSub>LDownMouseClick
ENDIF
Check out this link, Of course you would need to now where on the window the button is located.
This script below is one that I made with help from the link above.
The script below will find the top x,y and bottom x,y positions and display them in a MessageModal.
start the macro.
Hold down the shift key and drag from the top left corner to the bottom right and let go.
To Close the macro, hold down the ctrl + alt + End keys.
// Set Bounds Here
Let>X1=0
Let>Y1=0
Let>X2=0
Let>Y2=0
Let>NotFalse=True
Label>MainLoop
Wait>0.2
OnEvent>KEY_DOWN,VK35,5,END
OnEvent>KEY_DOWN,VK1,1,LDownMouseClick
GetCursorPos>X1,Y1
Goto>MainLoop
//-----------
SRT>LDownMouseClick
Wait>0.2
IF>LUpLDown
GoSub>GetUpPosition
ELSE
GoSub>LDownMouseClick
ENDIF
Code: Select all
//------------
SRT>GetUpPosition
GetCursorPos>X2,Y2
End>GetUpPosition
GoSub>MsgMod
SRT>MsgMod
MessageModal>%X1%,%Y1%,%X2%,%Y2%
End>MsgMod
Goto>MainLoop
SRT>END
Goto>ENDMACRO
End>END
label>ENDMACRO
//----END-----
Aaron