Ich bin ich es doch noch einmal...

Zitat von
mkinzler:
ActiveContrlCaption:=(C as TButton).Caption;
... aber etwas Schwieriger wird es sein, wenn ich nicht weiß, ob es gerade TButton, TForm usw. ist oder?
Delphi-Quellcode:
...
Var
C,FLastActiveControl : TWinControl;
ActiveContrlClass,ActiveContrlName,
ActiveContrlCaption : String;
begin
...
FLastActiveControl:=Screen.ActiveControl;
...
{ Active controls }
if (FLastActiveControl <> nil) then
begin
C:=FLastActiveControl;
ActiveContrlClass:=C.ClassName;
ActiveContrlName :=C.Name;
ActiveContrlCaption:= (C as ???).Caption;
end;
...
end;
Gruß
Crowbar