unit Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Buttons, StdCtrls;
type
TForm1 = class(TForm)
SpeedButton1: TSpeedButton;
Edit4: TEdit;
procedure SpeedButton1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1 : TForm1;
implementation
{$R *.DFM}
procedure TForm1.SpeedButton1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
ptCursor : TPoint;
hWindow : DWord;
begin
repeat
Application.ProcessMessages;
GetCursorPos(ptCursor);
hWindow := WindowFromPoint(ptCursor);
Edit4.Text := IntToStr(GetWindowLong(hWindow,GWL_ID));
until GetAsyncKeyState(VK_LBUTTON) = 0;
end;
end.