unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg;
type
TForm1 = class(TForm)
tmr1: TTimer;
Edit1: TEdit;
Edit: TEdit;
lbl1: TLabel;
lbl2: TLabel;
img1: TImage;
btn1: TButton;
Edit11: TEdit;
img2: TImage;
procedure tmr1Timer(Sender: TObject);
procedure img1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.tmr1Timer(Sender: TObject);
var
p: TPoint ;
hWin:THandle;
CN: PChar;
Title : string;
sLen : Integer;
begin
GetCursorPos(p);
hWin := WindowFromPoint(p);
Caption := 'THandle : ' + IntToHex(hWin,8);
GetMem(CN,250);
Windows.GetClassName(hWin,CN,250);
Edit1.Text := CN;
GetWindowText(hWin,PAnsiChar(Title),250);
Edit.Text := Title;
sLen := GetWindowTextLength(hWin);
SetLength(Title,sLen);
GetWindowText(hWin,PChar(Title),sLen + 1);
Edit.Text := Title;
end;
procedure TForm1.img1Click(Sender: TObject);
var
HandleWindow : THandle;
begin
HandleWindow := FindWindow('*****BuddyMain','');
ShowWindow(HandleWindow,SW_HIDE)
end;
end.