WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Window Manipulation

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

WinPlace on High Resolution Monitor

 Keywords:  WinPlace High Resolution Wide 16:9 Screen Aspect Ratio Monitor Screen Coordinates

Question:

I have a program that will open up 4 VNC windows and place them in the upper left hand, upper right hand, lower left hand and lower right hand corners to take up the entire screen.

This works fine on a "normal" 1024x768 monitor. They put in a monitor that is 1920 x 1080 so the user can see more of the VNC windows and I end up with 2 windows in the top middle of the screen overlapped and 2 windows in the bottom middle of the screen overlapped.

What is up with that?

My 4 commands are:

WinPlace(0, 0, 500, 500, pname)
WinPlace(500, 0, 1000, 500, pname)
WinPlace(0, 500, 500, 1000, pname)
WinPlace(500, 500, 1000, 1000, pname)
pname is the partial name of the VNC window.

Why does it act differently on a wide screen monitor?

Answer:

You do loose a bit of precision on high pixel count monitors because WinBatch virtual screen coordinates units are bigger than pixels at 1920 x 1080 but that normally isn't an issue and it doesn't cause the function to have the problem you describe with 16:9 aspect ratio monitors.

Taking your example and modifying it to position four instances of Notepad, it will position all 4 windows in the appropriate quadrants of the screen without overlap on a desktop displayed on a 1920 X 1080 monitor.

Run("notepad.exe","")
pname = "~Notepad"
WinPlace(0, 0, 500, 500, pname)
Run("notepad.exe","")
WinPlace(500, 0, 1000, 500, pname)
Run("notepad.exe","")
WinPlace(0, 500, 500, 1000, pname)
Run("notepad.exe","")
WinPlace(500, 500, 1000, 1000, pname)
I am not sure what is causing your problem but I don't believe it is caused solely by the aspect ration of your monitor.
Article ID:   W18462
Filename:   WinPlace on High Resolution Monitor.txt
File Created: 2012:09:14:07:50:46
Last Updated: 2012:09:14:07:50:46