Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


How to obatin screen size and o/s info?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-15-2008, 02:12 PM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default How to obatin screen size and o/s info?

Hi Gang,

Two issues:

1. Suppose you have an application compiled without optimization.
Form1.Width shows 240 on both QVGA and VGA devices, on the
latter because pixel doubling is performed.
Is anyone aware of a method to determine the true native screen
size without crawling in the registry and additional library?

2. Has anyone come across a method of reading the operating
system version (PPC 2003/WM5/WM6) in the registry of a device?

Both items could eventually be added to a wishlist for an updated
hardware.dll.

Thanks and cheers
Robert
Reply With Quote
  #2 (permalink)  
Old 03-16-2008, 09:28 AM
brathbone's Avatar
Junior Member
 
Join Date: Feb 2008
Location: Rutherfordton, North Carolina
Posts: 19
Send a message via MSN to brathbone
Default

Hi Robert,

I was wanting this functionality as well. It seemed like a good time to create my first library, and here it is

The zip file includes the dll, a B4PPC test project, and the VB.NET source.

bDeviceInfo.GetOSVersionString returns the OS name and version number as a string. Let me know if you need to get access to just the version as integer; it would not be hard to add.


bDeviceInfo.GetDisplayWidth returns screen width as integer
bDeviceInfo.GetDisplayheight returns screen height as integer

Let me know what you think of this.

Best wishes,
Attached Files
File Type: zip bDeviceInfo.zip (14.2 KB, 35 views)
__________________
Brian Rathbone

Laptop: AMD Turion 64 Mobile 2ghz, 2GB RAM, Dual GeForce Go 7900 GTX 768MB SLI, Dual 200GB HDD at RAID0. XP Pro sp2

Device: Treo 750, WM6, 300mhz,128MB RAM, 2GB miniSD, 240x240 display
Reply With Quote
  #3 (permalink)  
Old 03-16-2008, 11:41 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Brian,

I'm speechless, a library in response.

The device, an iPAQ hx210 comes up with these responses:

GetOSVersionString: Microsoft Windows CE 5.2.1711.
It is supposed to be WM 6, but I assume that is Microsoft's
nomenclature for WM6(?)

GetDisplayWidth/Height: In an application compiled w/o optimization
the result is 240x320 (the form dims), although the physical resolution
is VGA. Is there any means of quering the LCD dimensions?

Anyway, your approch is awesome. Thanks so much!

Robert
Reply With Quote
  #4 (permalink)  
Old 03-16-2008, 09:04 PM
brathbone's Avatar
Junior Member
 
Join Date: Feb 2008
Location: Rutherfordton, North Carolina
Posts: 19
Send a message via MSN to brathbone
Default

Hi Robert,

I was hoping for better results with the screen size, but I'll see if I can find another way to get the actual screen size.

Regarding the OS Version, I found this list on MSDN:

Platform Release Windows CE kernel version
Windows Mobile 6 5.2
Wndows Mobile 5.0 5.1
Windows Mobile 2003 SE 4.21

I think I will add access to MajorVersion and MinorVersion from the library, that way you can detect the OS version without having to parse the OS Version string. That way we can say if MajorVersion = 5 and MinorVersion = 2 then we are on WM6

I'll probably get a chance to look at this later tonight. Until then . . .

All the best,
__________________
Brian Rathbone

Laptop: AMD Turion 64 Mobile 2ghz, 2GB RAM, Dual GeForce Go 7900 GTX 768MB SLI, Dual 200GB HDD at RAID0. XP Pro sp2

Device: Treo 750, WM6, 300mhz,128MB RAM, 2GB miniSD, 240x240 display
Reply With Quote
  #5 (permalink)  
Old 03-17-2008, 03:10 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Brian,

I thought it might be difficult to retrieve LCD pixel array dimensions.
Unfortunately, I can't assist without having VS, but I feel you are
on the right way towards a solution

Regarding the o/s version, I believe your current method is great.
Parsing is no big issue, it is as simple as this:

If StrIndexOf(bDeviceInfo.GetOSVersionString,"5.2",0) > -1 Then WM6

Perhaps something like bDeviceInfo.GetOSVersionCode which returns
0, 1 or 2, respectively, would be nice but only if it is not too much
trouble.

Thank you so much!
Robert
Reply With Quote
  #6 (permalink)  
Old 04-11-2008, 04:47 PM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

Hello Brian

Your dll is just what I need - and it works a treat ...

Am I OK to use in my freeware game I am making? (Its goind to be released in May ...)

I will whack you in my credits also if its OK with you.

Many thanks

Steve
Reply With Quote
  #7 (permalink)  
Old 04-12-2008, 05:17 AM
brathbone's Avatar
Junior Member
 
Join Date: Feb 2008
Location: Rutherfordton, North Carolina
Posts: 19
Send a message via MSN to brathbone
Default

Hi Steve,

Thanks for checking, but you can use the dll and source in any way you like. As far as I'm concerned, it's in the public domain. Just a little gift to the community.

I wouldn't object to the credit, just don't feel obligated in any way .

I'd still like to figure out Robert's VGA question and post a new version, but my workload has been a bit overwhelming lately. Hopefully I'll get back to it soon.

Anyway . . . I'm glad you found it helpful.

All the best,

Brian

P.S. good luck with the game, I look forward to checking it out.
__________________
Brian Rathbone

Laptop: AMD Turion 64 Mobile 2ghz, 2GB RAM, Dual GeForce Go 7900 GTX 768MB SLI, Dual 200GB HDD at RAID0. XP Pro sp2

Device: Treo 750, WM6, 300mhz,128MB RAM, 2GB miniSD, 240x240 display
Reply With Quote
  #8 (permalink)  
Old 04-12-2008, 09:29 AM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

Thanks Brian.

Alfcen, referring to your earlier pseudocode, in the interim, perhaps also put a space character preceding the 5.2 as follows:

Quote:
If StrIndexOf(bDeviceInfo.GetOSVersionString," 5.2",0) > -1 Then ...
This may help cater for any misinterpretation of a possible future version of WM6 which may be called for example "Windows Mobile Version 6.5.2"

An interesting link for win pda versions can be found at

http://www.pocketpcfaq.com/wce/versions.htm

and ...

http://pocketpccentral.net/help/which_version_wm.htm

I have access to VS.NET at work. When I have time I really must take a look at it ... I think this is my next step forward in programming ... we've had it for a couple of years now but been tied up at work with introducing HP Openview and "ITIL Change management" (boring bits)for the past year or so, plus developing ASP web front end interfaces (exciting bits) for Openview.

Last edited by badkarma : 04-12-2008 at 09:35 AM.
Reply With Quote
  #9 (permalink)  
Old 04-13-2008, 04:25 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Steve,
Thanks a lot for your thoughts. You are right, you never can tell

Hi Brian
No hurry, I am presently working with Mort Script to query the bits and pieces.
It's a hard nut to crack anyway.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Would like some more info Mr_Gee Questions & Help Needed 5 02-26-2008 06:01 AM
incorrect results on screen size 480x272 gs4322 Questions & Help Needed 5 01-15-2008 05:40 PM
FullScreen and getting screen size glook Questions & Help Needed 5 11-23-2007 07:48 PM
screen size to form size relation Cableguy Basic4ppc Wishlist 2 08-14-2007 10:40 PM
screen size on desktop Cableguy Questions & Help Needed 3 07-02-2007 05:57 PM


All times are GMT. The time now is 03:40 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0