// 隐藏输入面板
SIPINFO si;
memset(&si, 0, sizeof(SIPINFO));
si.cbSize = sizeof(SIPINFO);
SHSipInfo(SPI_GETSIPINFO, 0, &si, 0);
if (si.fdwFlags & SIPF_ON)
{
si.cbSize = sizeof(SIPINFO);
si.fdwFlags = SIPF_OFF;
SHSipInfo(SPI_SETSIPINFO, 0, &si, 0);
}
// 隐藏任务栏
DWORD dwState = (SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
SHFullScreen(m_hWnd, dwState);
HWND hWndTaskBar = ::FindWindow(TEXT("HHTaskBar"), NULL);
if (hWndTaskBar != NULL)
{
RECT rtTaskBar;
::GetWindowRect(hWndTaskBar, &rtTaskBar);
::ShowWindow(hWndTaskBar, SW_HIDE);
}
// 隐藏主菜单
HWND hMenuBar = SHFindMenuBar(m_hWnd);
if (hMenuBar != NULL)
{
RECT rtMenuBar;
::GetWindowRect(hMenuBar, &rtMenuBar);
::MoveWindow(hMenuBar, 0, 0, 1, 1, TRUE);
::ShowWindow(hMenuBar, SW_HIDE);
}
// 全屏窗口
CRect rc;
SetRect( &rc,
0,
0,
GetSystemMetrics( SM_CXSCREEN ),
GetSystemMetrics( SM_CYSCREEN ));
MoveWindow( &rc, TRUE );
代码如上;;;
上面的菜单栏给隐藏了,但下面的任务栏怎么都隐藏不掉。。。估计是输入法那个按钮还在上面的原因;
问下怎么实现真正的全屏啊。。。
隐藏Wce桌面上的任务栏
void CTabControlvc9Dlg::ControlBgnBar(BOOL bShowFlag)
{
HWND hBgnBar;
hBgnBar = ::FindWindow(_T("HHTaskBar"), NULL);
if(hBgnBar == NULL) return;
//SendMessage( hBgnBar, WM_WININICHANGE, 0, 5000 );
if(bShowFlag) ::ShowWindow(hBgnBar,SW_HIDE);
else ::ShowWindow(hBgnBar,SW_SHOW);
}
谢谢楼上回复,现在
CE下对话框的布局
---------------------------------------
| 任务栏(0, 0, 240, 26) |
---------------------------------------
客户区域
---------------------------------------
| 菜单栏(0, 294, 240, 26) |
---------------------------------------
是不是这样的啊??
我现在的问题任务栏可以隐藏了。。
但是菜单栏隐藏不了,
发现菜单栏始终有个选择输入法的输入面板。。。
下面的是任务栏,上面的是菜单栏 你可以从注册表里改
void hide_imm()
{
TCHAR szKeyName[256];
DWORD val;
HKEY hfkey;
LPDWORD Disposition = 0;
val = 0;
wsprintf(szKeyName, _T("Software\\Microsoft\\Windows\\CurrentVersion\\CHSIME03\\"));
if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CURRENT_USER,szKeyName, 0, 0, &hfkey))
{
RegSetValueEx(hfkey, TEXT("ShowState"), 0,REG_DWORD, (PBYTE)&val ,4);
RegCloseKey( hfkey);
}
}
方法类似与上面代码
=================================================
Windows Mobile
DWORD dwState;
RECT rc;
if (wParam == WA_CLICKACTIVE || wParam == WA_ACTIVE) {
// To switch to full screen mode, first hide all of the shell parts.
dwState = (SHFS_HIDETASKBAR
| SHFS_HIDESTARTICON
| SHFS_HIDESIPBUTTON);
SHFullScreen(hWnd, dwState);
// Next resize the main window to the size of the screen.
SetRect(&rc, 0, 0, GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN));
MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left,
rc.bottom-rc.top, TRUE);
ShowWindow(hWnd, SW_SHOWNORMAL);
}
// The window is being deactivated... restore it to non-fullscreen
else {
// To switch to normal mode, first show all of the shell parts.
dwState = (SHFS_SHOWTASKBAR
| SHFS_SHOWSTARTICON
| SHFS_SHOWSIPBUTTON);
SHFullScreen(hWnd, dwState);
// Next resize the main window to the size of the work area.
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, FALSE);
MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left,
rc.bottom-rc.top, TRUE);
}
=======================================================
WinCE下就更简单了。
上面的方法都可以,
MoveWindow(...)
SetWindowPos(...)
都可以实现。
楼上的代码我试过,不过没实现过。。
不过问题已解决;
发现了全屏有好几种方式:
1、隐藏任务栏,命令栏,输入法面板然后全屏;
2、另一种设置对话框为非全屏对话框,CE的CDialg有个这个属性的。。。