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
Solved

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

Posted on 2015-01-06
4
303 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 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Infrastructure development vs software development 3 60
collection output issue 9 36
Why use this lambda? 12 33
batch file or script 4 24
This is about my first experience with programming Arduino.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

839 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