SharkyEXE icon

Untitled

SharkyEXE | PRO | 07/17/22 06:06:15 PM UTC (Edited) | 0 ⭐ | 594 👁️ | Never ⏰ | []
AutoIt |

1.37 KB

|

None

|

0 👍

/

0 👎

; 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)
 
 

Comments