Jump to content

Get resolution of 2nd or 3rd monitor


Recommended Posts

How would I go about fetching the resolution of a 2nd or 3rd monitor?

Is there a specific function for this?

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

might give you an insight into how to achieve this.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Use this Function that I created to get information on all the displays.

; #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 MIService 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 MIService Object
; Author.........: Antonio Do Rosario (Aipion)
; Remarks........: Works with Windows 2000, 2003, XP, Vista and 7
; Example........: No
; ===============================================================================================================================
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   ;Manufacturer
   $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
Edited by Guest
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...