Solved

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

Posted on 2015-01-06
4
322 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 12

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 12

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 12

Author Closing Comment

by:ktaczala
ID: 40544005
Found my own answer
0

Featured Post

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Progress
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

628 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