WM 获得手机信息

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值