我需要隐藏第三方库中的弹出窗口。
我使用SetWindowsHookEx实现了Windows钩子,并知道所有新创建的hWnd。我监听HSHELL_WINDOWCREATED
回调并执行以下操作:
long style= GetWindowLong(hWnd, GWL_STYLE);
style &= ~(WS_VISIBLE); // this works - window become invisible
style |= WS_EX_TOOLWINDOW; // flags don't work - windows remains in taskbar
style &= ~(WS_EX_APPWINDOW);
SetWindowLong(hWnd, GWL_STYLE, style);
我在这里做错了什么,导致无法在任务栏隐藏新创建的窗口?