<legend id='9uGwD'><style id='9uGwD'><dir id='9uGwD'><q id='9uGwD'></q></dir></style></legend>
  • <tfoot id='9uGwD'></tfoot>

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

      <small id='9uGwD'></small><noframes id='9uGwD'>

      • <bdo id='9uGwD'></bdo><ul id='9uGwD'></ul>
      1. 如何始终保持窗口可见,但不强制它位于顶部

        时间:2023-09-14
          • <bdo id='LahsH'></bdo><ul id='LahsH'></ul>

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

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

              <legend id='LahsH'><style id='LahsH'><dir id='LahsH'><q id='LahsH'></q></dir></style></legend>
                <tbody id='LahsH'></tbody>
              <tfoot id='LahsH'></tfoot>
                • 本文介绍了如何始终保持窗口可见,但不强制它位于顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在创建一个桌面小工具",我已禁用手动最小化窗口,但现在还有另一个问题:如果用户按下 Windows+D,例如.

                  I'm creating a "desktop gadget" of sorts, I've disabled manual minimizing of the window, but now there is another problem: the system can still hide the window if the user presses Windows+D, for example.

                  以这种方式隐藏时,不会触发通常的最小化/调整大小/可见性事件.我想做一些类似于 TopMost 的事情,但不强制窗口顺序.

                  When hidden that way, no usual minimize/resize/visibility events are fired. I want to do something almost like TopMost, but without forcing the window order.

                  也许可以使用 win32 API 安装全局快捷方式事件,并将 TopMost 短暂设置为 true,但这听起来很 hackish.

                  Maybe it's possible to install a global shortcut event using win32 API, and briefly set TopMost to true, but that sounds very hackish.

                  我找到了一种解决方案,但它似乎不适用于 Windows 10:通过显示桌面"/Win+D 保持窗口可见另一个常见的选项,即编写一个实际的桌面小工具,在 Windows 10 上是不可能的,因为它们已被弃用.

                  I found one solution, but it does not seem to work on Windows 10: Keeping window visible through "Show Desktop"/Win+D The other common option, which would be writing an actual desktop gadget, is not possible on Windows 10, given their deprecation.

                  是否有任何其他方法可以让窗口始终可见(但不在屏幕顶部)?

                  Are there any other methods to keep a window visible (but not on top of the screen) at all moments?

                  推荐答案

                  这个函数对我有用:

                  BOOL FixShowDesktop(HWND hWnd)
                  {
                      HWND hWndTmp = FindWindowEx(NULL, NULL, L"Progman", NULL);
                      if (hWndTmp)
                      {
                          hWndTmp = FindWindowEx(hWndTmp, NULL, L"SHELLDLL_DefView", NULL);
                          if (hWndTmp)
                          {
                              SetWindowLongPtr(hWnd, -8, (LONG_PTR)hWndTmp);
                              return TRUE;
                          }
                      }
                      return FALSE;
                  }
                  

                  注意,这段代码比 保持窗口可见要好一些通过显示桌面"/Win+D,因为该窗口可能会被其他窗口(与任何其他窗口一样)溢出.使用 SetParent 将窗口置于所有其他窗口之下.

                  Note, this code is a bit better then from Keeping window visible through "Show Desktop"/Win+D because the window can be overflowed by other windows (like any other window). Using SetParent places window under all other windows.

                  这篇关于如何始终保持窗口可见,但不强制它位于顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Binding vs. x:Bind,默认使用 StaticResource 以及它们在 DataContext 中的区 下一篇:如何在 C# 中使用 WMI 查询从 UWF 获取注册表和文件排除项

                  相关文章

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

                    1. <tfoot id='F11Xg'></tfoot>
                    2. <small id='F11Xg'></small><noframes id='F11Xg'>

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