<br />
<b>Warning</b>:  Undefined array key "HTTP_ACCEPT_LANGUAGE" in <b>/www/wwwroot/01xj.net/wp-content/plugins/wp-ue/main.php</b> on line <b>13</b><br />
{"id":306,"date":"2012-07-25T13:14:25","date_gmt":"2012-07-25T13:14:25","guid":{"rendered":"http:\/\/www.01xj.net\/0\/?p=306"},"modified":"2012-07-25T13:14:25","modified_gmt":"2012-07-25T13:14:25","slug":"vb-%e7%94%a8%e5%85%a8%e5%b1%80%e9%92%a9%e5%ad%90%ef%bc%8c%e8%ae%b0%e5%bd%95%e9%bc%a0%e6%a0%87%e7%82%b9%e5%87%bb%e6%ac%a1%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.01xj.net\/?p=306","title":{"rendered":"VB \u7528\u5168\u5c40\u94a9\u5b50\uff0c\u8bb0\u5f55\u9f20\u6807\u70b9\u51fb\u6b21\u6570"},"content":{"rendered":"<div id=\"article_content\">\n<div>&#8216;\u9996\u5148\u7528\u5efa\u7acb\u4e00\u4e2a\u6807\u51c6Exe\u7a0b\u5e8f<\/div>\n<div>&#8216;\u628a\u7a97\u4f53\u540d\u79f0\uff0c\u8bbe\u5b9a\u4e3afrmMain<\/div>\n<div>&#8216;\u5728\u7a97\u4f53\u4e0a\u5efa\u7acb\u4e00\u7ec4\u6587\u672c\u6846\u6570\u7ec4\uff0c\u540d\u79f0\u4e3atxtMsg<\/div>\n<div>&#8216;txtMsg(0) &#8212; \u663e\u793a\u9f20\u6807\u5de6\u952e\u6309\u4e0b\u7684\u6b21\u6570<\/div>\n<div>&#8216;txtMsg(1) &#8212; \u663e\u793a\u9f20\u6807\u4e2d\u952e\u6309\u4e0b\u7684\u6b21\u6570<\/div>\n<div>&#8216;txtMsg(2) &#8212; \u663e\u793a\u9f20\u6807\u53f3\u952e\u6309\u4e0b\u7684\u6b21\u6570<\/div>\n<div>&#8216;txtMsg(3) &#8212; \u663e\u793a\u9f20\u6807\u6309\u4e0b\u7684\u603b\u6b21\u6570<\/div>\n<p>\u00a0&#8216;\u9996\u5148\u5efa\u7acb\u4e00\u4e2aModule,\u5e76\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801<\/p>\n<div>\u00a0Public Declare Function SetWindowsHookEx Lib &#8220;user32&#8221; Alias &#8220;SetWindowsHookExA&#8221; (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long<br \/>\nPublic Declare Function UnhookWindowsHookEx Lib &#8220;user32&#8221; (ByVal hHook As Long) As Long<\/div>\n<div>\n<p>Public Declare Function CallNextHookEx Lib &#8220;user32&#8221; (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long<br \/>\nPublic Declare Sub CopyMemory Lib &#8220;kernel32&#8221; Alias &#8220;RtlMoveMemory&#8221; (lpvDest As Any, ByVal lpvSource As Long, ByVal cbCopy As Long)<\/p>\n<p>Public Type MOUSEMSGS<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X As Long\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;x\u5ea7\u6807<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Y As Long\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;y\u5ea7\u6807<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a As Long<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 b As Long<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 time As Long\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;Window\u8fd0\u884c\u65f6\u95f4<br \/>\nEnd Type<\/p>\n<p>\u00a0Public Const WH_MOUSE_LL = 14<\/p>\n<p>&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n&#8216;\u6d88\u606f<br \/>\nPublic Const HC_ACTION = 0<\/p>\n<p>&#8216;\u9f20\u6807\u6d88\u606f<br \/>\nPublic Const WM_MOUSEMOVE = &amp;H200<br \/>\nPublic Const WM_LBUTTONDOWN = &amp;H201<br \/>\nPublic Const WM_LBUTTONUP = &amp;H202<br \/>\nPublic Const WM_LBUTTONDBLCLK = &amp;H203<br \/>\nPublic Const WM_RBUTTONDOWN = &amp;H204<br \/>\nPublic Const WM_RBUTTONUP = &amp;H205<br \/>\nPublic Const WM_RBUTTONDBLCLK = &amp;H206<br \/>\nPublic Const WM_MBUTTONDOWN = &amp;H207<br \/>\nPublic Const WM_MBUTTONUP = &amp;H208<br \/>\nPublic Const WM_MBUTTONDBLCLK = &amp;H209<br \/>\nPublic Const WM_MOUSEACTIVATE = &amp;H21<br \/>\nPublic Const WM_MOUSEFIRST = &amp;H200<br \/>\nPublic Const WM_MOUSELAST = &amp;H209<br \/>\nPublic Const WM_MOUSEWHEEL = &amp;H20A<\/p>\n<p>Public MouseMsg As MOUSEMSGS<br \/>\nPublic lHook As Long &#8216;\u8bb0\u5f55Hook\u7684\u503c\uff0c\u4ee5\u4fbf\u9000\u51fa\u7a0b\u5e8f\u7684\u65f6\u5019\u9500\u6bc1Hook<br \/>\nPublic lClick As Long, mClick As Long, rClick As Long, tClick As Long &#8216;\u7528\u6765\u7edf\u8ba1\u9f20\u6807\u5404\u4e2a\u952e\u7684\u6309\u4e0b\u6b21\u6570<br \/>\n&#8216;\u9f20\u6807\u94a9\u5b50<br \/>\nPublic Function CallMouseHookProc(ByVal code As Long, ByVal wParam As Long, ByVal lParam As Long) As Long<\/p>\n<p>\u00a0If code = HC_ACTION Then<br \/>\n\u00a0\u00a0\u00a0 CopyMemory MouseMsg, lParam, LenB(MouseMsg)<\/p>\n<p>\u00a0\u00a0\u00a0 frmMain.Caption = &#8220;X=&#8221; + Str(MouseMsg.X) + &#8221; Y=&#8221; + Str(MouseMsg.Y)&#8217;\u5728\u4e3b\u7a97\u53e3\u4e0a\u663e\u793a\u9f20\u6807\u7684\u5f53\u524d\u4f4d\u7f6e<\/p>\n<p>\u00a0\u00a0\u00a0 Select Case wParam &#8216;\u6839\u636e\u4e0d\u540c\u9f20\u6807\u52a8\u4f5c\u8fdb\u884c\u5904\u7406\uff0c\u5728\u8fd9\u91cc\u53ea\u5904\u7406\u4e86\u9f20\u6807\u6309\u4e0b\u7684\u52a8\u4f5c<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Case WM_LBUTTONDOWN &#8216;\u5de6\u952e\u6309\u4e0b<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lClick = lClick + 1\u00a0 &#8216;\u8fdb\u884c\u7edf\u8ba1\uff0c\u5e76\u663e\u793a\u5728\u4f4f\u7a97\u4f53\u7684\u6587\u672c\u6846\u4e0a<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tClick = tClick + 1<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 frmMain.txtMsg(0).Text = lClick<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 frmMain.txtMsg(3).Text = tClick<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CallMouseHookProc = 0 &#8216;\u8fd9\u91cc\u628a\u8fd4\u56de\u503c\u8bbe\u5b9a\u4e3a0\uff0c\u4fdd\u8bc1\u9f20\u6807\u52a8\u4f5c\u6b63\u5e38\u5b8c\u6210<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Case WM_MBUTTONDOWN &#8216;\u4e2d\u952e\u6309\u4e0b<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mClick = mClick + 1<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tClick = tClick + 1<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 frmMain.txtMsg(1).Text = mClick<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 frmMain.txtMsg(3).Text = tClick<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CallMouseHookProc = 0<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Case WM_RBUTTONDOWN &#8216;\u53f3\u952e\u6309\u4e0b<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rClick = rClick + 1<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tClick = tClick + 1<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 frmMain.txtMsg(2).Text = rClick<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 frmMain.txtMsg(3).Text = tClick<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CallMouseHookProc = 0<br \/>\n\u00a0\u00a0\u00a0 End Select<br \/>\n\u00a0<br \/>\nEnd If<\/p>\n<p>If code &lt;&gt; 0 Then<br \/>\n\u00a0\u00a0\u00a0 CallMouseHookProc = CallNextHookEx(0, code, wParam, lParam) &#8216;\u4f7f\u7528CallNextHookEx\uff0c\u6765\u4fdd\u8bc1\u9f20\u6807\u94a9\u5b50\u80fd\u591f\u88ab\u5176\u5b83\u7a0b\u5e8f\u4f7f\u7528<br \/>\nEnd If<br \/>\n\u00a0<br \/>\nEnd Function<\/p>\n<p>\u00a0&#8216;\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u518d\u7ed9\u7a97\u4f53\u91cc\u9762\u6dfb\u52a0\u4ee3\u7801<\/p>\n<p>\u00a0Private Sub AddHook()\u00a0 &#8216;\u5b89\u88c5\u9f20\u6807\u94a9\u5b50<br \/>\n\u00a0 lHook = SetWindowsHookEx(WH_MOUSE_LL, AddressOf CallMouseHookProc, App.hInstance, 0)<br \/>\nEnd Sub<br \/>\nPrivate Sub DelHook()&#8217;\u5378\u9664\u9f20\u6807\u94a9\u5b50<\/p>\n<p>\u00a0 UnhookWindowsHookEx lHook<br \/>\nEnd Sub<\/p>\n<p>Private Sub Form_Load() &#8216;\u7a97\u4f53\u8f7d\u5165\u7684\u65f6\u5019\uff0c\u5b89\u88c5\u9f20\u6807\u94a9\u5b50<br \/>\n\u00a0\u00a0\u00a0 AddHook<br \/>\nEnd Sub<\/p>\n<p>Private Sub Form_Unload(Cancel As Integer)&#8217;\u7a97\u4f53\u5378\u8f7d\u7684\u65f6\u5019\uff0c\u5378\u9664\u9f20\u6807\u94a9\u5b50<br \/>\n\u00a0\u00a0\u00a0 DelHook<br \/>\nEnd Sub<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&#8216;\u9996\u5148\u7528\u5efa\u7acb\u4e00\u4e2a\u6807\u51c6Exe\u7a0b\u5e8f &#8216;\u628a\u7a97\u4f53\u540d\u79f0&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-vb"],"_links":{"self":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306"}],"version-history":[{"count":1,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":307,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions\/307"}],"wp:attachment":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}