Restore minimized application (Login)

0

I have an application in Delphi that the login screen appears before the main screen, it is actually created and opened during the Create MainForm >.

If the user minimizes the application on the login screen and tries to restore application, it does not restore gets minimized in the windows taskbar.

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

How to solve this?

    
asked by anonymous 14.11.2017 / 17:51

1 answer

1

In the "BorderIcons" property of the login form, just set the "biSystemMenu" and "biMinimize" parameters to "True".

Also 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;
The 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, please check for security reasons if there are no other ways to close the screen without proper authentication.

    
15.11.2017 / 04:14