Sign in to follow this  
Followers 0
yellowpower

difference between MouseCoorMode 0 and 1

8 posts in this topic

thanks!

Share this post


Link to post
Share on other sites



MouseCoordMode:

Sets the way coords are used in the mouse functions, either absolute coords or coords relative to the current active window:

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

What is it you don't understand?

Opt("MouseCoordMode",0) means position 0x0 is the top left corner of the active window,

Opt("MouseCoordMode",1) means position 0x0 is the top left corner of the screen.

Share this post


Link to post
Share on other sites

What is it you don't understand?

Opt("MouseCoordMode",0) means position 0x0 is the top left corner of the active window,

Opt("MouseCoordMode",1) means position 0x0 is the top left corner of the screen.

sorry, I mean 0 and 2

Share this post


Link to post
Share on other sites

I tried 0 and 2 with a active window, but it all goes to the same point

Share this post


Link to post
Share on other sites

Depends on the window you use.

Most windows have a border around it. MouseCoordMode 0 gets the outside of the top left corner of that border, while MouseCoordMode 2 gets the inside of the top left corner. (Or more accurate the top left corner of the functional part of the window)

The difference is usually only 2-5 pixels.

The thickness of the border is affected by the OS and the visual style used, so it's usefull to have a MouseCoordMode that is constant regardless of the thickness of the border.

Share this post


Link to post
Share on other sites

Depends on the window you use.

Most windows have a border around it. MouseCoordMode 0 gets the outside of the top left corner of that border, while MouseCoordMode 2 gets the inside of the top left corner. (Or more accurate the top left corner of the functional part of the window)

The difference is usually only 2-5 pixels.

The thickness of the border is affected by the OS and the visual style used, so it's usefull to have a MouseCoordMode that is constant regardless of the thickness of the border.

Thanks!!

Share this post


Link to post
Share on other sites

Here's an example that demonstrates it clearly:

$PID = Run("NotePad.exe")
$hWnd = WinWait("[CLASS:Notepad]","")
WinActivate($hWnd,"")
WinWaitActive($hWnd,"")

Opt("MouseCoordMode",2)
MouseMove(0,0,1)
Sleep(1000)
Opt("MouseCoordMode",0)
MouseMove(0,0,1)
Sleep(1000)
Opt("MouseCoordMode",2)
MouseMove(0,0,1)
Sleep(1000)
Opt("MouseCoordMode",0)
MouseMove(0,0,1)
Sleep(1000)

ProcessClose($PID)

I din't actually expect it to exlude the menubar as well, but it does.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0