cursor area active

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
worldwide
Junior Coder
Posts: 31
Joined: Mon Jul 09, 2007 11:34 am

cursor area active

Post by worldwide » Mon Jul 23, 2007 11:36 am

Hello,

i want to let a macro run, the time the cusor is within a speciefied area of a window.

Im sorrybut have no clue to solve this.
I know i can get the data of the cursor true GetCusrosPos, but then i have to activate my macro the time its within that "window"

if X>365
if X70
if Y<430
goto data
This is what i thought, its within that window area and then it jumps to the label




I hope somebody get the idea what i mean, and could help me with that ?

Best

User avatar
JRL
Automation Wizard
Posts: 3518
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Jul 23, 2007 1:51 pm

You would need to alter the script but there are a couple of Ideas discussed here that might help you. These execute on a mouse click within a certain screen region. You would need to alter this so that the macro executes when the mouse cursor moves into the specified screen region.

worldwide
Junior Coder
Posts: 31
Joined: Mon Jul 09, 2007 11:34 am

Post by worldwide » Tue Jul 24, 2007 9:09 am

:D great !!
This is what i was looking for.

Im already bussy to edit and change the code, i will post it when its ready and working ;-)

Thanx !!

worldwide
Junior Coder
Posts: 31
Joined: Mon Jul 09, 2007 11:34 am

Post by worldwide » Wed Jul 25, 2007 12:12 pm

So heres partially the code which i use :

---------------------------------------------------------------------
// Set Bounds Here
Let>X1=365
Let>X2=780
Let>Y1=70
Let>Y2=430


Let>OnlyDesktop=1

OnEvent>KEY_DOWN,VK2,0,MouseClick

Label>MainLoop
Wait>0.2
Goto>MainLoop

SRT>MouseClick
GetActiveWindow>title,xact,yact


Let>OkToContinue=FALSE
If>OnlyDesktop=1
If>title=TmsSw
Let>OkToContinue=TRUE
Endif
Else
Let>OkToContinue=TRUE
Endif

If>OkToContinue=TRUE
// Check Cursor is Within Bounds
GetCursorPos>X,Y

If>{((%X% >= %X1%) AND (%X% = %Y1%) AND (%Y% rawexport
Endif
Endif
END>MouseClick

-----------------------------------------------------------------------

Hope somebody can use it also

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts