Cursor Position

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
stbede77
Newbie
Posts: 18
Joined: Wed Oct 25, 2006 7:04 pm

Cursor Position

Post by stbede77 » Fri Mar 02, 2007 11:16 am

I have been using the Follow Cursor and Relative options but I was wondering if there is a way to add this option into my own macro? So when I start my macro up I automatically have the positions show up next to the cursor?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Mar 02, 2007 11:37 am

This might give you some ideas ... run the script ... you'll see it mirrors closely what the cursor monitor does:

Code: Select all

GetCursorPos>x,y

Dialog>Dialog1
   Caption=CursorMon
   Width=124
   Height=55
   Top=%y%
   Left=%x%
   Max=0
   Min=0
   Close=0
   Resize=0
   Label=msLabel1,0,0,true
EndDialog>Dialog1

Show>Dialog1

LibFunc>user32,FindWindowA,dhwnd,TForm,CursorMon
Let>WS_CHILD=1073741824
Let>style=WS_CHILD
LibFunc>user32,SetWindowLongA,sres,dhwnd,-16,style
CloseDialog>Dialog1
Show>Dialog1

Label>mainloop
  GetCursorPos>x,y
  GetPixelColor>x,y,col
  Let>Dialog1.msLabel0=%x%,%y%,%col%
  ResetDialogAction>Dialog1
  MoveWindow>CursorMon,x,y
  Wait>0.02
  Goto>mainloop
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

stbede77
Newbie
Posts: 18
Joined: Wed Oct 25, 2006 7:04 pm

Post by stbede77 » Fri Mar 02, 2007 11:53 am

Hmm... thanks for the info I think I can edit it for what I need...

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