Distinguish PPC 2002 from 2003

  • Thread starter Benjamin Lukner
  • Start date
B

Benjamin Lukner

Hi!

How do I distinguish PocketPC 2002 from 2003 (and CE.Net 4.1)?
Is there a special registry key, API call or file?

Kind regards,

Benjamin Lukner
trinomix GmbH
 
B

Benjamin Lukner

Alex said:

Thanks!

I transformed it to VB.Net code:


Private Const SPI_GETPLATFORMTYPE As Int32 = 257

Private Declare Function SystemParametersInfo Lib "CoreDll" ( _
ByVal uiAction As Int32, _
ByVal uiParam As Int32, _
ByVal pvParam As String, _
ByVal fWinIni As Int32 _
) As Int32

Public Enum Platform
Unknown = -1
PocketPC2000 = 0
PocketPC2002 = 1
PocketPC2003 = 2
End Enum

Public Function GetPlatform() As Platform

Dim szPlatform As String = " "
Dim strPlatform As String = String.Empty

' Get OS Version
Dim osVersion As System.OperatingSystem = Environment.OSVersion

' Get Platform
Dim ret As Int32 = SystemParametersInfo( _
SPI_GETPLATFORMTYPE, _
szPlatform.Length, _
szPlatform, _
0)

If Not ret = 0 Then

strPlatform = szPlatform.Substring(0, szPlatform.IndexOf(Chr(0)))

If (osVersion.Version.Major = 3) Then ' PPC2000 or PPC2002

If (strPlatform = "PocketPC") Then
Return Platform.PocketPC2002
Else
Return Platform.PocketPC2000
End If

ElseIf (osVersion.Version.Major = 4) Then ' WinCE.NET

If (strPlatform = "PocketPC") Then
Return Platform.PocketPC2003
Else
Return Platform.Unknown
End If

End If

End If

Return Platform.Unknown

End Function
 
R

Richard Kucia

Will this work on non-English Pocket PCs? Is the string literal still
"PocketPC"? Thanks.
Richard Kucia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top