SharkyEXE

Untitled

Jul 17th, 2022 (edited)
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.37 KB | None | 0 0
  1. ; Need for stroke " Local $hWnd = _WinAPI_GetDesktopWindow() "
  2. #include <WinAPISys.au3>
  3.  
  4. ; Need for stroke " Local $tPhysicalMonitor = DllStructCreate(_StringRepeat($tag_PHYSICAL_MONITOR, $iNumberMonitor)) "
  5. #include <String.au3>
  6.  
  7. ; Need for stroke " Local $aPos, $aData = _WinAPI_EnumDisplayMonitors() "
  8. ; Need for stroke " $hMonitor = _WinAPI_MonitorFromWindow($hWnd, $MONITOR_DEFAULTTONEAREST) "
  9. #include <WinAPIGdi.au3>
  10.  
  11. Local $aPos, $aData = _WinAPI_EnumDisplayMonitors()
  12.  
  13. Local $hWnd = _WinAPI_GetDesktopWindow()
  14. $hMonitor = _WinAPI_MonitorFromWindow($hWnd, $MONITOR_DEFAULTTONEAREST)
  15.  
  16. Local $aRet = DllCall("Dxva2.dll", "int", "GetNumberOfPhysicalMonitorsFromHMONITOR", "handle", $hMonitor, "int*", 0)
  17. Local $iNumberMonitor = $aRet[2]
  18. Const $tag_PHYSICAL_MONITOR = "handle hPhysicalMonitor; wchar strPhysicalMonitorDescription[128];"
  19. Local $tPhysicalMonitor = DllStructCreate(_StringRepeat($tag_PHYSICAL_MONITOR, $iNumberMonitor))
  20. $aRet = DllCall("Dxva2.dll", "int", "GetPhysicalMonitorsFromHMONITOR", "handle", $hMonitor, "int", $iNumberMonitor, "struct*", $tPhysicalMonitor)
  21.  
  22. ; Off monitor
  23.  
  24. $aRet = DllCall("Dxva2.dll", "int", "SetVCPFeature", "handle", $tPhysicalMonitor.hPhysicalMonitor, _
  25.   "byte", 0xD6, "int", 0x04)
  26.  
  27. ; On monitor
  28.  
  29. DllCall("Dxva2.dll", "int", "SetVCPFeature", "handle", $tPhysicalMonitor.hPhysicalMonitor, _
  30.   "byte", 0xD6, "int", 0x01)
  31.  
  32.  
Add Comment
Please, Sign In to add comment