Hallo,
bei uns gab's mal Bedarf nach einem showmessage, das auch ohne drücken des OK-Buttons irgendwann wieder verschwand. Das wäre vllt. etwas ähnliches wie das was du brauchst? Ist aber schon ewig alt und bei uns nicht mehr in Gebrauch.
Delphi-Quellcode:
interface
type
TFWarnMessage = class(TForm)
Label: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
public
procedure ShowWarning(msg: string; title: string);
end;
TWarn = class(TThread)
private
Warning: TFWarnMessage;
protected
procedure Execute; override;
public
constructor Create(msg, title: string);
end;
implementation
procedure TFWarnMessage.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action := caFree;
end;
procedure TFWarnMessage.ShowWarning(msg, title: string);
begin
Caption := title;
Label.Caption := msg;
Width := Label.Width + (2 * Label.Left);
ClientHeight := Label.Height + (2 * Label.Top);
left := random(Screen.Width - Width);
top := random(Screen.Height - Height);
Show;
Application.ProcessMessages;
end;
constructor TWarn.Create(msg, title: string);
begin
inherited Create(true);
Randomize;
FreeOnTerminate := true;
Warning := TFWarnMessage.Create(Application);
Warning.ShowWarning(msg, title);
Resume;
end;
procedure TWarn.Execute;
begin
inherited;
Sleep(5000);
Warning.Close;
Warning.Free;
Terminate;
end;