Wrong DesktopWidth ()/DesktopHeight () returns

Just starting out? Need help? Post your questions and find answers here.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Wrong DesktopWidth ()/DesktopHeight () returns

Post by es_91 »

Last edited by es_91 on Tue Oct 28, 2014 10:49 am, edited 1 time in total.
:mrgreen:
Fred
Administrator
Administrator
Posts: 18249
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by Fred »

We use regular API command, so it's probably a VMWare issue. We don't support report in virtual machines, as it's just emulation and it can have its own flaws.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by es_91 »

Okay, thanks. Sad. :(
:mrgreen:
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by RASHAD »

Switch VMware display mode to Full Screen and you will get the right answer
Egypt my love
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by blueznl »

Try a different VM (VirtualBox or whatever) to verify that it is VMware and not your own code. If it is not your own code report the bug to the manufacturer of VMware.

I just verified and I have NO issue on VirtualBox.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by Alex777 »

As I said in the other thread, I have checked and have no such issue with VMware Player.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by es_91 »

I can not double check the error in my personal pc at home, but i found another anomaly:

When a program is executed in compatibility mode with a resolution of 640x480, the screen is practically set to 640x480, but DesktopWidth() and DesktopHeight() return both the value of the before-set screen resolution (e.g. 800x600).

Should that be wrong?
:mrgreen:
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by PB »

> When a program is executed in compatibility mode [...]

Do you mean in VMware, or on a real PC?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by es_91 »

I mean, on a real PC.

I can also use the Windows' ability to select smaller resolutions than 800x600 ONCE the compatibility mode-program has started (before the smaller resolutions should not be visible in your Display Settings) and it ALSO is not recognized in PureBasic's DesktopWidth() and DesktopHeight() functions (those still Show 800x600 or higher).

... Fred? :)
:mrgreen:
Fred
Administrator
Administrator
Posts: 18249
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by Fred »

As previously said, we use standard Windows function for this: EnumDisplaySettings_(). Feel free to toy with it and if you find something odd, please post it ;).
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by es_91 »

Hi, Fred. Nice, that you take care of this. ;)

I toyed around with the EnumDisplaySettings_ () function, as you said, and i found that the values returned by it are correct, even when the compatibility mode with less than 800x600 Pixels is on.

Please see the following screen:

Image

Notice that the image's resolution is 640x480, so the first two values are correct, PureBasic's functions return wrong.
:mrgreen:
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by es_91 »

Oh, I am facing a different kind of problem here. It seems on the network PC I am on the DesktopWidth() and DesktopHeight() values are always 800x600, no matter what resolution i set up in the Display Settings.

Again, we're not working with VMware anymore, here!

What the heck is this?
:mrgreen:
Fred
Administrator
Administrator
Posts: 18249
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by Fred »

Did you use ExamineDesktop() before DesktopWidth/Height() ?
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by es_91 »

Sure.
Last edited by es_91 on Thu Oct 23, 2014 6:14 am, edited 1 time in total.
:mrgreen:
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: [Bug] Wrong DesktopWidth/DesktopHeight() returns in VMwa

Post by es_91 »

I found the mistake. :)

My PC has two desktops:

Code: Select all

Debug ExamineDesktops ()
PB Debugger wrote:2
The #Null desktop was not the visible one. I do not know why my PC has two desktops, it must have something to do with the fact that it's a controlled network PC, propably a MasterEye problem or whatever. Because strangely the Display Settings show only one display/desktop (see below).

Code: Select all

Debug DesktopName (#Null)
PB Debugger wrote:\\.\DISPLAYV4
System Setting's desktop drop-down menu wrote:PLE481
:mrgreen:
Post Reply