Jump to content
Sign in to follow this  
bnobre

Program "hides" behind the others

Recommended Posts

Hello everybody,

 

I'm having an unusual difficulty.

 

My system when opening checks if it has any updates, if so it opens an updater program that downloads a new version of it, loads the system again and closes.

 

The problem is that sometimes, for example, when opening the updater program, it hides behind other windows and the user is unaware that an update is being performed.

 

Or when it updates and opens the system again, it hides behind other windows and the user doesn't notice that the system has already opened. How do friends deal with this situation?

 

Thanks

Share this post


Link to post

you can try send this command after your task (updating app)...

//
// a sample using a Timer  but you can use only the commands: WindowState and SetForeGroundWindow()
//
procedure TForm1.FormCreate(Sender: TObject);
begin
  Timer1.Interval := 3000;
  Timer1.Enabled  := true;
  Caption         := 'Timer enabled...';
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Timer1.Enabled := false;
  //
  Self.WindowState := TWindowState.wsNormal;
  // SetWindowPos(Handle, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW);
  SetForeGroundWindow(Self.Handle);
  //BringWindowToTop(Application.Handle);
  Caption := 'restoring window state... all task concluded!';
end;

 

Share this post


Link to post

Personally, I would be fine with it being in the background while I wait for it to complete the update/restart.  At that point - I'd prefer a notification panel that would allow me to refocus the new window manually.

I really do not like apps that bring themselves to the foreground - for whatever reason. 

 

I am looking at you, configured to start-with-first-login Teams, Outlook, and Discord.

If I didn't initiate the starting of the app MANUALLY, I don't want it to grab my focus and keyboard input.

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×