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


Chances are you want something like this ...



Run, "C:\Windows\System32\rundll32.exe" shell32`.dll`,Control_RunDLL desk`.cpl
Sleep, 400
Send, !c ; Send Alt+c for deteCt
Sleep, 1000
Send, {Enter} ; Send Enter to close
Return

      

+3


source


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:

enter image description here

+1


source


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


You can turn off the auto-detect feature of your graphics card through advanced display properties or driver management utility. Usually more and more graphics cards send a signal to check if the monitor is closed or not, so they can "turn it off".

0


source


With autohotkey you can use SysGet .

SysGet, monitorCount, MonitorCount

      

There are also many other parameters that you can use. Check the link above.

0


source







All Articles