0

I have a program operation that is initiated when a user is logged on, but it is long-running and non-interactive in nature, and could be completed in the background. I'm confused by the process lifecycle in windows.

Can any user process reliably continue to run (in the background) in the face of:

  • User signing out
  • Switching to a different account (without logoff)
  • User locking the screen
  • Power state switch (sleep/hibernate)

There exist programs that can restart automatically following a reboot/power cycle (e.g. Edge reopens its tabs after an automatic software update). Are those special cased, or are those simply regular programs hooking into some power-event API?

1 Answer 1

2

You’re asking several questions that aren’t necessarily related.

User processes run as the user. When the user signs out all those processes terminate.

Standby / hibernation / locking does not log a user out.

Some Windows applications save state and reopen after a reboot, making it possible to “resume” where you left off. Such as browser tabs.

VMs suspending are the same as a physical machine hibernating.

With that info you can deduce answers to all your different scenarios you asked about.

2
  • There's a missing piece perhaps with regards to switching between accounts. I seem to recall times where I could connect remotely with terminal services, and programs were still open. There are several software layers at play, and I'm not too sure how they fit! (e.g. console events and how they relate to process groups).
    – init_js
    Commented Jul 17, 2018 at 5:42
  • Would standby/hibernation/locking send any special signal to the application?
    – init_js
    Commented Jul 17, 2018 at 6:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .