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
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
相关文章推荐
- 获得手机信息工具类
- Android 获取app应用大小、手机内存信息、删除文件方法、获得文件大小
- 利用私有的API获得手机上所安装的所有应用信息(包括版本,名称,bundleID,类型)
- 黑马程序员——获得手机通讯录联系人信息
- 获得安卓手机的相关信息
- Android 怎样获得手机信息
- Android 关于手机基本信息的获得
- android 获取手机GSM/CDMA信号信息,并获得基站信息的方法
- Android 怎样获得手机信息
- 获得Build、PackageInfo等手机信息
- Android学习之获得手机联系人基本信息
- Java调用WEBSERVICE接口实现天气预报和获得国内手机号码归属地省份、地区和手机卡类型信息
- Android实战技巧之十九:android studio导出jar包(Module)并获得手机信息
- Android开发使用TelephonyManager获得手机相关信息
- Android 怎样获得手机信息
- android 获取手机GSM/CDMA信号信息,并获得基站信息
- 获得IPhone手机的相关硬件和其版本支持的SDK信息
- Android 怎样获得手机信息(二)
- Android 怎样获得手机信息(一)
- Java 安卓获得获得手机设备信息