Advertisement
djvj

monitor test script

Jan 19th, 2016
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. #Include, %A_ScriptDir%\Module Extensions\CLR_L.ahk
  2. #Include, %A_ScriptDir%\Lib\RL.ahk
  3. moduleExtensionsPath := A_ScriptDir . "\Module Extensions"
  4.  
  5. rocketLauncherDllFile := moduleExtensionsPath . "\RocketLauncher.dll"
  6. RLObject := RL_start(rocketLauncherDllFile)
  7. monitorTable := BuildMonitorObject()
  8. Loop % monitorTable.MaxIndex()
  9. {
  10. msgbox % "monitorTable.PrimaryMonitor: " . monitorTable.PrimaryMonitor . "`nmonitorTable.Number: " . monitorTable[A_Index].Number . "`nmonitorTable.Name: " . monitorTable[A_Index].Name . "`nmonitorTable.Orientation: " . monitorTable[A_Index].Orientation . "`nmonitorTable.Left: " . monitorTable[A_Index].Left . "`nmonitorTable.Right: " . monitorTable[A_Index].Right . "`nmonitorTable.Top: " . monitorTable[A_Index].Top . "`nmonitorTable.Bottom: " . monitorTable[A_Index].Bottom . "`nmonitorTable.Width: " . monitorTable[A_Index].Width . "`nmonitorTable.Height: " . monitorTable[A_Index].Height . "`nmonitorTable.WorkingWidth: " . monitorTable[A_Index].WorkingWidth . "`nmonitorTable.WorkingHeight: " . monitorTable[A_Index].WorkingHeight
  11. }
  12.  
  13. exitapp
  14.  
  15. BuildMonitorObject() {
  16. Global RLObject,primMonitor
  17. obj := Object()
  18. monOrientation := Object(0,"Landscape",1,"Portrait",2,"Landscape (Flipped)",3,"Portrait (Flipped)")
  19. getDisplaySettingsObj := Object(1,"Width",2,"Height",3,"BitDepth",4,"Frequency",5,"Orientation")
  20. SysGet, MonitorCount, 80
  21. SysGet, primMonitor, MonitorPrimary
  22. obj.PrimaryMonitor := primMonitor
  23. Loop, %MonitorCount%
  24. {
  25. SysGet, MonitorName, MonitorName, %A_Index%
  26. SysGet, Monitor, Monitor, %A_Index%
  27. SysGet, MonitorWorkArea, MonitorWorkArea, %A_Index%
  28. currentobj:={}
  29. currentobj.Number := A_Index
  30. currentobj.Name := MonitorName
  31. monDetails := RL_getDisplaySettings(MonitorName)
  32. Loop, Parse, monDetails, |
  33. currentObj[getDisplaySettingsObj[A_Index]] := A_LoopField
  34. currentobj.Orientation := monOrientation[currentobj.Orientation]
  35. currentobj.Left := MonitorLeft
  36. currentobj.Right := MonitorRight
  37. currentobj.Top := MonitorTop
  38. currentobj.Bottom := MonitorBottom
  39. currentobj.WorkingWidth := MonitorWorkAreaRight - MonitorWorkAreaLeft
  40. currentobj.WorkingHeight := MonitorWorkAreaBottom - MonitorWorkAreaTop
  41. obj.Insert(currentobj["Number"], currentobj)
  42. }
  43. Return obj
  44. }
  45.  
  46. ScriptError(txt) {
  47. msgbox % txt
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement