【问题标题】:How to get the height of the lower menu bar of windows mobile 6.5.3windows mobile 6.5.3如何获取下方菜单栏的高度
【发布时间】:2011-03-05 23:53:15
【问题描述】:

在 windows mobile 6.5.3 上是否有任何可能的方法来获取下部菜单栏(带有开始菜单的菜单栏)的高度?我可以使用不同的方式获取上层菜单栏的高度,例如使用函数 SystemParametersInfo 并将 SPI_GETWORKAREA 作为其 uiAction 参数,或者使用 GetMonitorInfo 函数,但所有这些函数都可以帮助计算上层菜单栏的高度。

在以前版本的 windows mobile 中,上下栏的高度是标准的,QVGA 设备为 26 像素,VGA 设备为 52,但在 windows mobile 6.5.3 中不是这种情况,上栏有18 的高度,现在只有上帝知道的低 :)

提前感谢您的帮助。

艾曼

【问题讨论】:

    标签: windows-mobile menubar


    【解决方案1】:

    其实叫下层任务栏

    hTBWnd = FindWindow(_T("HHTaskBar"), NULL)

    这可以让您获得任务栏的句柄。然后您可以使用GetWindowRect 获取任务栏的四个角,并通过从底部减去顶部来计算高度。如果没有找到 HHTaskBar,Tray 可能会起作用。

    HWND hTBWnd;
    RECT windowRect;
    
    hTBWnd = FindWindow(_T("HHTaskBar"), NULL);
    if (hTBWnd != NULL) 
    {
      GetWindowRect(hwnd, &windowRect);
      CString csLongAsString;
      csLongAsString.Format( _T( "Height: %ld" ), windowRect.bottom - windowRect.top );
      MessageBox(NULL, csLongAsString, _T("HHTaskBar"), MB_OK);
      return(0);
    } else
    {
      hTBWnd = FindWindow(_T("Tray"), NULL);
      if (hTBWnd != NULL) 
      {
        GetWindowRect(hwnd, &windowRect);
        CString csLongAsString;
        csLongAsString.Format( _T( "Height: %ld %ld" ), windowRect.bottom, windowRect.top );
        MessageBox(NULL, csLongAsString, _T("Tray"), MB_OK);
      } else 
      {
        MessageBox(NULL, _T("Window get failed"), _T("FAILED TO FIND WINDOW"), MB_OK);
        return(0);
      }
    }
    

    【讨论】:

    • 其实我试过HHTaskBar还是不行,不过我试试Tray看看能不能用,谢谢:)
    【解决方案2】:
    Rectange toolBarRect = GetWindowRect(toolBar.Handle);
    

    【讨论】:

      猜你喜欢
      • 2011-08-11
      • 1970-01-01
      • 1970-01-01
      • 2011-02-16
      • 2016-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-25
      相关资源
      最近更新 更多