久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

        <bdo id='XQAdB'></bdo><ul id='XQAdB'></ul>

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

        CreateWindow/CreateDialog 中的 HWND 可以從另一個線程獲

        Can the HWND from CreateWindow/CreateDialog be GetMessage#39;d from another thread?(CreateWindow/CreateDialog 中的 HWND 可以從另一個線程獲取 GetMessage 嗎?)
          <i id='OwPP2'><tr id='OwPP2'><dt id='OwPP2'><q id='OwPP2'><span id='OwPP2'><b id='OwPP2'><form id='OwPP2'><ins id='OwPP2'></ins><ul id='OwPP2'></ul><sub id='OwPP2'></sub></form><legend id='OwPP2'></legend><bdo id='OwPP2'><pre id='OwPP2'><center id='OwPP2'></center></pre></bdo></b><th id='OwPP2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OwPP2'><tfoot id='OwPP2'></tfoot><dl id='OwPP2'><fieldset id='OwPP2'></fieldset></dl></div>
            <tbody id='OwPP2'></tbody>

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

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

                  本文介紹了CreateWindow/CreateDialog 中的 HWND 可以從另一個線程獲取 GetMessage 嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  使用 Win32 API,是否可以在一個線程中創建一個窗口或對話框,然后從另一個線程為它收集事件?

                  HWND 是否與線程相關聯?

                  嘗試下面的人為示例,我從未看到 GetMessage() 觸發.

                  <前>HWND g_hWnd;DWORD WINAPI myThreadProc(LPVOID lpParam){while(GetMessage(&msg, hWnd, 0, 0) > 0){...}}int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MYDIALOG), 0, myDlgProc);CreateThread(NULL, 0 myThreadProc, NULL, 0, NULL);...}

                  但在這里,我愿意.

                  <前>HWND g_hWnd;HINSTANCE g_hInstance;DWORD WINAPI myThreadProc(LPVOID lpParam){hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MYDIALOG), 0, myDlgProc);while(GetMessage(&msg, hWnd, 0, 0) > 0){...}}int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){g_hInstance = hInstance;CreateThread(NULL, 0 myThreadProc, NULL, 0, NULL);...}

                  有人能解釋一下我看到了什么嗎?

                  解決方案

                  沒有

                  GetMessage 在當前線程的輸入隊列上返回消息.HWND 參數是一個過濾器,因此 GetMessage 只返回當前線程的輸入隊列中用于該窗口的消息.

                  Windows 具有線程關聯性 - 用于窗口的消息在創建并因此擁有該窗口的線程上得到處理.

                  Using the Win32 APIs, is it possible to create a Window or Dialog in one thread then collect events for it from another thread?

                  Are HWNDs tied to threads?

                  Trying the contrived example below I never see GetMessage() fire.

                  HWND g_hWnd;
                  
                  DWORD WINAPI myThreadProc(LPVOID lpParam)
                  {
                      while(GetMessage(&msg, hWnd, 0, 0) > 0)
                      {
                         ...
                      }
                  
                  }
                  
                  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) 
                  {
                      hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MYDIALOG), 0, myDlgProc);
                      CreateThread(NULL, 0 myThreadProc, NULL, 0, NULL);
                      ...
                  }
                  

                  But here, I do.

                  HWND g_hWnd;
                  HINSTANCE g_hInstance;
                  
                  DWORD WINAPI myThreadProc(LPVOID lpParam)
                  {
                      hWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MYDIALOG), 0, myDlgProc);
                  
                      while(GetMessage(&msg, hWnd, 0, 0) > 0)
                      {
                         ...
                      }
                  
                  }
                  
                  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) 
                  {
                      g_hInstance = hInstance;
                      CreateThread(NULL, 0 myThreadProc, NULL, 0, NULL);
                      ...
                  }
                  

                  Can somebody explain what I'm seeing?

                  解決方案

                  No.

                  GetMessage returns messages on the current thread's input queue. The HWND parameter is a filter, so that GetMessage only returns messages in the current thread's input queue intended for that window.

                  Windows have thread affinity - messages intended for a window get handled on the thread that created and therefore owns the window.

                  這篇關于CreateWindow/CreateDialog 中的 HWND 可以從另一個線程獲取 GetMessage 嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)
                  <tfoot id='MVLd2'></tfoot>
                    <tbody id='MVLd2'></tbody>
                1. <i id='MVLd2'><tr id='MVLd2'><dt id='MVLd2'><q id='MVLd2'><span id='MVLd2'><b id='MVLd2'><form id='MVLd2'><ins id='MVLd2'></ins><ul id='MVLd2'></ul><sub id='MVLd2'></sub></form><legend id='MVLd2'></legend><bdo id='MVLd2'><pre id='MVLd2'><center id='MVLd2'></center></pre></bdo></b><th id='MVLd2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='MVLd2'><tfoot id='MVLd2'></tfoot><dl id='MVLd2'><fieldset id='MVLd2'></fieldset></dl></div>
                  • <bdo id='MVLd2'></bdo><ul id='MVLd2'></ul>
                    • <small id='MVLd2'></small><noframes id='MVLd2'>

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

                            主站蜘蛛池模板: 天天综合网天天综合 | 日韩av免费在线观看 | 日韩免费视频一区二区 | 国产一区二区三区四区 | 欧美精品一区二区蜜桃 | 99精品一区二区 | 亚洲精品一二三 | 精品一区二区三区在线观看国产 | 一区二区视频在线观看 | 二区三区视频 | 成人国产综合 | 天堂一区 | 亚洲九色 | 国产一区欧美一区 | 嫩草黄色影院 | 亚洲欧美综合精品另类天天更新 | 一区二区三区视频在线 | 殴美黄色录像 | 中文字幕日本一区二区 | 一区二区在线免费观看 | 国产精品18hdxxxⅹ在线 | 91久久精品一区二区二区 | 欧美日韩精品 | 国产成人自拍av | 国产一区二区久久 | 精品入口麻豆88视频 | 老外几下就让我高潮了 | 国产精品视频在 | 99精品视频一区二区三区 | 色婷婷国产精品 | 欧美一区二区三区在线观看 | 精品国产乱码 | 欧美日韩在线播放 | 欧美激情a∨在线视频播放 成人免费共享视频 | 国产精品视频一二三区 | 欧美精品久久久久久久久老牛影院 | 成人av免费播放 | 日韩成人免费中文字幕 | 日韩在线免费观看视频 | 欧美精品乱码99久久影院 | 在线精品一区二区三区 |