Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OS version

1 view
Skip to first unread message

Zanna

unread,
Jan 22, 2004, 10:56:10 AM1/22/04
to
Hi,

I searched into old post but I cannot find a good solution.

Can I determine if the OS is a pocketPC or a WinCE?

Can I also get the relative version? (ppc2002, ppc2003... wince 4...)

Thank you

Peter Foot [MVP]

unread,
Jan 22, 2004, 11:42:03 AM1/22/04
to
Using System.Environment.OSVersion you can retrieve the version of the
Windows CE OS used:-
Pocket PC 2000 and 2002 use 3.0
Pocket PC 2003 uses 4.2

To determine the platform name (PocketPC, Smartphone etc) requires a
P/Invoke to the SystemParamtersInfo function e.g.
public static string PlatformName

{

get

{

//allocate buffer to receive value

byte[] buffer = new byte[32];

//call native function

if(!SystemParametersInfo(257, buffer.Length, buffer, 0))

{

throw new ExternalException("Retrieving platform name failed");

}

//get string from buffer contents

string platformname = System.Text.Encoding.Unicode.GetString(buffer, 0,
buffer.Length);

//trim any trailing null characters

return platformname.TrimEnd('\0');

}

[DllImport("coredll", EntryPoint="SystemParametersInfo")]

private static extern bool SystemParametersInfo(int action, int size, byte[]
buffer, int winini);


Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org


"Zanna" <znt....@virgilio.it> wrote in message
news:buos1q$jusn5$4...@ID-184808.news.uni-berlin.de...

chris-s

unread,
Jan 23, 2004, 3:47:17 AM1/23/04
to
Try the following...


public enum OSVersions {Unknown, PPC2002, PPC2003}


public static OSVersions OSVersion()

{

string ver = System.Environment.OSVersion.Version.ToString();

if (ver == "3.0.11171")

return OSVersions.PPC2002;

else

if (ver == "4.20.1081")

return OSVersions.PPC2003;

else

return OSVersions.Unknown;

}

public static string OSVersionText()

{


switch (OSVersion())

{

default:

case OSVersions.Unknown :

return "";

case OSVersions.PPC2002:

return "PPC2002";

case OSVersions.PPC2003:

return "PPC2003";

}

}

/// <summary>

/// Returns a textual description for the level of CF service pack
installed.

/// </summary>

/// <returns>string</returns>

public static string CFSPVersion()

{

string cfVer = System.Environment.Version.ToString();

if (cfVer == "1.0.2268.0")

return "Base";

else

if (cfVer == "1.0.3111.0")

return "SP1";

else

if (cfVer == "1.0.3316.0")

return "SP2";

else

return "";

}


"Zanna" <znt....@virgilio.it> wrote in message
news:buos1q$jusn5$4...@ID-184808.news.uni-berlin.de...

Zanna

unread,
Jan 23, 2004, 4:49:49 AM1/23/04
to
Peter Foot [MVP] wrote:

> Using System.Environment.OSVersion you can retrieve the version of the
> Windows CE OS used:-
> Pocket PC 2000 and 2002 use 3.0
> Pocket PC 2003 uses 4.2

But... winCe 4.1 is a PocketPC2003?

OSVersion also tell me that my PocketPC is a Windows CE 3.x...

mmmmh... I'm confused :)

See you

Maarten Struys, eMVP

unread,
Jan 23, 2004, 5:48:19 AM1/23/04
to
All PocketPC's run a particular version of the Windows CE operating system,
just like Peter said.

If you have a PocketPC 2003 it will run the Windows CE.NET 4.2 operating
system. All other PocketPC's (2002 & 2000) will run version 3.0 of Windows
CE, os if yours returns CE 3.x you either have a PocketPC 2000 or a PocketPC
2002. If you want some clarity on the differences between Windows CE and
PocketPC you can take a look here:
http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=317.

--
Regards,

Maarten Struys, eMVP
PTS Software bv

"Zanna" <znt....@virgilio.it> wrote in message

news:buqquu$knptg$2...@ID-184808.news.uni-berlin.de...

0 new messages