您的位置:首页 > 其它

WM 获得手机信息

2010-12-07 11:11 204 查看
1.

SystemParametersInfo只能获取平台(sp、PPC)和手机型号。







2.

GetVersionEx只能获取主版本、次版本(针对的是CE版本)和Build版本,不能获取Windows mobile的版本
(指的是windows mobile 6.1或者windows mobile 6.5等)







3.获得操作系统版本,两种方法:

A:

KernelIOControl(IOCTL_PROCESSOR_INFORMATION ,)...

但这个需要pkfuncs.h和toolhelp.h。下载windows ce 5.0或者AUK(非免费)。



B,另一种方法:



#define POCKETPCV1 1
#define SMARTPHONEV1 2
#define POCKETPCV2 3
#define SMARTPHONEV2 4
int MyDeviceType()
{
TCHAR szPlatform[MAX_STRING_BUFFER];
int iDeviceType=0;
OSVERSIONINFO osVer;
GetVersionEx(&osVer);
if (osVer.dwMajorVersion==3)
{
if (SystemParametersInfo(SPI_GETPLATFORMTYPE, sizeof(szPlatform),szPlatform,0)!=0)
{
if (lstrcmp(szPlatform,TEXT("PocketPC"))==0)
{
iDeviceType= POCKETPCV1; // runs on Pocket PC 2000 and 2002
}
else if (lstrcmp(szPlatform,TEXT("Smartphone"))==0)
{
iDeviceType= SMARTPHONEV1; // runs on Smartphone 2002
}
}
else
{
if (GetLastError()==ERROR_ACCESS_DENIED) //(5)
{
iDeviceType= SMARTPHONEV1; // is a smartphone:
// Smartphone creates an access denied error on
// SystemParametersInfo()
}
}
}
else
{
if (osVer.dwMajorVersion==4)
{
if (SystemParametersInfo(SPI_GETPLATFORMTYPE, sizeof(szPlatform),szPlatform,0)!=0)
{
if (lstrcmp(szPlatform,TEXT("PocketPC"))==0)
{
iDeviceType= POCKETPCV2; // runs on Pocket PC 2003
}
else if (lstrcmp(szPlatform,TEXT("Smartphone"))==0)
{
iDeviceType= SMARTPHONEV2; // runs on Smartphone 2003
}
}
else
{
if (GetLastError()==ERROR_ACCESS_DENIED) //(5)
{
iDeviceType= SMARTPHONEV2; // is a smartphone:
// Smartphone creates an access denied error on
// SystemParametersInfo()
}
}
}
}
return iDeviceType;
}

Version Number OS Version
3.0.9348 Pocket PC 2000
3.0.11171 Pocket PC 2002
4.20.xxxx Windows Mobile 2003
4.21.xxxx Windows Mobile 2003 SE
5.1.342 Windows Mobile 5.0
5.2.20771 Windows Mobile 6.1

5.2.21869 Windows Mobile 6.5
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: