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

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

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

      1. 如何獲取窗口的可執行文件名稱

        How to get the Executable name of a window(如何獲取窗口的可執行文件名稱)

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

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

                  <tfoot id='ru43u'></tfoot>
                  本文介紹了如何獲取窗口的可執行文件名稱的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我嘗試獲取所有已啟動窗口的可執行文件名稱,但我的問題是:

                  I try to get the name of executable name of all of my launched windows and my problem is that:

                  我用的方法

                  UINT GetWindowModuleFileName(      
                  HWND hwnd,
                  LPTSTR lpszFileName,
                  UINT cchFileNameMax);
                  

                  我不明白為什么它不起作用.

                  And I don't understand why it doesn't work.

                  關于窗口的數據是:
                  -HWND AND PROCESSID

                  Data which I have about a window are:
                  -HWND AND PROCESSID

                  錯誤是:例如:

                  HWND: 00170628 
                  ProcessId: 2336        
                  WindowTitle: C:	est.cpp - Notepad++
                  GetWindowModuleFileName():  C:	est.exe
                  
                  HWND: 00172138 
                  ProcessId: 2543        
                  WindowTitle: Firefox
                  GetWindowModuleFileName():  C:	est.exe
                  
                  HWND: 00120358 
                  ProcessId: 2436        
                  WindowTitle: Mozilla Thunderbird
                  GetWindowModuleFileName():  C:	est.exe
                  

                  注意:test.exe 是我的可執行文件的名稱,但它不是 Notepad++ 的完整路徑...它也適用于 Mozilla Thunderbird...我不明白為什么

                  Note: test.exe is the name of my executable file, but it is not the fullpath of Notepad++... and it make this for Mozilla Thunderbird too... I don't understand why

                  我使用這樣的函數:

                  char filenameBuffer[4000];
                  if (GetWindowModuleFileName(hWnd, filenameBuffer, 4000) > 0)
                  {
                      std::cout << "GetWindowModuleFileName(): " << filenameBuffer << std::endl;
                  }
                  

                  感謝您的回復.

                  推薦答案

                  GetWindowModuleFileName 函數僅適用于當前進程中的窗口.

                  The GetWindowModuleFileName function works for windows in the current process only.

                  您必須執行以下操作:

                  1. 使用檢索窗口進程GetWindowThreadProcessId.
                  2. 使用PROCESS_QUERY_INFORMATION和PROCESS_VM_READ訪問權限打開進程api/processthreadsapi/nf-processthreadsapi-openprocess" rel="noreferrer">OpenProcess.
                  3. 使用 GetModuleFileNameEx 在進程句柄上.
                  1. Retrieve the window's process with GetWindowThreadProcessId.
                  2. Open the process with PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights using OpenProcess.
                  3. Use GetModuleFileNameEx on the process handle.

                  如果您確實想獲取注冊窗口的模塊的名稱(而不是進程可執行文件),則可以使用 GetWindowLongPtrGWLP_HINSTANCE.然后可以將模塊句柄傳遞給前面提到的 GetModuleFileNameEx.

                  If you really want to obtain the name of the module with which the window is registered (as opposed to the process executable), you can obtain the module handle with GetWindowLongPtr with GWLP_HINSTANCE. The module handle can then be passed to the aforementioned GetModuleFileNameEx.

                  TCHAR buffer[MAX_PATH] = {0};
                  DWORD dwProcId = 0; 
                  
                  GetWindowThreadProcessId(hWnd, &dwProcId);   
                  
                  HANDLE hProc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ , FALSE, dwProcId);    
                  GetModuleFileName((HMODULE)hProc, buffer, MAX_PATH);
                  CloseHandle(hProc);
                  

                  這篇關于如何獲取窗口的可執行文件名稱的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 之間的區別)
                      <tbody id='YPk0L'></tbody>

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

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

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

                            主站蜘蛛池模板: 色婷婷激情综合 | 国产精品久久久久久久久久久免费看 | 影音先锋欧美资源 | 久久久久国产一区二区三区四区 | 亚洲一区二区免费 | 国产成人99久久亚洲综合精品 | 日韩一区二区在线视频 | 久久99国产精一区二区三区 | 久久久免费少妇高潮毛片 | 久久久久久久久99精品 | 国产亚洲精品精品国产亚洲综合 | 欧美性猛交一区二区三区精品 | 日韩中文字幕在线观看 | 九九在线精品视频 | 一区二区国产精品 | 国产精品美女在线观看 | 久久小视频 | 色99视频 | 成人美女免费网站视频 | 337p日韩 | 亚洲精品久久区二区三区蜜桃臀 | 亚洲国产一区二区三区在线观看 | 精品一区二区av | 日韩在线一区二区三区 | 久久午夜剧场 | 91亚洲国产成人久久精品网站 | 国产精品91视频 | 黄色福利 | 一区二区三区在线 | 久久久久欧美 | 中文字幕在线看 | 国产午夜久久久 | 成人一区二区三区在线观看 | 亚洲欧美一区二区在线观看 | 久久久久久亚洲精品 | 91在线视频在线观看 | 亚洲天堂av网 | 国产91一区二区三区 | 91伊人网 | 免费在线色 | 国产a级毛片 |