<legend id='r5z3q'><style id='r5z3q'><dir id='r5z3q'><q id='r5z3q'></q></dir></style></legend>

    <small id='r5z3q'></small><noframes id='r5z3q'>

      • <bdo id='r5z3q'></bdo><ul id='r5z3q'></ul>
      1. <tfoot id='r5z3q'></tfoot>
        <i id='r5z3q'><tr id='r5z3q'><dt id='r5z3q'><q id='r5z3q'><span id='r5z3q'><b id='r5z3q'><form id='r5z3q'><ins id='r5z3q'></ins><ul id='r5z3q'></ul><sub id='r5z3q'></sub></form><legend id='r5z3q'></legend><bdo id='r5z3q'><pre id='r5z3q'><center id='r5z3q'></center></pre></bdo></b><th id='r5z3q'></th></span></q></dt></tr></i><div id='r5z3q'><tfoot id='r5z3q'></tfoot><dl id='r5z3q'><fieldset id='r5z3q'></fieldset></dl></div>

      2. Win32:如何通过 hWnd 在任务栏中隐藏 3rd 方窗口

        时间:2023-08-01

              <tbody id='6RALK'></tbody>
            • <bdo id='6RALK'></bdo><ul id='6RALK'></ul>
              <tfoot id='6RALK'></tfoot>
              <legend id='6RALK'><style id='6RALK'><dir id='6RALK'><q id='6RALK'></q></dir></style></legend>

                <i id='6RALK'><tr id='6RALK'><dt id='6RALK'><q id='6RALK'><span id='6RALK'><b id='6RALK'><form id='6RALK'><ins id='6RALK'></ins><ul id='6RALK'></ul><sub id='6RALK'></sub></form><legend id='6RALK'></legend><bdo id='6RALK'><pre id='6RALK'><center id='6RALK'></center></pre></bdo></b><th id='6RALK'></th></span></q></dt></tr></i><div id='6RALK'><tfoot id='6RALK'></tfoot><dl id='6RALK'><fieldset id='6RALK'></fieldset></dl></div>

                <small id='6RALK'></small><noframes id='6RALK'>

                • 本文介绍了Win32:如何通过 hWnd 在任务栏中隐藏 3rd 方窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我必须在第三方库中隐藏弹出窗口.

                  I have to hide popup windows in third party library.

                  我已经使用 SetWindowsHookEx 实现了 Windows 挂钩内容a> 并知道所有新创建的 hWnd(s).我听 HSHELL_WINDOWCREATED 回调并执行以下操作:

                  I have implemented windows hook stuff with SetWindowsHookEx and know all the newely created hWnd(s). I listen to HSHELL_WINDOWCREATED callback and do the following:

                  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);      
                  

                  在任务栏中隐藏新创建的窗口我做错了什么?

                  What I do wrong here to hide newely created windows in task bar?

                  推荐答案

                  在使用SetWindowLong之前,先调用ShowWindow(hWnd, SW_HIDE),然后再调用SetWindowLong,然后像 ShowWindow(hWnd, SW_SHOW) 一样再次调用 ShowWindow.所以你的代码看起来像这样:

                  Before you use SetWindowLong, call ShowWindow(hWnd, SW_HIDE), then call SetWindowLong, then call ShowWindow again like ShowWindow(hWnd, SW_SHOW). So your code will look like this:

                  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); 
                  
                  ShowWindow(hWnd, SW_HIDE); // hide the window
                  SetWindowLong(hWnd, GWL_STYLE, style); // set the style
                  ShowWindow(hWnd, SW_SHOW); // show the window for the new style to come into effect
                  ShowWindow(hWnd, SW_HIDE); // hide the window so we can't see it
                  

                  这是来自 微软网站的相关引述:

                  为了防止窗口按钮被放置在任务栏上,创建具有 WS_EX_TOOLWINDOW 扩展样式的无主窗口.作为替代方案,您可以创建一个隐藏窗口并将其隐藏window 可见窗口的所有者.

                  To prevent the window button from being placed on the taskbar, create the unowned window with the WS_EX_TOOLWINDOW extended style. As an alternative, you can create a hidden window and make this hidden window the owner of your visible window.

                  Shell 只会在以下情况下从任务栏中删除窗口按钮窗口的样式支持可见的任务栏按钮.如果你想将窗口的样式动态更改为不支持的样式可见的任务栏按钮,您必须先隐藏窗口(通过调用ShowWindow with SW_HIDE),更改窗口样式,然后显示窗口.

                  The Shell will remove a window's button from the taskbar only if the window's style supports visible taskbar buttons. If you want to dynamically change a window's style to one that doesn't support visible taskbar buttons, you must hide the window first (by calling ShowWindow with SW_HIDE), change the window style, and then show the window.

                  这篇关于Win32:如何通过 hWnd 在任务栏中隐藏 3rd 方窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在没有 CAPICOM 的情况下验证 EXE 上的 Authenticode 签 下一篇:将 C++ 程序转换为 Windows 服务?

                  相关文章

                  最新文章

                  <i id='RaSu7'><tr id='RaSu7'><dt id='RaSu7'><q id='RaSu7'><span id='RaSu7'><b id='RaSu7'><form id='RaSu7'><ins id='RaSu7'></ins><ul id='RaSu7'></ul><sub id='RaSu7'></sub></form><legend id='RaSu7'></legend><bdo id='RaSu7'><pre id='RaSu7'><center id='RaSu7'></center></pre></bdo></b><th id='RaSu7'></th></span></q></dt></tr></i><div id='RaSu7'><tfoot id='RaSu7'></tfoot><dl id='RaSu7'><fieldset id='RaSu7'></fieldset></dl></div>
                  <tfoot id='RaSu7'></tfoot>

                  <small id='RaSu7'></small><noframes id='RaSu7'>

                    <legend id='RaSu7'><style id='RaSu7'><dir id='RaSu7'><q id='RaSu7'></q></dir></style></legend>
                      • <bdo id='RaSu7'></bdo><ul id='RaSu7'></ul>