|
谢谢各位的解答;
我的全屏主要实现代码如下:
void CCEDlg::SetScreenMode(BOOL bFullScreen)
{
if (bFullScreen)
{
// 隐藏输入面板
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);
}
SipShowIM(SIPF_OFF);
// 隐藏命令栏
HWND hWnd = SHFindMenuBar(m_hWnd);
// ::CommandBar_Show(hWnd, FALSE);
// SHFullScreen fails if dialog box is not foreground.
//SetForegroundWindow();
SHFullScreen(m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON|SHFS_HIDESTARTICON);
// Resize the window over the taskbar area.
CRect rcScreen;
rcScreen.SetRect( 0,
0,
GetSystemMetrics( SM_CXSCREEN ),
GetSystemMetrics( SM_CYSCREEN ));
MoveWindow(&rcScreen, TRUE);
}
else
{
// 显示任务栏
SHFullScreen(m_hWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
// 显示命令栏
HWND hWnd = SHFindMenuBar(m_hWnd);
::CommandBar_Show(hWnd, TRUE);
// 显示任务栏
HWND hWndTaskBar = ::FindWindow(TEXT("HHTaskBar"), NULL);
if (hWndTaskBar != NULL)
{
::ShowWindow(hWndTaskBar, SW_SHOW);
::EnableWindow(hWndTaskBar, TRUE);
}
}
}
1问题解决了哦,方法如下:
void CCEDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
SHFullScreen(m_hWnd, SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON); // 当窗口活动的时候保证任务栏隐藏和SIPbutton
CWnd::OnActivate(nState, pWndOther, bMinimized);
}
|
|