Bart Broersma mentioned this to All:
BB> Qestion: How do I display a simple messagebox like thing, without any
BB> buttons or other controls, that will display a message and will be
removed
BB> from the screen after some other task (copy files) is complete ?
BB> (Delphi 1.0)
interface
const
WM_STARTACTION = WM_USER + 101;
type
TMyForm = class(TForm)
...
procedure FormShow(Sender : TObject);
protected
procedure WMStartAction(var Msg : TMessage); message WM_STARTACTION;
end;
procedure DoIt;
implementation
procedure DoIt;
begin
with TMyForm.Create(Application) do
try
ShowModal;
finally
Free;
end;
end;
procedure TMyForm.FormShow(Sender : TObject);
begin
{ By using PostMessage, our form will receive
the message *after* all the other events, including
WM_PAINT, have been handled. }
PostMessage(Handle, WM_STARTACTION, 0, 0);
end;
procedure TMyForm.WMStartAction(Msg : TMessage);
begin
{ You can even put a message or progress bar on the form and
update it as needed. Don't forget to call
Application.ProcessMessages occasionally. }
OpenTheFiles;
CopyTheFiles;
CloseTheFiles;
Close; { the form }
end;
...Gary
--- GoldED 2.41
---------------
* Origin: The Flying Circus BBS, Farmington Hills, MI, USA. (1:2410/905)
|