jftuga Posted September 12, 2006 Share Posted September 12, 2006 (edited) I also attached it (see below the code) so that you can download it. -John PS: Made a small update to fix a problems with laptops. expandcollapse popup; function monitor_resolutions() ; -John Taylor ; Sept-9-2006 ; ; returns an array of monitors with their corresponding resolutions ; array[0][0] contains the number of monitors ; array[1][0] is the width of the 1st monitor ; array[1][1] is the height of the 1st monitor Opt("MustDeclareVars", 1) Func monitor_resolutions() local $wmi_svc, $slots, $monitor local $h, $v local $i local $results[16][2] local $debug = 0 $wmi_svc = ObjGet("winmgmts:\\.\root\CIMV2") if "" == $wmi_svc then if 1 == $debug then MsgBox(0,"WMI Error", "Can connect to WMI service") return -1 endif $slots = $wmi_svc.ExecQuery("SELECT CurrentHorizontalResolution,CurrentVerticalResolution FROM Win32_VideoController", "WQL", (0x10 + 0x20) ) if Not IsObj( $slots ) then if 1 == $debug then MsgBox(0, "WMI Error", "No WMI objects found") return -2 endif ; count the number of monitors and ; iterate through each monitor and populate the $results array $i = 0 for $monitor in $slots $h = int($monitor.CurrentHorizontalResolution) $v = int($monitor.CurrentVerticalResolution) if $h <= 1 or $v <= 1 then ContinueLoop $i += 1 if 1 = $debug then MsgBox(0, "Monitor " & $i, "Resolution : " & $h & "x" & $v) $results[$i][0] = $h $results[$i][1] = $v next $results[0][0] = $i return $results EndFunc ; testing Dim $mon = monitor_resolutions() Dim $j for $j = 1 to $mon[0][0] MsgBox(0, "Monitor " & $j, $mon[$j][0] & "x" & $mon[$j][1]) nextmonitor_resolutions.au3 Edited September 13, 2006 by jftuga Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile Link to comment Share on other sites More sharing options...
lod3n Posted September 15, 2006 Share Posted September 15, 2006 Great! Good work. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now