S
smallmoneybags
Unregistered / Unconfirmed
GUEST, unregistred user!
function FMHookProc(Code: Integer; WParam: Longint; var Msg: TMsg): Longint; stdcall;
implementation
{$R *.dfm}
function FMHookProc(Code: Integer; WParam: Longint; var Msg: TMsg): Longint; stdcall;
begin
{
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_RBUTTONDOWN
WM_RBUTTONUP
}
if (msg.pt.x>form1.Left+form1.panel1.left+Form1.BarCodeCtrl1.left) and ( msg.pt.x< form1.Left+form1.panel1.left+form1.BarCodeCtrl1.left+Form1.BarCodeCtrl1.width) Then
if (msg.pt.y>form1.Top+form1.panel1.top+Form1.BarCodeCtrl1.top) and ( msg.pt.y< form1.Top+form1.panel1.top+form1.BarCodeCtrl1.top+Form1.BarCodeCtrl1.height) Then
Begin
if Msg.Message = WM_MOUSEMOVE then
with form1 do
begin
//Edit1.text := inttostr(msg.wParam);//做你要做的事
caption := format('Mouse Pos in the form:%d,%d',[msg.pt.x,msg.pt.y]);
end ;
if Msg.Message = WM_LBUTTONDOWN then
with form1 do
begin
label1.caption := format('Mouse Pos in the form:%d,%d',[msg.pt.x,msg.pt.y]);
end ;
if Msg.Message = WM_LBUTTONUP then
with form1 do
begin
label2.caption := format('Mouse Pos in the form:%d,%d',[msg.pt.x,msg.pt.y]);
end ;
end;
Result := CallNextHookEx(FMHook, Code, WParam, Longint(@Msg)); //放出消息给下一个.
end;
implementation
{$R *.dfm}
function FMHookProc(Code: Integer; WParam: Longint; var Msg: TMsg): Longint; stdcall;
begin
{
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_RBUTTONDOWN
WM_RBUTTONUP
}
if (msg.pt.x>form1.Left+form1.panel1.left+Form1.BarCodeCtrl1.left) and ( msg.pt.x< form1.Left+form1.panel1.left+form1.BarCodeCtrl1.left+Form1.BarCodeCtrl1.width) Then
if (msg.pt.y>form1.Top+form1.panel1.top+Form1.BarCodeCtrl1.top) and ( msg.pt.y< form1.Top+form1.panel1.top+form1.BarCodeCtrl1.top+Form1.BarCodeCtrl1.height) Then
Begin
if Msg.Message = WM_MOUSEMOVE then
with form1 do
begin
//Edit1.text := inttostr(msg.wParam);//做你要做的事
caption := format('Mouse Pos in the form:%d,%d',[msg.pt.x,msg.pt.y]);
end ;
if Msg.Message = WM_LBUTTONDOWN then
with form1 do
begin
label1.caption := format('Mouse Pos in the form:%d,%d',[msg.pt.x,msg.pt.y]);
end ;
if Msg.Message = WM_LBUTTONUP then
with form1 do
begin
label2.caption := format('Mouse Pos in the form:%d,%d',[msg.pt.x,msg.pt.y]);
end ;
end;
Result := CallNextHookEx(FMHook, Code, WParam, Longint(@Msg)); //放出消息给下一个.
end;