how to check the screen resolution

Discussion in 'Questions (Windows Mobile)' started by Ricky D, Nov 3, 2008.

  1. Ricky D

    Ricky D Well-Known Member Licensed 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
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You could check if Form.Height > 400.
     
  3. agraham

    agraham Expert Licensed User

    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. :(
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You are right. As far as I know it is impossible to know the device real screen resolution with a Forced QVGA app.
     
  5. agraham

    agraham Expert Licensed 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.
     
  6. Ricky D

    Ricky D Well-Known Member Licensed User

    Thanks again

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

    regards, Ricky
     
  7. sitajony

    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
     
  8. agraham

    agraham Expert Licensed User

    Do you really think that Erel and I don't know that! We were discussing ways available to Basic4ppc code, not C#.
     
    Last edited: May 24, 2010
  9. sitajony

    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 ;)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice