Search the Community

Showing results for tags 'Monitor Resolution'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Chat
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 1 result

  1. A Simple function to get information of all the monitors such as the Name, Monitor Type, Manufacturer, Resolution and more. #cs FUNCTION ==================================================================================================================== Name...........: _Get_MonitorsInformation Description....: Gets details of all the Displays. Syntax.........: _Get_MonitorsInformation() Parameters.....: None Return values..: The array returned is 8 dimensional and is made up as follows: Success ====> $array[0][0] = The number of displays on the computer $array[0][1] = The Error code returned by WMIService Object $array[1][0] = Name $array[1][1] = Monitor Type $array[1][2] = Manfucturer $array[1][3] = DPI X $array[1][4] = DPI Y $array[1][5] = Screen Width $array[1][6] = Screen Height $array[1][7] = Display Type Failure ====> $array[0][0] = 0 $array[0][1] = The Error code returned by WMIService Object Author.........: Antonio Do Rosario (Aipion) Remarks........: Works with Windows 2000, 2003, XP, Vista and 7 Example........: Yes #ce=============================================================================================================================== Func _Get_MonitorsInformation() Local $objWMIService ; As Object Local $colItems ; As Object Local $objItem ; As Object Local $DisplaysArray[1][8] Local $objWMIService = ObjGet("winmgmts:.rootcimv2") $DisplaysArray[0][1] = Hex(@error, 8) If @error Then ;Error Getting an active WMIService Object. $DisplaysArray[0][0] = 0 Return $DisplaysArray EndIf $colItems = $objWMIService.ExecQuery("Select * From Win32_DesktopMonitor") For $objItem In $colItems $DisplaysArray[0][0] += 1 ReDim $DisplaysArray[$DisplaysArray[0][0]+1][8] $DisplaysArray[$DisplaysArray[0][0]][0] = $objItem.Name ;Name $DisplaysArray[$DisplaysArray[0][0]][1] = $objItem.MonitorType ;Monitor Type $DisplaysArray[$DisplaysArray[0][0]][2] = $objItem.MonitorManufacturer ;Manfucturer $DisplaysArray[$DisplaysArray[0][0]][3] = $objItem.PixelsPerXLogicalInch ;DPI X $DisplaysArray[$DisplaysArray[0][0]][4] = $objItem.PixelsPerYLogicalInch ;DPI Y $DisplaysArray[$DisplaysArray[0][0]][5] = $objItem.ScreenWidth ;Screen Width $DisplaysArray[$DisplaysArray[0][0]][6] = $objItem.ScreenHeight ;Screen Height ;Display Type Switch $objItem.DisplayType Case 0 $DisplaysArray[$DisplaysArray[0][0]][7] = "Unknown" Case 1 $DisplaysArray[$DisplaysArray[0][0]][7] = "Other" Case 2 $DisplaysArray[$DisplaysArray[0][0]][7] = "MultiScan Color" Case 3 $DisplaysArray[$DisplaysArray[0][0]][7] = "MultiScan Monochrome" Case 4 $DisplaysArray[$DisplaysArray[0][0]][7] = "Fixed Frequency Color" Case 5 $DisplaysArray[$DisplaysArray[0][0]][7] = "Fixed Frequency Monochrome" Case Else $DisplaysArray[$DisplaysArray[0][0]][7] = "Unknown" EndSwitch Next Return $DisplaysArray EndFunc Example of Use: #include <Array.au3> $GetMonArray = _Get_MonitorsInformation() _ArrayDisplay($GetMonArray) #cs FUNCTION ==================================================================================================================== Name...........: _Get_MonitorsInformation Description....: Gets details of all the Displays. Syntax.........: _Get_MonitorsInformation() Parameters.....: None Return values..: The array returned is 8 dimensional and is made up as follows: Success ====> $array[0][0] = The number of displays on the computer $array[0][1] = The Error code returned by WMIService Object $array[1][0] = Name $array[1][1] = Monitor Type $array[1][2] = Manfucturer $array[1][3] = DPI X $array[1][4] = DPI Y $array[1][5] = Screen Width $array[1][6] = Screen Height $array[1][7] = Display Type Failure ====> $array[0][0] = 0 $array[0][1] = The Error code returned by WMIService Object Author.........: Antonio Do Rosario (Aipion) Remarks........: Works with Windows 2000, 2003, XP, Vista and 7 Example........: Yes #ce===============================================================================================================================Func _Get_MonitorsInformation() Local $objWMIService ; As Object Local $colItems ; As Object Local $objItem ; As Object Local $DisplaysArray[1][8] Local $objWMIService = ObjGet("winmgmts:.rootcimv2") $DisplaysArray[0][1] = Hex(@error, 8) If @error Then ;Error Getting an active WMIService Object. $DisplaysArray[0][0] = 0 Return $DisplaysArray EndIf $colItems = $objWMIService.ExecQuery("Select * From Win32_DesktopMonitor") For $objItem In $colItems $DisplaysArray[0][0] += 1 ReDim $DisplaysArray[$DisplaysArray[0][0]+1][8] $DisplaysArray[$DisplaysArray[0][0]][0] = $objItem.Name ;Name $DisplaysArray[$DisplaysArray[0][0]][1] = $objItem.MonitorType ;Monitor Type $DisplaysArray[$DisplaysArray[0][0]][2] = $objItem.MonitorManufacturer ;Manfucturer $DisplaysArray[$DisplaysArray[0][0]][3] = $objItem.PixelsPerXLogicalInch ;DPI X $DisplaysArray[$DisplaysArray[0][0]][4] = $objItem.PixelsPerYLogicalInch ;DPI Y $DisplaysArray[$DisplaysArray[0][0]][5] = $objItem.ScreenWidth ;Screen Width $DisplaysArray[$DisplaysArray[0][0]][6] = $objItem.ScreenHeight ;Screen Height ;Display Type Switch $objItem.DisplayType Case 0 $DisplaysArray[$DisplaysArray[0][0]][7] = "Unknown" Case 1 $DisplaysArray[$DisplaysArray[0][0]][7] = "Other" Case 2 $DisplaysArray[$DisplaysArray[0][0]][7] = "MultiScan Color" Case 3 $DisplaysArray[$DisplaysArray[0][0]][7] = "MultiScan Monochrome" Case 4 $DisplaysArray[$DisplaysArray[0][0]][7] = "Fixed Frequency Color" Case 5 $DisplaysArray[$DisplaysArray[0][0]][7] = "Fixed Frequency Monochrome" Case Else $DisplaysArray[$DisplaysArray[0][0]][7] = "Unknown" EndSwitch Next Return $DisplaysArray EndFunc