[SOLVED] Get screen resolution of SECONDARY monitor?

Get help with using AutoHotkey and its commands and hotkeys
Posts: 1
Joined: 20 Oct 2019, 09:29

[SOLVED] Get screen resolution of SECONDARY monitor?

20 Oct 2019, 09:48

I'm using RocketLauncher as an interlayer for launching my emulators, it uses AHK scripts for customization to achieve a seamless integration.

My PC is connected to a CRT television and I'm trying to extend a script to display the emulator on either my primary screen or the CRT as a secondary screen if the CRT is turned on.
The problem is I can't just force the emulator to be displayed on a certain screen, it needs a few settings activated to be displayed on the CRT, for that the script has to do the following:

- check if there is more than one screen connected (which works fine with MonitorCount)
- if there is more than one monitor get the second monitors resolution
- IF the resolution has a height of 240 pixels, then I need to load an additional config via parameters

This would be no problem if it wasn't for the missing command to get the resolution of a monitor other than the primary one. MonitorWorkArea is useless for getting the screens resolution.
Is there any solution for this?

Edit: Alright, simple maths, should've just turned on my brain first:

Code: Select all

SysGet, Monitor, Monitor, %A_Index%
MonitorLeftNegated := MonitorLeft * -1
MonitorTopNegated := MonitorTop * -1
ScreenWidth := MonitorLeftNegated + MonitorRight
ScreenHeight := MonitorTopNegated + MonitorBottom

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boiler, dwaynek, lhurtado, MonuKashyap, Smile_, WeThotUWasAToad and 71 guests