Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows mobile Windows Mobile GetDeviceCaps始终返回零_Windows Mobile - Fatal编程技术网

Windows mobile Windows Mobile GetDeviceCaps始终返回零

Windows mobile Windows Mobile GetDeviceCaps始终返回零,windows-mobile,Windows Mobile,调用GetDeviceCaps是否有先决条件?我试图(在运行时)发现Windows Mobile设备的本机屏幕分辨率是QGVA还是VGA。OnInitDialog()中的以下返回值均为零: 试试这个: int horzRes=GetSystemMetrics(SM_CXSCREEN) int vertRes=GetSystemMetrics(SM_CYSCREEN) 肯定有先决条件 说: 从“插入”菜单中,选择“资源” 单击“自定义”按钮 为资源类型输入CEUX 将资源数据设置为01 00 单击

调用GetDeviceCaps是否有先决条件?我试图(在运行时)发现Windows Mobile设备的本机屏幕分辨率是QGVA还是VGA。OnInitDialog()中的以下返回值均为零:

试试这个:

int horzRes=GetSystemMetrics(SM_CXSCREEN)


int vertRes=GetSystemMetrics(SM_CYSCREEN)

肯定有先决条件

说:

  • 从“插入”菜单中,选择“资源”
  • 单击“自定义”按钮
  • 为资源类型输入CEUX
  • 将资源数据设置为01 00
  • 单击属性选项卡
  • 将项目重命名为“HI_RES_AWARE”,包括引号。(如果省略引号,HI_RES_AWARE将被错误地定义为resource.h中的数值,您需要返回并从resource.h中删除该行。)
  • 取消选中外部文件复选框。(不管这意味着什么)
  • 支持高分辨率感知应用程序开发

    我无法以这种方式创建CEUX资源,但在直接将其添加到资源文件后,我成功了,例如:

    HI_RES_AWARE CEUX {1}       // To turn off the emulation layer
    
    应用程序代码还需要具有介绍性:

    AfxEnableDRA( true );
    
    即使在那之后,上面的所有GetDeviceCaps值仍然为零,但是

    int widthX = GetSystemMetrics( SM_CXFULLSCREEN );
    int heightY = GetSystemMetrics( SM_CYFULLSCREEN );
    int captionHeight = GetSystemMetrics( SM_CYCAPTION );
    int menuHeight = GetSystemMetrics( SM_CYMENU );
    int dialogFrameWidth = GetSystemMetrics( SM_CXDLGFRAME );
    int dialogFrameHeight = GetSystemMetrics( SM_CYDLGFRAME );
    
    VGA分辨率PPC03se和WM5设备及模拟器上的所有返回(高分辨率)值

    int widthX = GetSystemMetrics( SM_CXFULLSCREEN );
    int heightY = GetSystemMetrics( SM_CYFULLSCREEN );
    int captionHeight = GetSystemMetrics( SM_CYCAPTION );
    int menuHeight = GetSystemMetrics( SM_CYMENU );
    int dialogFrameWidth = GetSystemMetrics( SM_CXDLGFRAME );
    int dialogFrameHeight = GetSystemMetrics( SM_CYDLGFRAME );