亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tut24.html

?? WINDOWS程序員使用指南--匯編基礎
?? HTML
?? 第 1 頁 / 共 4 頁
字號:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="lancelot">
   <meta name="GENERATOR" content="Mozilla/4.51 [en] (Win95; I) [Netscape]">
   <title>Iczelion's Win32 Assembly Tutorial 24: Windows Hooks</title>
</head>
<body text="#C0C0C0" bgcolor="#000000" link="#FFFF00" vlink="#C0C0C0" alink="#C0FFC0">

<center>
<h1>
<font face="Arial,Helvetica"><font color="#999900">Tutorial 24: Windows
Hooks</font></font></h1></center>
<font face="Arial,Helvetica"><font size=-1>We will learn about Windows
hooks in this tutorial. Windows hooks are very powerful. With them, you
can poke inside other processes and sometimes alter their behaviors.</font></font>
<br><font face="Arial,Helvetica"><font size=-1>Download the example <a href="files/tut24.zip">here</a>.</font></font>
<h3>
<font face="Arial,Helvetica"><font color="#CC6600">Theory:</font></font></h3>
<font face="Arial,Helvetica"><font size=-1>Windows hooks can be considered
one of the most powerful features of Windows. With them, you can trap events
that will occur, either in your own process or in other processes. By "hooking",
you tell Windows about a function, filter function also called hook procedure,
that will be called everytime an event you're interested in occurs. There
are two types of them: local and remote hooks.</font></font>
<ul>
<li>
<font face="Arial,Helvetica"><font size=-1><font color="#FFFF00">Local
hooks</font> trap events that will occur in your own process.</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><font color="#D9D900">Remote
hooks</font> trap events that will occur in other process(es). There are
two types of remote hooks</font></font></li>

