{"id":24852,"date":"2026-05-30T11:21:14","date_gmt":"2026-05-30T03:21:14","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=24852"},"modified":"2026-05-30T11:21:37","modified_gmt":"2026-05-30T03:21:37","slug":"%e7%99%be%e5%ba%a6%e7%bd%91%e7%9b%98","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=24852","title":{"rendered":"\u767e\u5ea6\u7f51\u76d8\u6709\u6bdb\u75c5\uff1f\u6b8b\u7559\u4e00\u4e2a\u767d\u6846\u3002"},"content":{"rendered":"<p>\u684c\u9762\u53f3\u4e0b\u89d2\u6b8b\u7559\u4e86\u4e00\u4e2a\u767d\u6846\uff0c\u4e0d\u662f\u7eaf\u89c6\u89c9\u6b8b\u7559\uff0c\u91cd\u542f Explorer \u8fd8\u5b58\u5728\uff0c\u662f\u786e\u5b9e\u6709\u4e2a\u6846\u4f53\u5728\u8fd9\u91cc\uff0c\u4f1a\u963b\u585e\u9f20\u6807\u64cd\u4f5c\u3002<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2026\/05\/image-1780110990231.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 572px; --smush-placeholder-aspect-ratio: 572\/254;\" \/><\/p>\n<p>\u7528 Google Gemini \u5199\u4e86\u4e00\u6bb5 C++ \u4ee3\u7801\uff0c\u8fd0\u884c\u540e\u5c06\u5149\u6807\u60ac\u505c\u5728\u7a97\u53e3\u4e0a\u53ef\u4ee5\u663e\u793a\u51fa\u7a97\u4f53\u4fe1\u606f<\/p>\n<pre><code class=\"language-cpp\">#include &lt;iostream&gt;\n#include &lt;windows.h&gt;\n#include &lt;psapi.h&gt;\n\nint main()\n{\n    setlocale(LC_ALL, &quot;chs&quot;);\n\n    while (true)\n    {\n        POINT pt;\n        if (GetCursorPos(&amp;pt))\n        {\n            HWND hWnd = WindowFromPoint(pt);\n            if (hWnd != NULL)\n            {\n                HWND hRootWnd = GetAncestor(hWnd, GA_ROOT);\n                if (hRootWnd != NULL)\n                {\n                    hWnd = hRootWnd;\n                }\n\n                wchar_t szClassName[256] = { 0 };\n                GetClassNameW(hWnd, szClassName, 256);\n\n                DWORD dwProcessId = 0;\n                GetWindowThreadProcessId(hWnd, &amp;dwProcessId);\n\n                \/\/ \u521d\u59cb\u5316\u8def\u5f84\u7f13\u51b2\u533a\n                wchar_t szProcessPath[MAX_PATH] = { 0 };\n\n                \/\/ \u5c1d\u8bd5\u83b7\u53d6\u8fdb\u7a0b\u53e5\u67c4\uff0c\u9700\u8981\u865a\u62df\u673a\u67e5\u8be2\u4e0e\u8bfb\u53d6\u6743\u9650\n                HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwProcessId);\n                if (hProcess != NULL)\n                {\n                    \/\/ \u83b7\u53d6\u5b8c\u6574\u8def\u5f84\n                    if (GetModuleFileNameExW(hProcess, NULL, szProcessPath, MAX_PATH) == 0)\n                    {\n                        wcscpy_s(szProcessPath, L&quot;\u65e0\u6cd5\u83b7\u53d6\u5b8c\u6574\u8def\u5f84 (\u6743\u9650\u4e0d\u8db3\u6216\u8c03\u7528\u5931\u8d25)&quot;);\n                    }\n                    CloseHandle(hProcess);\n                }\n                else\n                {\n                    \/\/ \u9488\u5bf9\u90e8\u5206\u7cfb\u7edf\u6838\u5fc3\u8fdb\u7a0b\uff0c\u62d2\u7edd\u8bbf\u95ee\u65f6\u5e38\u5907\u7684\u5907\u7528\u65b9\u6848\n                    hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, dwProcessId);\n                    if (hProcess != NULL)\n                    {\n                        DWORD dwSize = MAX_PATH;\n                        if (QueryFullProcessImageNameW(hProcess, 0, szProcessPath, &amp;dwSize) == 0)\n                        {\n                            wcscpy_s(szProcessPath, L&quot;\u62d2\u7edd\u8bbf\u95ee (\u65e0\u6cd5\u83b7\u53d6\u8def\u5f84)&quot;);\n                        }\n                        CloseHandle(hProcess);\n                    }\n                    else\n                    {\n                        wcscpy_s(szProcessPath, L&quot;\u62d2\u7edd\u8bbf\u95ee (\u65e0\u6cd5\u6253\u5f00\u8fdb\u7a0b\u53e5\u67c4)&quot;);\n                    }\n                }\n\n                std::wcout &lt;&lt; L&quot;\u5f53\u524d\u9f20\u6807\u5750\u6807: (&quot; &lt;&lt; pt.x &lt;&lt; L&quot;, &quot; &lt;&lt; pt.y &lt;&lt; L&quot;)&quot; &lt;&lt; std::endl;\n                std::wcout &lt;&lt; L&quot;\u7a97\u53e3\u53e5\u67c4 (HWND): 0x&quot; &lt;&lt; std::hex &lt;&lt; hWnd &lt;&lt; std::endl;\n                std::wcout &lt;&lt; L&quot;\u7a97\u53e3\u7c7b\u540d (Class): &quot; &lt;&lt; szClassName &lt;&lt; std::endl;\n                std::wcout &lt;&lt; L&quot;\u6240\u5c5e\u8fdb\u7a0b ID (PID): &quot; &lt;&lt; std::dec &lt;&lt; dwProcessId &lt;&lt; std::endl;\n                std::wcout &lt;&lt; L&quot;\u8fdb\u7a0b\u5b8c\u6574\u8def\u5f84: &quot; &lt;&lt; szProcessPath &lt;&lt; std::endl;\n                std::wcout &lt;&lt; L&quot;--------------------------------------&quot; &lt;&lt; std::endl;\n            }\n        }\n        Sleep(1000);\n    }\n\n    return 0;\n}<\/code><\/pre>\n<p>\u771f\u76f8\u5927\u767d\u4e86\uff0c\u8fd9\u73a9\u610f\u662f\u767e\u5ea6\u7f51\u76d8\u7684\u5f39\u7a97<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2026\/05\/image-1780110938736.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1106px; --smush-placeholder-aspect-ratio: 1106\/614;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u684c\u9762\u53f3\u4e0b\u89d2\u6b8b\u7559\u4e86\u4e00\u4e2a\u767d\u6846\uff0c\u4e0d\u662f\u7eaf\u89c6\u89c9\u6b8b\u7559\uff0c\u91cd\u542f Explorer \u8fd8\u5b58\u5728\uff0c\u662f\u786e\u5b9e\u6709\u4e2a\u6846\u4f53\u5728\u8fd9\u91cc\uff0c\u4f1a\u963b\u585e\u9f20\u6807\u64cd\u4f5c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":null,"zakra_menu_item_active_color":null,"zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,589,611,580,595],"tags":[1735,2140,2166,2167],"class_list":["post-24852","post","type-post","status-publish","format-standard","hentry","category-all","category-c-c","category-windows","category-580","category-595","tag-1735","tag-2140","tag-2166","tag-2167"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/24852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24852"}],"version-history":[{"count":2,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/24852\/revisions"}],"predecessor-version":[{"id":24856,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/24852\/revisions\/24856"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}