Example scripts and tips (replaces Old Scripts & Tips archive)
Moderators: Dorian (MJT support), JRL, Phil Pendlebury
-
Grovkillen
- Automation Wizard
- Posts: 830
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Hudiksvall, Sweden
-
Contact:
Post
by Grovkillen » Fri Oct 01, 2021 8:00 am
I manage to get the number of screens and the "virtual screen" which is the rectangle which all displays are placed within. I now only need to know where the each display's viewing rectangle within this virtual screen.
Code: Select all
LibFunc>user32,GetSystemMetrics,VIRTUAL_SCREEN_x,76
LibFunc>user32,GetSystemMetrics,VIRTUAL_SCREEN_y,77
LibFunc>user32,GetSystemMetrics,VIRTUAL_SCREEN_w,78
LibFunc>user32,GetSystemMetrics,VIRTUAL_SCREEN_h,79
LibFunc>user32,GetSystemMetrics,MONITOR_count,80
MDL>%MONITOR_count%%CRLF%%VIRTUAL_SCREEN_x%%CRLF%%VIRTUAL_SCREEN_y%%CRLF%%VIRTUAL_SCREEN_w%%CRLF%%VIRTUAL_SCREEN_h%
This one seems to have it but I have yet to found out how.
https://docs.microsoft.com/en-us/window ... onitorinfo
-
Grovkillen
- Automation Wizard
- Posts: 830
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Hudiksvall, Sweden
-
Contact:
Post
by Grovkillen » Fri Mar 17, 2023 6:39 am
This is how Windows is seeing the virtual screen.
https://learn.microsoft.com/en-us/windo ... ual-screen
But today we only know the max and min (
purple arrows) related to the 0,0 point (
green arrow) which is the top left corner of the primary display. In order to know the visible areas + which display a visible area is attached to I would need to know these points shown in the image below (
red arrows):
I have yet to stumble over an API call to retrieve this. If anyone knows please step into the light.