Jump to content

difference between MouseCoorMode 0 and 1


Recommended Posts

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.

Link to comment
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.

Link to comment
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!!

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...