Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2015-01-06
4
Medium Priority
?
342 Views
Last Modified: 2015-01-12
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.
ScreenCapture.jpg
0
Comment
Question by:ktaczala
  • 3
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40535798
That is a great question.  

This is how the framework determines working area:

 Public ReadOnly Property WorkingArea As Rectangle
            Get
                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
                    Else
                        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.
0
 
LVL 13

Accepted Solution

by:
ktaczala earned 0 total points
ID: 40535824
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
ScreenCapture.jpg
0
 
LVL 13

Author Comment

by:ktaczala
ID: 40535912
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.
0
 
LVL 13

Author Closing Comment

by:ktaczala
ID: 40544005
Found my own answer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Screencast - Getting to Know the Pipeline

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question