隐藏windows系统任务栏的方法

如下:

VOID HideTaskBar(BOOL bHide)  
{  
    int nCmdShow;  
    HWND hWnd;  
    LPARAM lParam;  

    hWnd = FindWindow(_T("Shell_TrayWnd"),NULL);  
    if(bHide == TRUE)  
    {
        nCmdShow = SW_HIDE;  
        lParam = ABS_AUTOHIDE | ABS_ALWAYSONTOP;  
    }  
    else  
    {
        nCmdShow = SW_SHOW;  
        lParam = ABS_ALWAYSONTOP;  
    }  

    ShowWindow(hWnd, nCmdShow);  

    APPBARDATA apBar;   
    memset(&apBar, 0, sizeof(apBar));   
    apBar.cbSize = sizeof(apBar);   
    apBar.hWnd = hWnd;   
    if(apBar.hWnd != NULL)   
    {
        apBar.lParam = lParam;   
        SHAppBarMessage(ABM_SETSTATE, &apBar);  
    }   
}

你可能感兴趣的:(c++,windows)