我必须在第三方库中隐藏弹出窗口.
我已经使用SetWindowsHookEx实现了Windows钩子的东西,并且知道了所有新创建的hWnd(s).我听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);
Run Code Online (Sandbox Code Playgroud)
我在这里做错了,在任务栏中隐藏了新创建的窗口?