Delphi编程:QQ聊天记录怎样被记录下来(3)
中华网科技 http://tech.china.com
2005-07-25 10:37:44
|
|
|
begin MemFile:= OpenFileMapping(FILE_MAP_WRITE,False,HOOK_MEM_FILENAME);
if MemFile = 0 then
MemFile := CreateFileMapping($FFFFFFFF,nil,
PAGE_READWRITE,
0,
SizeOf(TShared),
HOOK_MEM_FILENAME);
Shared := MapViewOfFile(MemFile,
File_MAP_WRITE,
0,
0,
0);
end;
DLL_PROCESS_DETACH:
begin
//UninstallHook;
end;
else;
end;
end;
exports
InstallHook;
begin
DllProc := @DllEntry; DllEntry(DLL_PROCESS_ATTACH);
end.
//上述代码对卸载钩子没有加太多说明,它不属于此范围讨论之内.
演示程序代码
procedure TForm1.Button1Click(Sender: TObject);
begin
InstallHook;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
MemFile:= OpenFileMapping(FILE_MAP_WRITE,False,HOOK_MEM_FILENAME);
if MemFile = 0 then
MemFile := CreateFileMapping($FFFFFFFF,nil,
PAGE_READWRITE,
0,
SizeOf(TShared),
HOOK_MEM_FILENAME);
Shared := MapViewOfFile(MemFile,
File_MAP_WRITE,
0,
0,
0);
Shared^.MainWnd := Handle; //保存窗体句柄
end;
首页 上页 | 1 | 2 | 3 | 4 | 下页 尾页 共 4 页
|