Script problems when running in many different resolutions

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Nate

Script problems when running in many different resolutions

Post by Nate » Sat Jul 19, 2003 10:47 pm

Hi everyone.

If I have a script that I want many people to be able to use, most of whom all run their windows OS in different resolutions and the actual program the script is written for in many resolutions as well.

Is there any way to make the "move mouse" and "getpixel color" commands as well as any other commands dealing with cordinates universal no matter what windows OS resolution they are in or what resolution their program is run in?

Basically I want my script to work on a machine running in 1024x768x16 with the program at 800x600 just the same as it would run on a machine with a screen resolution at 800x600x16 with the program resolution at whatever.

Or do I have to make sure they run in the windows OS resolution/program resolution I was in when I wrote the script?

Im pretty sure theres no way to make the script work if the machines are running in different color depths, since the colors will no be the same, so thats one thing the script will require
:(

I hope Im making sense, and someone understands what Im trying to say.

Thanks for any help.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sun Jul 20, 2003 2:58 am

Hi Nate,

Please look up MouseMoveRel in your online help. Good luck.

Nate

Post by Nate » Sun Jul 20, 2003 8:30 am

Thank you for the reply, will this work for getting pixel color as well?

Thanks for the help.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Jul 20, 2003 10:25 am

You should avoid using mouse commands for this very reason. Stick to using keyboard shortcuts.
MJT Net Support
[email protected]

Lumumba

Post by Lumumba » Sun Jul 20, 2003 11:53 am

You should be able to detect the currently used resolution from the registry (check MScheds reg read/write commands).

Try to get the used scheme (and it's item settings) via this way as well.

So combined with the supports advise it should be possible to handle such a case ...

Nate

Post by Nate » Sun Jul 20, 2003 7:00 pm

Im not sure I understand what your saying. How would I get pixelcolor using a keyboard command?

Could you possibly give me a small example?

Any plans on adding a "getpixel color relative to window" command?

Thanks

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Mon Jul 21, 2003 12:23 am

Hi Nate,
Usually I use WindowAction>1,WindowTitle to maximize the window of interest so that I can have an accurate position on the screen. However, your app is more complicated thanks to numerous screen resolutions, which will change the readout of cursor/mouse position and pixel color. Both Support and Lumumba offer some viable solutions. Then it come to the ultimate question: What's exactly your objective of retrieving pixel color in all possible screen resolution? In particular, how come the color depth is involved in this case? Please enlighten us. Thanks.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Jul 21, 2003 10:21 am

Hi
Im not sure I understand what your saying. How would I get pixelcolor using a keyboard command?
Clearly you can't do this - I was talking about automating the interface purely with keyboard commands which would make the resolution irrelevent.

If you absolutely do need to look at a specific pixel then I would use GetActiveWindow to retrieve the X,Y coords of the window and then you know the offset position on the screen of the pixel in question. i.e. if the position in the window is 100,200 from the top left corner you can add this to the X,Y returned from GetActiveWindow. Now resolution is not important.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts