CWnd::BringWindowToTop void BringWindowToTop( );ResBrings CWnd to the top of a stack of overlapping windows. In addition, BringWindowToTop activates pop-up, top-level, and MDI child windows. The BringWindowToTop member function should be used to uncover any window that is partially or completely obscured by any overlapping windows. Calling this function is similar to calling the SetWindowPos function to change a window’s position in the Z-order. The BringWindowToTop function does not change the window style to make it a top-level window of the desktop.
SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);
空出一条可以用来放你的程序中间的切换过程比较烦,要多调一下
if( SystemParametersInfo(SPI_GETWORKAREA,0,&DesktopWorkArea,0) )
{
//如果为恢复
if(isRestore == TRUE)
{
DesktopWorkArea.top = 0 ;
}
else
{
CRect DlgRect;
int DlgHeight; GetWindowRect(DlgRect);
DlgHeight = DlgRect.Height(); DlgRect.top = 0; //DesktopWorkArea.top;
DlgRect.left = 0; //DesktopWorkArea.left;
DlgRect.right = nSysCX;
DlgRect.bottom = DlgHeight; MoveWindow(DlgRect); DesktopWorkArea.top = DlgRect.Height()+4;
}SystemParametersInfo(SPI_SETWORKAREA,0,&DesktopWorkArea,SPIF_SENDCHANGE);这样清楚了吧
void BringWindowToTop( );ResBrings CWnd to the top of a stack of overlapping windows. In addition, BringWindowToTop activates pop-up, top-level, and MDI child windows. The BringWindowToTop member function should be used to uncover any window that is partially or completely obscured by any overlapping windows. Calling this function is similar to calling the SetWindowPos function to change a window’s position in the Z-order. The BringWindowToTop function does not change the window style to make it a top-level window of the desktop.
建议用SPY++看看任务栏的属性。建议下载一个WINDOWHACK(好东西大家用)可以看到屏幕上的所有窗口,得到它的窗口类名称,大小,位置。