C++实现隐藏和显示任务栏上的开始按钮

2025-02-24 05:00:08
推荐回答(1个)
回答1:

void CHideStartMenuDlg::OnHide()
{
HWND parent=::FindWindow("Shell_TrayWnd","");
HWND startmenu=::FindWindowEx(parent,0,"Button",NULL);
if(startmenu!=NULL)
{
::ShowWindow(startmenu,SW_HIDE);
}
}

void CHideStartMenuDlg::OnShow()
{
HWND parent=::FindWindow("Shell_TrayWnd","");
HWND startmenu=::FindWindowEx(parent,0,"Button",NULL);
if(startmenu!=NULL)
{
::ShowWindow(startmenu,SW_SHOW);
}
}