This is no longer required as the SystemSettings class has been extended to support a Platform property. So now you can easily distinguish the difference between PPC, smartphone or a generic WinCE device. SystemSettings lives in the Microsoft.WindowsCE.Forms.dll assembly, so you'll need to add a reference to this dll in your project.
The code is very simple and could look like the following:
Microsoft.WindowsCE.Forms.WinCEPlatform platform =
Microsoft.WindowsCE.Forms.SystemSettings.Platform;
That's alot cleaner than ugly P/invoke code.
switch (platform)
{
case Microsoft.WindowsCE.Forms.WinCEPlatform.PocketPC:
//Do PPC stuff.
break;
case Microsoft.WindowsCE.Forms.WinCEPlatform.Smartphone:
//Do smartphone stuff.
break;
case Microsoft.WindowsCE.Forms.WinCEPlatform.WinCEGeneric:
//Do WinCE stuff.
break;
}
No comments:
Post a Comment