In Windows 11, Delphi 12.1, I have a simple Delphi VCL Application with only one button:
procedure TForm1.Button1Click(Sender: TObject);
begin
Application.Minimize;
ShowMessage('Test');
Application.Restore;
end;
Unfortunately, the application's Form is not restored. Only after clicking on the taskbar icon the form is restored.
How can I programmatically restore the Form after the ShowMessage
call?
EDIT:
In the meantime, I've found a very simple solution:
procedure TForm1.Button1Click(Sender: TObject);
begin
//Application.Minimize;
Application.MainForm.Visible := False;
ShowMessage('Test');
Application.MainForm.Visible := True;
//Application.Restore;
end;
However, the taskbar icon disappears when the ShowMessage
dialog is shown. How to avoid this?