Restore Minimized Application (Login)

Asked

Viewed 611 times

0

I have an application in Delphi that the login screen appears before the main screen is actually created and opened during the Create of Mainform.

If user minimize application on login screen and try to restore application, it does not restore gets minimized in windows taskbar.

The right one would be it back to the login screen.

How to solve this?

1 answer

1


In the "Bordericons" property of the login form, just leave marked as "True" the parameters "biSystemMenu" and "biMinimize".

Still in the login form declare the following Procedure:

...
  private
    { Private declarations }
    procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
...

implementation

{$R *.dfm}

procedure TFrmLogin.WMSysCommand(var Message: TWMSysCommand);
begin
  if (message.cmdtype and $FFF0) = SC_MINIMIZE then
  begin
    EnableWindow(Application.handle, true);
    Application.Minimize;
  end else
    inherited;
end;

To Procedure causes the entire application to be minimized by minimizing the form, even if it has been called with "Showmodal".

Note: Because it is a Login screen, check well for security reasons if there are no other ways for the user to close the screen without proper authentication.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.