Jump to content

Recommended Posts

Posted (edited)

Pixelsearch is one oft the worst and unsafest ways to automate a application. There are much better ways for automation, so please: tell the name of the apllication you want to automate for finding a good solution.

Edited by AutoBert
Posted (edited)

im trying to automate google chrome with two displays. using controlsend in inactive window any suggestions?

Edited by christian11
Posted

Don't use 0 as your left and top values as these numbers can be negative if your secondary monitor is positioned above or to the left of your main monitor. Might be why it's not working for you.

 

 

Posted (edited)
On 5/29/2016 at 5:34 PM, christian11 said:

so it would be 

green=PixelSearch(-1, -1, @DesktopWidth, @DesktopHeight, 0x00FF00)

is it correct??

No. As an example, let's say your monitor setup is the following:

Monitor 1 (main) has a resolution of 1920x1080. This monitor is to the right of Monitor 2

Monitor 2 (secondary) has a resolution of 1024x768. This monitor is to the left of Monitor 1.

 

The top left pixel of the monitor 1 is 0x0.

The top right pixel of the monitor 1 is 1920x0.

The center pixel of monitor 1 is 960x540.

The bottom left pixel of the monitor 1 is 0x1080.

The bottom right pixel of the monitor 1 is 1920x1080.

 

The top left pixel of the monitor 2 is -1024x0.

The top right pixel of the monitor 2 is -1x0.

The center pixel of monitor 2 is -512x384.

The bottom left pixel of the monitor 2 is -1024x768.

The bottom right pixel of the monitor 2 is -1x768.

 

Try to think of it like plotting boxes on a horizontally (x) inverted axis graph. Right is +x, Down is +y, Left is -x, and Up is -y.

If you are unsure as where your monitors are positioned, refer to Control Panel's Display Resolution page. 

"Control Panel\All Control Panel Items\Display\Screen Resolution"

 

Edited by BetaLeaf
Fixed coordinates.

 

 

Posted

Because we are stuborn haha :P. The op asked for help in pixelsearch so help in pixelsearch I gave. Yea pixelsearch is bad in most cases but sometimes it's the only option that works. It's all case by case.

 

 

Posted
5 hours ago, Bert said:

in this case it is NOT the only option that works.

Look man I'm just trying to help. We don't know what the op is even trying to do, we haven't seen the full code. How can you be so sure stuff doesn't work when you don't know what the op is trying to do. For all we know, he might be trying to automate a Java based speed test. We just don't know so don't be so sure. Everything is case by case, some stuff works, others dont. Sorry if you don't like my opinion.

 

 

Posted
2 hours ago, BetaLeaf said:

Look man I'm just trying to help. We don't know what the op is even trying to do, we haven't seen the full code.

We don't know what op trying to do in case of he's not saying exactly what he want to do and isn't anwering:

 

21 hours ago, Bert said:

please post your code

and when a MVP ask, it's usual noone give further support until question is answered.

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...