关于wince中的全屏显示

1. 在WinCe下如何让程序全屏

;修改任务栏

[HKEY_LOCAL_MACHINESoftwareMicrosoftShellAutoHide]

"Default"=dword:1

[HKEY_LOCAL_MACHINESoftwareMicrosoftClock]

"SHOW_CLOCK"=dword:0

[HKEY_LOCAL_MACHINESoftwareMicrosoftShellOnTop]

"Default"=dword:0

或者:

1 将dialog属性中的styles的title bar去掉

2 在dialog初始化时加入:

int iFullWidth = GetSystemMetrics(SM_CXSCREEN);

int iFullHeight = GetSystemMetrics(SM_CYSCREEN);

::SetWindowPos(this->m_hWnd, HWND_TOPMOST, 0, 0, iFullWidth, iFullHeight, SWP_NOOWNERZORDER|SWP_SHOWWINDOW);

 

2. 对于Pocket PC,也有类似的方法

MFC PocketPC应用程序全屏方法

基于对话框的MFC PocketPC应用程序全屏方法

1.需要将整个窗口向上平移26个像素以到达屏幕顶部,同时使用SHFullScreen()函数隐藏任务栏;

  在OnInitDialog()函数中添加如下语句

  RECT rc;

GetWindowRect(&rc);

rc.top-=26

MoveWindow(rc.left,rc.top,rc.right,rc.bottom,FALSE); //上移26像素

SHFullScreen(this->m_hWnd,SHFS_HIDETASKBAR); //隐藏任务栏

 

2.防止使用Input Panel时任务栏出现

  说明,依据MSDN,在Input Panel活动时会发送WM_SETTING_CHANGE和WM_ACTIVATE两个消息。需要手工接管两个消息的处理保持全屏。

  MFC类中,CDialog类由CWnd类直接派生,所以这里可以直接手工添加函数。

  在主程序的对话框类*Dlg.h头文件中这个位置,加入这两项(声明这两个函数):

  // Implementation:

   protected:e:

        HICON m_hIcon;

// Generated message map functions

//{{AFX_MSG(CFullScreenDialogDlg)

 virtual BOOL OnInitDialog();

 virtual void OnSettingChange();  =====================================>1

afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);  =========>2

 //}}AFX_MSG

DECLARE_MESSAGE_MAP()

  在主程序的对话框类*Dlg.cpp实现文件中做如下修改::

 (1)在消息映射处加入

BEGIN_MESSAGE_MAP(CFullScreenDialogDlg, CDialog)

 //{{AFX_MSG_MAP(CFullScreenDialogDlg)

ON_WM_SETTINGCHANGE()  ========================================>1

ON_WM_ACTIVATE()  ============================================>2

 //}}AFX_MSG_MAP

  END_MESSAGE_MAP()

 

  手工添加这两个函数:

  void CFullScreenDialogDlg::OnSettingChange()

  {

 }

 

void CFullScreenDialogDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)

{

CWnd::OnActivate(nState, pWndOther, bMinimized);  //注意这里从CWnd继承        

SHFullScreen( this->m_hWnd, SHFS_HIDETASKBAR);//\D*k/a-@!O:n ~

 

=======================================================

wince中不使用SHFullScreen的全屏方法
2008-07-22 12:53

Introduction

The usual method of creating a full screen window in Windows CE involves using the function SHFullScreen. This article describes a method of creating full screen windows with standard window management calls.

The Variables

ShowWindow(HWND,SW_HIDE)
ShowWindow(HWND,SW_SHOW)
hWndInputPanel
SetWindowPos(hWnd...
GetSystemMetrics
SetWindowPos(hWnd...
SystemParametersInfo(...

 

posted @   Scorpio_逸尘  阅读(6509)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示