Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Need for stroke " Local $hWnd = _WinAPI_GetDesktopWindow() "
- #include <WinAPISys.au3>
- ; Need for stroke " Local $tPhysicalMonitor = DllStructCreate(_StringRepeat($tag_PHYSICAL_MONITOR, $iNumberMonitor)) "
- #include <String.au3>
- ; Need for stroke " Local $aPos, $aData = _WinAPI_EnumDisplayMonitors() "
- ; Need for stroke " $hMonitor = _WinAPI_MonitorFromWindow($hWnd, $MONITOR_DEFAULTTONEAREST) "
- #include <WinAPIGdi.au3>
- Local $aPos, $aData = _WinAPI_EnumDisplayMonitors()
- Local $hWnd = _WinAPI_GetDesktopWindow()
- $hMonitor = _WinAPI_MonitorFromWindow($hWnd, $MONITOR_DEFAULTTONEAREST)
- Local $aRet = DllCall("Dxva2.dll", "int", "GetNumberOfPhysicalMonitorsFromHMONITOR", "handle", $hMonitor, "int*", 0)
- Local $iNumberMonitor = $aRet[2]
- Const $tag_PHYSICAL_MONITOR = "handle hPhysicalMonitor; wchar strPhysicalMonitorDescription[128];"
- Local $tPhysicalMonitor = DllStructCreate(_StringRepeat($tag_PHYSICAL_MONITOR, $iNumberMonitor))
- $aRet = DllCall("Dxva2.dll", "int", "GetPhysicalMonitorsFromHMONITOR", "handle", $hMonitor, "int", $iNumberMonitor, "struct*", $tPhysicalMonitor)
- ; Off monitor
- $aRet = DllCall("Dxva2.dll", "int", "SetVCPFeature", "handle", $tPhysicalMonitor.hPhysicalMonitor, _
- "byte", 0xD6, "int", 0x04)
- ; On monitor
- DllCall("Dxva2.dll", "int", "SetVCPFeature", "handle", $tPhysicalMonitor.hPhysicalMonitor, _
- "byte", 0xD6, "int", 0x01)
Add Comment
Please, Sign In to add comment