Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now