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

    • <bdo id='b4jRJ'></bdo><ul id='b4jRJ'></ul>

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

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

      <tfoot id='b4jRJ'></tfoot>

        Teamviewers Quickconnect 按钮是如何实现的?

        时间:2023-09-19
        <tfoot id='FUByM'></tfoot>

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

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

                • 本文介绍了Teamviewers Quickconnect 按钮是如何实现的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  对于那些不知道我在说什么的人:http://www.teamviewer.com/images/presse/quickconnect_en.jpg

                  For those of you who do not know what I am talking about: http://www.teamviewer.com/images/presse/quickconnect_en.jpg

                  Teamviewer 将该按钮覆盖在所有窗口上,以便您可以快速与其他人共享一个窗口.我想要任何关于实现类似东西的想法——如果你有示例代码,甚至更好(特别是按钮——而不是共享).我对 C++ 和 QT 感兴趣……但如果有其他语言/库,我会对好的解决方案感兴趣.

                  Teamviewer overlays that button on all windows to allow you to quickly share a window with someone else. I would like any ideas on implementing something similar -- if you have example code, even better (specifically, the button -- not the sharing). I am interested in C++ and QT... but I would be interested in good solutions in other languages/libraries if there are any.

                  谢谢.

                  推荐答案

                  要在外部窗口中绘制按钮或其他东西,您需要将代码注入到外部进程中.检查 SetWindowsHookEx方法:

                  To draw buttons or other stuff in foreign windows, you need to inject code into the foreign processes. Check the SetWindowsHookEx method for that:

                  您很可能想为 WH_CALLWNDPROCRET 安装一个钩子并注意 WM_NCPAINT 消息.这将是绘制按钮的正确位置.但是,我不确定是否可以在非客户区中放置窗口,因此在最坏的情况下,您必须手动"绘制按钮.

                  You most probably want to install a hook for WH_CALLWNDPROCRET and watch out for the WM_NCPAINT message. This would be the right place to draw your button. However, I'm not really sure, if you can place a window within a Non-Client-Area, so in the worst case, you'd have to paint the button "manually".

                  只需从您的主应用程序(或从 DLL 中)调用它

                  Just call this from your main application (or from within a DLL)

                  SetWindowsHookEx(WH_CALLWNDPROCRET, myCallWndRetProc, hModule, 0);

                  请注意,myCallWndRetProc 必须驻留在 DLL 中,而 hModule 是此 DLL 的模块句柄.

                  Note that myCallWndRetProc must reside within a DLL and hModule is the Module-HANDLE for this DLL.

                  您的 myCallWndRetProc 可能如下所示:

                  Your myCallWndRetProc could look like:

                  LRESULT CALLBACK myCallWndRetProc(int nCode, WPARAM wParam, LPARAM lParam)
                  {
                      if (nCode == HT_ACTION) {
                          CWPRETSTRUCT* cwpret = (CWPRETSTRUCT*)lParam;
                          if (cwpret->message == WM_NCPAINT) {
                              // The non-client area has just been painted.
                              // Now it's your turn to draw your buttons or whatever you like
                          }
                      }
                      return CallNextHookEx(0, nCode, wParam, lParam);
                  }
                  

                  在开始实施时,我建议您只创建一个简单的对话框应用程序并仅挂钩您自己的进程:

                  When starting with your implementation, I'd suggest, you just create a simple dialog application and hook your own process only:

                  SetWindowsHookEx(WH_CALLWNDPROCRET, myCallWndRetProc, NULL, GetCurrentThreadId());
                  

                  安装全局钩子会将 DLL 注入所有进程,这使得调试变得非常困难,并且您的 DLL 在使用时可能会被写保护.

                  Installing a global hook injects the DLL into all processes, which makes debugging pretty hard, and your DLL may be write-protected while it's in use.

                  这篇关于Teamviewers Quickconnect 按钮是如何实现的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Windows C++:如何重定向 stderr 以调用 fprintf? 下一篇:模拟鼠标点击而不移动光标

                  相关文章

                  最新文章

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

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

                    1. <tfoot id='nxsk0'></tfoot>

                      • <bdo id='nxsk0'></bdo><ul id='nxsk0'></ul>