procedure TForm1.Button1Click(Sender: TObject);
var
hCurrentWindow: HWnd;
name,szText: array[0..254] of char;
begin
hCurrentWindow := GetActiveWindow();
; GetWindowText(hCurrentWindow, @szText, 255);
getclassname(hCurrentWindow,@name,255);
; Memo1.Lines.Add(StrPas(@szText));
; Memo1.Lines.Add(StrPas(@name));
end;