15,979
社区成员
发帖
与我相关
我的任务
分享
void gShowHideTaskBar(BOOL bHide /*=FALSE*/)
{
CRect rectWorkArea = CRect(0,0,0,0);
CRect rectTaskBar = CRect(0,0,0,0);
CWnd* pWnd = CWnd::FindWindow(_T("Shell_TrayWnd"), NULL);
if( bHide )
{
// Code to Hide the System Task Bar
SystemParametersInfo(SPI_GETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
if( pWnd )
{
pWnd->GetWindowRect(rectTaskBar);
rectWorkArea.bottom += rectTaskBar.Height();
SystemParametersInfo(SPI_SETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
pWnd->ShowWindow(SW_HIDE);
}
}
else
{
// Code to Show the System Task Bar
SystemParametersInfo(SPI_GETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
if( pWnd )
{
pWnd->GetWindowRect(rectTaskBar);
rectWorkArea.bottom -= rectTaskBar.Height();
SystemParametersInfo(SPI_SETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
pWnd->ShowWindow(SW_SHOW);
}
}
}
你可以试试这个把下面的状态栏给全部隐藏。[/quote]我的意思是我的窗口覆盖在任务栏上。而且只覆盖了一部分,不是完全覆盖,[/quote]那就没有办法了 都是顶层都可以切换void gShowHideTaskBar(BOOL bHide /*=FALSE*/)
{
CRect rectWorkArea = CRect(0,0,0,0);
CRect rectTaskBar = CRect(0,0,0,0);
CWnd* pWnd = CWnd::FindWindow(_T("Shell_TrayWnd"), NULL);
if( bHide )
{
// Code to Hide the System Task Bar
SystemParametersInfo(SPI_GETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
if( pWnd )
{
pWnd->GetWindowRect(rectTaskBar);
rectWorkArea.bottom += rectTaskBar.Height();
SystemParametersInfo(SPI_SETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
pWnd->ShowWindow(SW_HIDE);
}
}
else
{
// Code to Show the System Task Bar
SystemParametersInfo(SPI_GETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
if( pWnd )
{
pWnd->GetWindowRect(rectTaskBar);
rectWorkArea.bottom -= rectTaskBar.Height();
SystemParametersInfo(SPI_SETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
pWnd->ShowWindow(SW_SHOW);
}
}
}
你可以试试这个把下面的状态栏给全部隐藏。[/quote]我的意思是我的窗口覆盖在任务栏上。而且只覆盖了一部分,不是完全覆盖,void gShowHideTaskBar(BOOL bHide /*=FALSE*/)
{
CRect rectWorkArea = CRect(0,0,0,0);
CRect rectTaskBar = CRect(0,0,0,0);
CWnd* pWnd = CWnd::FindWindow(_T("Shell_TrayWnd"), NULL);
if( bHide )
{
// Code to Hide the System Task Bar
SystemParametersInfo(SPI_GETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
if( pWnd )
{
pWnd->GetWindowRect(rectTaskBar);
rectWorkArea.bottom += rectTaskBar.Height();
SystemParametersInfo(SPI_SETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
pWnd->ShowWindow(SW_HIDE);
}
}
else
{
// Code to Show the System Task Bar
SystemParametersInfo(SPI_GETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
if( pWnd )
{
pWnd->GetWindowRect(rectTaskBar);
rectWorkArea.bottom -= rectTaskBar.Height();
SystemParametersInfo(SPI_SETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
pWnd->ShowWindow(SW_SHOW);
}
}
}
你可以试试这个把下面的状态栏给全部隐藏。 HWND hwnd = FindWindow("Shell_traywnd", NULL);
EnableWindow(hwnd, false);