<ul>
<li>
<font face="Arial,Helvetica"><font size=-1><font color="#FFFF00">thread-specific</font>&nbsp;
traps events that will occur in a specific thread in other process. In
short, you want to observe events in a specific thread in a specific process.</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><font color="#FFFF00">system-wide</font>&nbsp;
traps all events destined for all threads in all processes in the system.</font></font></li>
</ul>
</ul>
<font face="Arial,Helvetica"><font size=-1>When you install hooks, remember
that they affect system performance. System-wide hooks are the most notorious.
Since ALL related events will be routed through your filter function, your
system may slow down noticeably. So if you use a system-wide hook, you
should use it judiciously and unhook it as soon as you don't need it. Also,
you have a higher chance of crashing the other processes since you can
meddle with other processes and if something is wrong in your filter function,
it can pull the other processes down to oblivion with it. Remember: Power
comes with responsibility.</font></font>
<br><font face="Arial,Helvetica"><font size=-1>You have to understand how
a hook works before you can use it efficiently. When you create a hook,
Windows creates a data structure in memory, containing information about
the hook, and adds it to a linked list of existing hooks. New hook is added
in front of old hooks. When an event occurs, if you install a local hook,
the filter function in your process is called so it's rather straightforward.
But if it's a remote hook, the system must inject the code for the hook
procedure into the address space(s) of the other process(es). And the system
can do that only if the function resides in a DLL. Thus , if you want to
use a remote hook, your hook procedure must reside in a DLL. There is two
exceptions to this rule: journal record and journal playback hooks. The
hook procedures for those two hooks must reside in the thread that installs
the hooks. The reason why it must be so is that: both hooks deal with the
low-level interception of hardware input events. The input events must
be recorded/playbacked in the order they appeared. If the code of those
two hooks is in a DLL, the input events may scatter among several threads
and it is impossible to know the order of them. So the solution: the hook
procedure of those two hooks must be in a single thread only i.e. the thread
that installs the hooks.</font></font>
<br><font face="Arial,Helvetica"><font size=-1>There are 14 types of hooks:</font></font>
<ul>
<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_CALLWNDPROC</font></b>&nbsp;
called when SendMessage is called</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_CALLWNDPROCRET</font></b>&nbsp;
called when SendMessage returns</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_GETMESSAGE</font></b>&nbsp;&nbsp;
called when GetMessage or PeekMessage is called</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_KEYBOARD</font></b>&nbsp;
called when GetMessage or PeekMessage retrieves WM_KEYUP or WM_KEYDOWN
from the message queue</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_MOUSE</font></b>&nbsp;
called when GetMessage or PeekMessage retrieves a mouse message from the
message queue</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_HARDWARE</font></b>
called when GetMessage or PeekMessage retrieves some hardware message that
is not related to keyboard or mouse.</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_MSGFILTER&nbsp;</font></b>
called when a dialog box, menu or scrollbar is about to process a message.
This hook is local. It's specifically for those objects which have their
own internal message loops.</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_SYSMSGFILTER</font></b>&nbsp;
same as WH_MSGFILTER but system-wide</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_JOURNALRECORD</font></b>&nbsp;
called when Windows retrieves message from the hardware input queue</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_JOURNALPLAYBACK</font></b>&nbsp;
called when an event is requested from the system's hardware input queue.</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_SHELL</font></b>&nbsp;
called when something interesting about the shell occurs such as when the
task bar needs to redraw its button.</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_CBT</font></b>&nbsp;
used specifically for computer-based training (CBT).</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_FOREGROUNDIDLE</font></b>
used internally by Windows. Little use for general applications</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><b><font color="#999900">WH_DEBUG</font></b>&nbsp;
used to debug the hooking procedure</font></font></li>
</ul>
<font face="Arial,Helvetica"><font size=-1>Now that we know some theory,
we can move on to how to install/uninstall the hooks.</font></font>
<br><font face="Arial,Helvetica"><font size=-1>To install a hook, you call
SetWindowsHookEx which has the following syntax:</font></font>
<blockquote><b><font face="Arial,Helvetica"><font color="#009900"><font size=-1>SetWindowsHookEx
proto HookType:DWORD, pHookProc:DWORD, hInstance:DWORD, ThreadID:DWORD</font></font></font></b>
<ul>
<li>
<font face="Arial,Helvetica"><font size=-1><font color="#FFFF00">HookType</font>
is one of the values listed above, e.g., <b><font color="#999900">WH_MOUSE</font></b>,
<b><font color="#999900">WH_KEYBOARD</font></b></font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><font color="#FFFF00">pHookProc</font>
is the address of the hook procedure that will be called to process the
messages for the specified hook. If the hook is a remote one, it must reside
in a DLL. If not, it must be in your process.</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><font color="#FFFF00">hInstance</font>
is the instance handle of the DLL in which the hook procedure resides.
If the hook is a local one, this value must be NULL</font></font></li>

