Why does windows 8.1 not show correct screen width & height using VS2013?

I'm trying to display  pictures as a wallpaper with a VB application.  It works fine in Windows 7 no matter what resolution I Select.  However, in windows 8.1 it's not giving me the correct resolution therefore my calculations put the images in all the wrong places.  I've tried SystemInformation.VirtualScreen.Height which should give me the total height of my screens, and SystemInformation.VirtualScreen.Width should give me the total width of my screens.  Total width should be 4800 and total height should be 900. As you can see from the snapshot attached,  I have 3 monitors setup as 1600 x 900, the messagebox shows the values retrieved from the .net framework 4.5 using Screen.AllScreens.GetValue(x).Bounds.ToString.
Notice that the Appearance screen shows 1600 x 900 but the app shows 1280 x 720.  Any Ideas?

P.S. I've also tried workingarea and primaryscreen, same issues.
LVL 13
Who is Participating?
ktaczalaConnect With a Mentor Author Commented:
I figured it out.  For anyone who's interested. If you change the scale in: Personalize > Display > Change the size of all items, to anything but default, you get erroneous width & height.

See screenshot
Bob LearnedCommented:
That is a great question.  

This is how the framework determines working area:

 Public ReadOnly Property WorkingArea As Rectangle
                If (Me.currentDesktopChangedCount <> Screen.DesktopChangedCount) Then
                    Interlocked.Exchange(Me.currentDesktopChangedCount, Screen.DesktopChangedCount)
                    If (Not Screen.multiMonitorSupport OrElse Me.hmonitor = DirectCast(-1163005939, IntPtr)) Then
                        Me.workingArea = SystemInformation.WorkingArea
                        Dim mONITORINFOEX As NativeMethods.MONITORINFOEX = New NativeMethods.MONITORINFOEX()
                        SafeNativeMethods.GetMonitorInfo(New HandleRef(Nothing, Me.hmonitor), mONITORINFOEX)
                        Me.workingArea = Rectangle.FromLTRB(mONITORINFOEX.rcWork.left, mONITORINFOEX.rcWork.top, mONITORINFOEX.rcWork.right, mONITORINFOEX.rcWork.bottom)
                    End If
                End If
                Return Me.workingArea
            End Get
        End Property

Open in new window

We would have to find out if something changed in GetMonitorInfo on Windows 8.1.
ktaczalaAuthor Commented:
The same settings on a windows 7 machine, does not affect the width & height values.  I have found out that they have reversed the way they report the locations of the monitors from top to bottom.  On XP and Windows 7 the location of a monitor above a monitor was actually a negative location value, now in windows 8.1 it seems it's a positive value.
ktaczalaAuthor Commented:
Found my own answer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.