{"id":146,"date":"2019-07-16T10:09:44","date_gmt":"2019-07-16T02:09:44","guid":{"rendered":"http:\/\/zechs.taipei\/?p=146"},"modified":"2019-07-16T10:15:38","modified_gmt":"2019-07-16T02:15:38","slug":"c%e9%80%81%e5%87%ba%e7%89%b9%e5%ae%9a%e6%87%89%e7%94%a8%e7%a8%8b%e5%bc%8f%e7%9a%84%e9%8d%b5%e7%9b%a4%e4%ba%8b%e4%bb%b6%e6%8a%93chrome%e7%82%ba%e4%be%8b","status":"publish","type":"post","link":"https:\/\/zechs.taipei\/?p=146","title":{"rendered":"[C#]\u9001\u51fa\u7279\u5b9a\u61c9\u7528\u7a0b\u5f0f\u7684\u9375\u76e4\u4e8b\u4ef6(\u6293Chrome\u70ba\u4f8b)"},"content":{"rendered":"<p>\u672c\u7d00\u9304\u70ba\u5982\u4f55\u7531C#\u9032\u884c\u5176\u4ed6\u61c9\u7528\u7a0b\u5f0f\u5b58\u53d6<br>\u900f\u904eVisual studio \u63d0\u4f9b\u5de5\u5177 Spy++ \u6293\u53d6\u61c9\u7528\u7a0b\u5f0f\u985e\u5225\u53catitle<br>\u5728\u900f\u904euser32.dll\u9032\u884c\u5b58\u53d6<\/p>\n\n\n\n<p>Spy++\u662fVisual studio\u63d0\u4f9b\u7684\u5de5\u5177<br>\u76ee\u9304\u4f4d\u7f6e\u4f4d\u65bcVisual studio\u5b89\u88dd\u4e0b\u4f8b\u5982<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nC:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools\\spyxx.exe\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"586\" height=\"390\" src=\"http:\/\/zechs.taipei\/wp-content\/uploads\/2019\/07\/image.png\" alt=\"\" class=\"wp-image-148\" srcset=\"https:\/\/zechs.taipei\/wp-content\/uploads\/2019\/07\/image.png 586w, https:\/\/zechs.taipei\/wp-content\/uploads\/2019\/07\/image-300x200.png 300w\" sizes=\"(max-width: 586px) 100vw, 586px\" \/><\/figure>\n\n\n\n<p>\u5229\u7528\u641c\u5c0b\u5de5\u5177\uff0c\u9ede\u9078\u5f8c\u62d6\u66f3\u6ed1\u9f20\u627e\u5230\u4f60\u8981\u7684\u76ee\u6a19\u8996\u7a97<\/p>\n\n\n\n<p>\u79fb\u52d5\u6ed1\u9f20\u5230Chrome\u6642\u6703\u986f\u793a\u5982\u4e0b<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"322\" height=\"280\" src=\"http:\/\/zechs.taipei\/wp-content\/uploads\/2019\/07\/image-1.png\" alt=\"\" class=\"wp-image-159\" srcset=\"https:\/\/zechs.taipei\/wp-content\/uploads\/2019\/07\/image-1.png 322w, https:\/\/zechs.taipei\/wp-content\/uploads\/2019\/07\/image-1-300x261.png 300w\" sizes=\"(max-width: 322px) 100vw, 322px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u627e\u5230\u76ee\u6a19\u61c9\u7528\u7a0b\u5f0f\u8996\u7a97<\/h2>\n\n\n\n<p>\u547c\u53ebuser32.dll FindWindows<br>\u50b3\u5165\u90e8\u5206\u7684lpClassName\u5c31\u662fSpyxx\u6293\u5230\u7684\u985e\u5225<br>lpWindowName\u5c31\u662f\u6a19\u984c<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nDllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto)]\npublic static extern IntPtr FindWindow(&#x5B;MarshalAs(UnmanagedType.LPTStr)] string lpClassName, &#x5B;MarshalAs(UnmanagedType.LPTStr)] string lpWindowName);\n       \n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nIntPtr Handle = \nFindWindow(&quot;Chrome_WidgetWin_1&quot;,\n &quot;GOOGLE - Google \u641c\u5c0b - Google Chrome&quot;);\n\n<\/pre><\/div>\n\n\n<p>\u5176\u4e2dChrome_WidgetWin_1\u662fChrome\u7684\u985e\u5225<br>&#8220;GOOGLE &#8211; Google \u641c\u5c0b &#8211; Google Chrome&#8221;\u662f\u73fe\u5728\u5206\u9801\u7684\u540d\u7a31<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5224\u65b7\u662f\u5426\u6b63\u78ba\u6293\u53d6\u8996\u7a97<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nif (Handle == IntPtr.Zero)\n{\n    MessageBox.Show(&quot;Handle is not running.&quot;);\n    return;\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u5c07\u61c9\u7528\u7a0b\u5f0f\u5e36\u5230\u524d\u666f<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&#x5B;DllImport(&quot;USER32.DLL&quot;)]\npublic static extern bool SetForegroundWindow(IntPtr hWnd);\n<\/pre><\/div>\n\n\n<p>\u547c\u53ebSetForegroundWindow\u4f86\u5c07\u61c9\u7528\u7a0b\u5f0f\u5e36\u5230\u524d\u666f<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nSetForegroundWindow(Handle);\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u9001\u51fa\u9375\u76e4\u8cc7\u8a0a<\/h2>\n\n\n\n<p>\u8a18\u5f97\u547c\u53ebuser32.dll<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&#x5B;DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto)]\nstatic extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, uint lParam);\n<\/pre><\/div>\n\n\n<p>\u547c\u53eb\u51fd\u6578\u9001\u51fa<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nSendKeys.SendWait(&quot;{RIGHT}&quot;);\nSendKeys.SendWait(&quot;111&quot;);\nSendKeys.SendWait(&quot;*&quot;);\nSendKeys.SendWait(&quot;11&quot;);\nSendKeys.SendWait(&quot;=&quot;);\n<\/pre><\/div>\n\n\n<p>Key list \u6e05\u55ae\u5982\u4e0b<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.microsoft.com\/zh-tw\/dotnet\/api\/system.windows.forms.sendkeys.send?view=netframework-4.8\">https:\/\/docs.microsoft.com\/zh-tw\/dotnet\/api\/system.windows.forms.sendkeys.send?view=netframework-4.8<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c3\u8003\u9023\u7d50<\/h2>\n\n\n\n<p><a href=\"https:\/\/xiang1023.blogspot.com\/2017\/11\/c_6.html\">https:\/\/xiang1023.blogspot.com\/2017\/11\/c_6.html<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/mirlab.org\/jang\/books\/wsh\/sendKeys.asp?title=24-10%20%B6%C7%B0e%C1%E4%BDL%A8%C6%A5%F3\">http:\/\/mirlab.org\/jang\/books\/wsh\/sendKeys.asp?title=24-10%20%B6%C7%B0e%C1%E4%BDL%A8%C6%A5%F3<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u672c\u7d00\u9304\u70ba\u5982\u4f55\u7531C#\u9032\u884c\u5176\u4ed6\u61c9\u7528\u7a0b\u5f0f\u5b58\u53d6\u900f\u904eVisual studio \u63d0\u4f9b\u5de5\u5177 Spy++ \u6293\u53d6\u61c9\u7528\u7a0b\u5f0f\u985e\u5225\u53ca &#8230; <a title=\"[C#]\u9001\u51fa\u7279\u5b9a\u61c9\u7528\u7a0b\u5f0f\u7684\u9375\u76e4\u4e8b\u4ef6(\u6293Chrome\u70ba\u4f8b)\" class=\"read-more\" href=\"https:\/\/zechs.taipei\/?p=146\" aria-label=\"\u95b1\u8b80\u3008[C#]\u9001\u51fa\u7279\u5b9a\u61c9\u7528\u7a0b\u5f0f\u7684\u9375\u76e4\u4e8b\u4ef6(\u6293Chrome\u70ba\u4f8b)\u3009\u5168\u6587\">\u95b1\u8b80\u5168\u6587<\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-146","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/posts\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zechs.taipei\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=146"}],"version-history":[{"count":14,"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/posts\/146\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/posts\/146\/revisions\/162"}],"wp:attachment":[{"href":"https:\/\/zechs.taipei\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zechs.taipei\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zechs.taipei\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}