<li>
<font face="Arial,Helvetica"><font size=-1><font color="#FFFF00">ThreadID</font>&nbsp;
is the ID of the thread you want to install the hook to spy on. This parameter
is the one that determines whether a hook is local or remote. If this parameter
is NULL, Windows will interpret the hook as a system-wide remote hook that
affects all threads in the system. If you specify the thread ID of a thread
in your own process, this hook is a local one. If you specify the thread
ID from other process, the hook is a thread-specific remote one. There
are two exceptions to this rule: <b><font color="#999900">WH_JOURNALRECORD</font></b>
and <b><font color="#999900">WH_JOURNALPLAYBACK</font></b> are always local
system-wide hooks that are not required to be in a DLL. And <b><font color="#999900">WH_SYSMSGFILTER</font></b>
is always a system-wide remote hook. Actually it is identical to <b><font color="#999900">WH_MSGFILTER</font></b>
hook with ThreadID==0.</font></font></li>
</ul>
<font face="Arial,Helvetica"><font size=-1>If the call is successful, it
returns the hook handle in eax. If not, NULL is returned. You must save
the hook handle for unhooking later.</font></font></blockquote>
<font face="Arial,Helvetica"><font size=-1>You can uninstall a hook by
calling<b><font color="#FFFF00"> </font><font color="#009900">UnhookWindowsHookEx</font></b>
which accepts only one parameter, the handle of the hook you want to uninstall.
If the call succeeds, it returns a non-zero value in eax. Otherwise, it
returns NULL.</font></font>
<br><font face="Arial,Helvetica"><font size=-1>Now that you know how to
install/uninstall hooks, we can examine the hook procedure.</font></font>
<br><font face="Arial,Helvetica"><font size=-1>The hook procedure will
be called whenever an event that is associated with the type of hook you
have installed occurs. For example, if you install <b><font color="#999900">WH_MOUSE</font></b>
hook, when a mouse event occurs, your hook procedure will be called. Regardless
of the type of hook you installed, the hook procedure always has the following
prototype:</font></font>
<ul><b><font face="Arial,Helvetica"><font color="#009900"><font size=-1>HookProc
proto nCode:DWORD, wParam:DWORD, lParam:DWORD</font></font></font></b>
<br>&nbsp;
<ul>
<li>
<font face="Arial,Helvetica"><font size=-1><font color="#FFFF00">nCode</font>
specifies the hook code.</font></font></li>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜免费视频| 国产欧美一区二区三区鸳鸯浴 | youjizz久久| 高清久久久久久| 成人av免费在线| 日本乱码高清不卡字幕| 欧美日精品一区视频| 91精品国产aⅴ一区二区| 欧美精品在欧美一区二区少妇| 7777精品伊人久久久大香线蕉超级流畅| 91国内精品野花午夜精品 | 中文字幕五月欧美| 亚洲综合免费观看高清完整版| 首页国产丝袜综合| 国产成人在线视频网站| 一本到三区不卡视频| 日韩一级欧美一级| 中文字幕在线不卡一区二区三区| 一区二区三区产品免费精品久久75| 亚洲成av人片观看| 国产mv日韩mv欧美| 69av一区二区三区| 亚洲图片另类小说| 蜜臀va亚洲va欧美va天堂| 成人av综合在线| 8v天堂国产在线一区二区| 久久精品免视看| 图片区小说区国产精品视频| 成人激情免费视频| 精品卡一卡二卡三卡四在线| 欧美亚洲禁片免费| 日韩无一区二区| 亚洲精品综合在线| 91在线观看地址| 国产精品天天摸av网| 九九在线精品视频| 日韩视频永久免费| 久久机这里只有精品| 欧美日本一区二区三区四区| 婷婷亚洲久悠悠色悠在线播放 | 欧美成人激情免费网| 亚洲chinese男男1069| 色偷偷久久一区二区三区| 日韩精品亚洲一区二区三区免费| 激情小说欧美图片| 欧美一区二区视频网站| 怡红院av一区二区三区| 99精品视频在线观看| 日本一区免费视频| 高清在线不卡av| 国产精品免费aⅴ片在线观看| 亚洲综合无码一区二区| 91首页免费视频| 一区二区在线观看免费 | 欧美亚洲精品一区| 亚洲一区二区在线免费看| 91美女在线视频| 亚洲另类中文字| 91.com在线观看| 亚洲成av人片在线观看无码| 7777精品伊人久久久大香线蕉超级流畅 | 午夜视频久久久久久| 精品日韩成人av| 国产成人日日夜夜| 久久久精品天堂| 一本大道av一区二区在线播放| 一区二区三区波多野结衣在线观看| 欧美三级日韩三级| 青椒成人免费视频| 欧美tk—视频vk| 91视频精品在这里| 青草av.久久免费一区| 精品伦理精品一区| jlzzjlzz国产精品久久| 日本不卡一区二区| 国产精品女同互慰在线看| 欧美久久久久久蜜桃| 成人在线视频首页| 老司机精品视频一区二区三区| 国产精品久久久久天堂| 欧美一级搡bbbb搡bbbb| 成人免费视频国产在线观看| 日韩黄色片在线观看| 亚洲精品水蜜桃| 中文字幕一区二区三区av| 日韩欧美国产三级| 欧美疯狂性受xxxxx喷水图片| 99久久久精品免费观看国产蜜| 蜜桃视频免费观看一区| 亚洲成a人在线观看| 亚洲一区二区三区在线| 国产精品二区一区二区aⅴ污介绍| 一本久道久久综合中文字幕| 国产一区二区视频在线| 麻豆精品视频在线观看免费| 青青草原综合久久大伊人精品| 亚洲制服丝袜av| 日韩三级高清在线| 日韩欧美一级二级三级| 久久综合九色欧美综合狠狠| 久久亚洲捆绑美女| 久久亚洲精精品中文字幕早川悠里 | 成人午夜精品一区二区三区| 中文文精品字幕一区二区| 欧洲在线/亚洲| 欧美电影免费观看高清完整版在| 麻豆国产精品官网| 麻豆91在线播放免费| 久久精品999| av资源网一区| 91极品美女在线| 日韩三级av在线播放| 欧美一区二区三区日韩| 中文字幕一区二区三区精华液| 国产精品国产三级国产aⅴ无密码| 精品视频在线免费| 成人免费福利片| 国产一区二区女| 丁香六月综合激情| 91热门视频在线观看| 91在线视频免费91| 欧美一级视频精品观看| 亚洲人成在线观看一区二区| 久久疯狂做爰流白浆xx| 欧洲一区在线电影| 国产精品女同一区二区三区| 蜜桃久久精品一区二区| 成人免费毛片嘿嘿连载视频| 欧美午夜一区二区三区| 欧美激情艳妇裸体舞| 五月综合激情日本mⅴ| 99久久久久免费精品国产| 久久精品一区四区| 国产精品系列在线播放| 欧美一区二区在线免费播放| 中文字幕亚洲精品在线观看| 国产成人精品免费在线| 精品国产91久久久久久久妲己| 性做久久久久久免费观看 | 午夜欧美一区二区三区在线播放| 国内外精品视频| 精品国产青草久久久久福利| 亚洲成av人影院| 4438成人网| 激情六月婷婷综合| 久久亚洲一区二区三区明星换脸| 精品午夜一区二区三区在线观看| 在线不卡免费av| 日本伊人色综合网| 日韩免费一区二区三区在线播放| 亚洲美女一区二区三区| 欧美日韩久久久久久| 日本亚洲免费观看| 欧美精品一区二区三区一线天视频 | 国产精品久久久一本精品| 91视频一区二区三区| 亚洲1区2区3区4区| 久久久精品免费观看| 99国内精品久久| 日韩av电影免费观看高清完整版在线观看| 欧美日韩成人综合在线一区二区| 美国三级日本三级久久99| 欧美mv日韩mv国产网站| 东方aⅴ免费观看久久av| 亚洲精品一二三四区| 欧美色图12p| 男女男精品视频网| 亚洲欧美经典视频| 欧美激情综合五月色丁香| 91免费国产在线| 美国十次了思思久久精品导航| 国产精品视频在线看| 日韩女优av电影| 日韩欧美在线影院| 欧美本精品男人aⅴ天堂| 欧美一级视频精品观看| 日韩一区二区在线观看视频| 欧美精品 日韩| 日韩视频中午一区| 久久精品夜色噜噜亚洲a∨| 日韩午夜在线观看| 久久精品综合网| 一区二区三区欧美日韩| 亚洲精品第一国产综合野| 亚洲成a天堂v人片| 蜜桃av一区二区三区电影| 国产精品一线二线三线| 成人午夜看片网址| 欧美日韩一区二区在线观看 | 欧美激情一二三区| 亚洲成人免费视频| 国产精品一区二区三区乱码| a4yy欧美一区二区三区| 欧美专区亚洲专区| 久久久久久夜精品精品免费| 一区二区三区美女视频| 国产一区二区免费看| 欧美日韩高清一区二区不卡| 欧美大片免费久久精品三p| 国产精品免费视频一区|