I have written what I thought was a way to determine display orientation. It seemed to work until I ran it on a machine with a portrait orientation and it returned landscape. I'm using the Win32__DesktopMonitor object however, changes to the orientation will still result in a landscape orientation according to the object. Is there another object that may be more fitting or some clever/alternate code I could include? Any suggestions are appriated
-Geates
"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom
"I do not offer answers, only considerations."
- Geates's Disclaimer
Code:
function getDisplayOrientation(strComputer)
set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colItems = objWMIService.ExecQuery("Select * from Win32_DesktopMonitor",,0)
for each objItem In colItems
intWidth = objItem.ScreenWidth
intHeight = objItem.ScreenHeight
next
if (intWidth < intHeight) then msgbox "portrait"
if (intWidth > intHeight) then msgbox "landscape"
end function
-Geates
"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom
"I do not offer answers, only considerations."
- Geates's Disclaimer