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