这个是判断窗体是不是打开然后开启键盘记录的源码,请帮忙看下哪里是不是错了?
procedure TForm1.Button1Click(Sender: TObject);
var
zbwnd,qtwnd:hwnd; //声明变量时,不能用“ := ”,只要一个冒号“:”
st:string;
begin
st:='hao123--我的上网主页 - Microsoft Internet Explorer'; //分号要用英文符号
zbwnd:=findwindow(nil,pchar(st));
qtwnd:=GetForegroundWindow;
if zbwnd = qtwnd then
begin
if LogHook = 0 then
begin
LogHook:=SetWindowsHookEx(WH_JOURNALRECORD,LogProc,HInstance,0);
end;
end;
end;
楼上的 你把键盘 记录的源码 发上来了 我的目的是 给 运行 这个键盘记录加个条件!
哪里报错?声明指针?
这问题是什么意思?
完整源码发上来了,帮忙看下吧!是哪里出了问题!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
KeyMask = $80000000;
var
Form1: TForm1;