how to check the screen resolution

Ricky D

Well-Known Member
Licensed User
Longtime User
I'd like to know how to tell if the app is running on a 240x320 or a 480x640 vga device. I'd rather not have 2 copies of the same app - that makes it very hard to make changes.

I have a custom SIP (Soft Input Panel) that will show an alphabetic layout on text inputs and a numerical one for numbers. I have fixed it to work either on low res or high res by passing a 0 or 1 in it's New1 method.

any help would be much appreciated.

regards, Ricky
 

agraham

Expert
Licensed User
Longtime User
You could check if Form.Height > 400.
I don't think that works on Forced QVGA apps (which is what he needs it for). It returns the virtual size, not the real size. Alfcen (another user) did a lot of searching but never (as far as I know) came up with a good answer to the problem for a Forced QVGA app. :(
 

agraham

Expert
Licensed User
Longtime User
Perhaps you could do something simple like having a file called, say, VGA.inf in your AppPath if the device is VGA and then test if it is there with FileExists. Another way would be to write your own Registry entry that indicates the Screen size.
 

Ricky D

Well-Known Member
Licensed User
Longtime User
Thanks again

I'll do the vga.inf one. Easier to copy a simple file than mucking around in the registry.

regards, Ricky
 

sitajony

Active Member
Licensed User
Hi, I know it's an old Post but it's possible to get the real screen resolution in C# with Screen.PrimaryScreen.Bounds[.Width/.Height]...
Sorry I was'nt here in 2008 lol
 

sitajony

Active Member
Licensed User
I throught it was not just on B4P but also on C# or other languages sorry...
I know that you know this code with all your librairies and programs ;)
 
Top