unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, uallHook;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
var
origMoveWindow:
procedure (x: UINT;y: UINT; nWidth: UINT;nHeight: UINT;bRepaint: boolean);
stdcall;
newMoveWindow:
procedure (x: UINT;y: UINT; nWidth: UINT;nHeight: UINT;bRepaint: boolean);
stdcall;
implementation
{$R *.dfm}
procedure callback(x: UINT;y: UINT; nWidth: UINT;nHeight: UINT;bRepaint: boolean);
stdcall;
begin
ShowMessage(IntToStr(x)+'
|'+IntToStr(y)+'
|'+IntToStr(nWidth)+'
|'+IntToStr(nHeight));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
@origMoveWindow:=GetProcAddress(LoadLibrary('
user32.dll'),'
MoveWindow');
uallHook.HookCode(@origMoveWindow,@callback,@newMoveWindow);
MoveWindow(self.Handle,1,1,500,500,true);
//hier
uallHook.UnhookCode(@newMoveWindow);
end;
end.