Jump to content

Dual Monitors and MouseClick


Recommended Posts

I'm running on Dual monitors, and right clicking on a win task bar button. This opens a Context menu, which sometimes is one pixel into the second monitor. It appears, when that is the case, the mouseclick command takes the second monitor as the primary one, and the clicks happen there (correct postion, wrong monitor). I'm attempting to click on the context menu it's self.

I'm using ControlGetPos, then feeding that as absolute x/y into mouseclick.

Any ideas how to correct this? I'm about to switch over to an object based function...this is relativly old script that has not failed in the past.

I'd put in the code, but it's very basic, and without MagicDisk and two monitors, you wouldn't be able to replicate anyways.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Hey JDelaney,

I usually create a small utility to indicate the mouse x/y, and I take pseudo-code notes while hovering over the areas i want to click on.

While 1
  ToolTip( MouseGetPos(0) & " : " & MouseGetPos(1) )
  sleep(100)
WEnd

When creating the pseudo-code, I often follow a system that allows me to easily replace text afterwards with actual autoit code.

For example, I'd start hovering over the target areas and then write

; Click at 400, 900 - ;Click on text field

; Type "Hello" - ;Type in hello in the field

; Click at 450, 1200 - ;Click on ok button

Once i'm done, i can then use the replace function to replace "; Click at" with "Mouseclick("left", " and "; Type " with "Send(" and then " - ;" with ")".

Hope this helps ;)

Link to comment
Share on other sites

Thanks, Shawn, but it's not the concepts I'm having difficulty with.

The X/Y coords are perfect, they show the bottom right of monitor one...so even though monitor two, to have the same 'relative' position, would be X + something like 3000, the script still clicks incorrectly, because the second is being considered the 'primary' monitor (for whatever reason, that is the question i'm attempting to get answered), the script clicks at the correct coords, but wrong monitor.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...