背景:
阅读新闻

如何记录QQ聊天记录

[日期:2008-12-17] 来源:  作者:admin [字体: ]
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;
收藏 推荐 打印 | 录入:admin | 阅读:
相关新闻      
本文评论   [发表评论]   全部评论 (1)
第 1 楼
sqzhao1会员 发表于 2010/1/16 9:38:51
uuuuuuuuu
热门评论