Detect monitor in windows 7?
Is it possible to force Windows 7 to detect a monitor using autohotkey?
I mean, it's like going through the control panel, displaying, discovering the monitor.
If my computer has ever been idle, it will lose HDTV. If I'm at the top, I just browse the dashboard and find it again. This solves the problem, however, I want to use autohotkey so that I can re-detect using my living room remote.
Thanks in advance for any help.
John
+3
source to share
5 answers
This is a modified example from the SysGet Documentation.
SysGet, MouseButtonCount, 43
SysGet, VirtualScreenWidth, 78
SysGet, VirtualScreenHeight, 79
SysGet, MonitorCount, MonitorCount
SysGet, MonitorPrimary, MonitorPrimary
Message .= "Monitor Count:`t" MonitorCount "`nPrimary Monitor:`t" MonitorPrimary
Loop, %MonitorCount%
{
SysGet, MonitorName, MonitorName, %A_Index%
SysGet, Monitor, Monitor, %A_Index%
SysGet, MonitorWorkArea, MonitorWorkArea, %A_Index%
Message .= "`n`nMonitor:`t#" A_Index "`nName:`t" MonitorName "`nLeft:`t" MonitorLeft "(" MonitorWorkAreaLeft " work)`nTop:`t" MonitorTop " (" MonitorWorkAreaTop " work)`nRight:`t" MonitorRight " (" MonitorWorkAreaRight " work)`nBottom:`t" MonitorBottom "(" MonitorWorkAreaBottom " work)"
}
msgbox % Message
Output example:
+1
source to share
Robert, thanks for the reply (I cannot comment on your post directly). I cleaned up the code a bit and helped it work with other languages:
HOTKEY::
Run, "C:\Windows\System32\rundll32.exe" shell32`.dll`,Control_RunDLL desk`.cpl
WinWaitActive, ahk_class CabinetWClass
SendInput, +{Tab 2}{Space}{Enter} ;Select & press "Detect" button, then press "OK" button
Return
+1
source to share