Jump to content

Multi-Head Mousewrap


Recommended Posts

Similar to this:


Adds functionality based on code from Larry;


But able to handle your screen when @desktopwidth et. all don't report the correct dimensions due to having several monitors. I have three, and this works okay for me.

Global Const $SM_XVIRTUALSCREEN = 76
Global Const $SM_YVIRTUALSCREEN = 77
Global Const $SM_VIRTUALWIDTH = 78
Global Const $SM_VIRTUALHEIGHT = 79

$VIRTUALDESKTOPWIDTH = DLLCall("user32.dll","int","GetSystemMetrics","int",$SM_VIRTUALWIDTH)

$VIRTUALDESKTOPHEIGHT = DLLCall("user32.dll","int","GetSystemMetrics","int",$SM_VIRTUALHEIGHT)

$VIRTUALORIGINX = DLLCall("user32.dll","int","GetSystemMetrics","int",$SM_XVIRTUALSCREEN)

$VIRTUALORIGINY = DLLCall("user32.dll","int","GetSystemMetrics","int",$SM_YVIRTUALSCREEN)



while 1
    $pos = MouseGetPos()
    $mousex = $pos[0]
    $mousey = $pos[1]
        case $mousex = $xmin
            mousemove($xmax - 1,$mousey,0)
        case $mousex = $xmax
            mousemove($xmin + 1,$mousey,0)
        case $mousey = $ymin
        case $mousey = $ymax
            mousemove($mousex,$ymin + 1,0)

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

Are they exactly the same resolution? That's how it's designed. I was thinking about being a bit more precise wit it, using WMI to see how big each montitor was, and where it was relative to each other, but I don't really have time at the moment.

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

SO nice to see a method for handling multiple monitor setups! I couldn't figure out how to do this! Now I'll be able to bundle this method into my screensavers and a few of my other scripts...

Thanks! :nuke::):D:lol::idea:

Edit: If you find a way to "be a little more precise" to get reliable FULL desktop information, please post it here. I'll do a little poking myself now that I get the general idea from your script :P

Edited by james3mg
"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
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

  • Recently Browsing   0 members

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