在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

HWND hWnd;                     //
 The main window handle

HWND hWndInputPanel = NULL; // The SIP
HWND hWndTaskBar = NULL; // The TaskBar
HWND hWndSipButton = NULL; // The SIP Button

BOOL mode = false ; // Our current window mode.
// True = Fullscreen
// False - Windowed (Startup Default)

Finding the Window Information

The first step is to find the handles of the three main windows that handle the TaskBar, Standard Input Panel (SIP) and SIP Button Bar. This should be done early on in the application during initialization.

void
 InitFullScreen (void
)
{
hWndInputPanel = FindWindow(TEXT(" SipWndClass" ), NULL);
hWndSipButton = FindWindow(TEXT(" MS_SIPBUTTON" ), NULL);
hWndTaskBar = FindWindow(TEXT(" HHTaskBar" ), NULL);
}

Toggling Between The Two Modes

Toggling between the two modes is a simple matter of setting the windows states, and sizing our window appropriately.

To Enter Fullscreen mode we use ShowWindow(HWND,SW_HIDE) on each of the system windows.

To Exit Fullscreen mode we use ShowWindow(HWND,SW_SHOW) on each of the system windows. This will however also show the input panel, which is not desirable, so hWndInputPanel should be ignored.

Sizing the window to the correct size involves a different system call depending on whether you are entering or exiting Fullscreen Mode.

Entering Fullscreen mode we call SetWindowPos(hWnd... using the results from a GetSystemMetrics call.

Exiting Fullscreen mode we call SetWindowPos(hWnd... using the results from a SystemParametersInfo(... call.

void
 ToggleFullScreen()
{
RECT rtDesktop;

if (mode)
{
if (hWndTaskBar != NULL)
ShowWindow(hWndTaskBar, SW_SHOW);
// if(hWndInputPanel != NULL)
ShowWindow(hWndInputPanel, SW_SHOW);
// Never forcibly show the input panel
if (hWndSipButton != NULL)
ShowWindow(hWndSipButton, SW_SHOW);

if (SystemParametersInfo(SPI_GETWORKAREA, 0 , &rtDesktop, NULL) == 1 )
SetWindowPos(hWnd,HWND_TOPMOST,0 ,0 ,rtDesktop.right -
rtDesktop.left,rtDesktop.bottom - rtDesktop.top, SWP_SHOWWINDOW);

mode = false ;
}
else
{
if (hWndTaskBar != NULL) ShowWindow(hWndTaskBar, SW_HIDE);
if (hWndInputPanel != NULL) ShowWindow(hWndInputPanel, SW_HIDE);
if (hWndSipButton != NULL) ShowWindow(hWndSipButton, SW_HIDE);

SetWindowPos(hWnd,HWND_TOPMOST,0 ,0 ,GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN), SWP_SHOWWINDOW);

mode = true ;
}
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Wince嵌入式开发程序入门.doc》是一篇关于Wince嵌入式开发程序入门的指南文档。该文档主要向初学者介绍了Wince嵌入式开发程序的基本概念、开发工具以及开发流程等内容。 首先,文档详细介绍了Wince嵌入式开发程序的基本概念,包括Wince系统的特点、嵌入式开发的目的以及嵌入式系统的组成等内容。这有助于初学者对Wince嵌入式开发程序有一个整体的认识。 其次,文档介绍了Wince嵌入式开发程序的开发工具,包括开发环境搭建、调试工具和软件开发工具等方面。对于初学者来说,了解和熟悉这些开发工具是非常重要的,有助于提高开发效率和开发质量。 文档还详细介绍了Wince嵌入式开发程序的开发流程。从设定开发目标、设计系统架构、编码调试、测试和发布等方面,对开发流程进行了详细的解读。这对于初学者来说非常有价值,可以帮助他们更好地规划和组织开发工作。 此外,文档还提供了一些常用的Wince嵌入式开发技巧和经验分享,如调试技巧、性能优化和错误处理等方面。这对于初学者来说是非常实用的,可以帮助他们更高效地开发和调试嵌入式程序。 总的来说,《Wince嵌入式开发程序入门.doc》是一份很有用的指南文档,它全面介绍了Wince嵌入式开发程序的相关知识和技术,对初学者来说是一个很好的学习资料和参考指南。读者可以通过阅读该文档了解和掌握Wince嵌入式开发程序的基本知识和技能,从而更好地进行嵌入式开发工作。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值