Several applications on my PC have detected whether the restart was performed by Windows Update or not. This can be observed due to a restart after an automatic restart of Windows Update.
This is very useful because these applications reload changes, even unsaved changes or recovery tabs (in the case of a browser). Examples of applications that do this:
- Google chrome
- Microsoft Visual Studio
- Microsoft paint
In all cases, applications retain state which they were before rebooting.
(My computer really woke up from the standby state automatically and rebooted when updates were installed. Too bad that after that it did not return to standby mode.)
My question is: how do I programmatically detect such a reboot? It seems to be reliably detected before rebooting.
Question How can I get the last reason for restarting Windows, a duplicate may seem, but not a single answer said anything about the updates.
I am code in C #, so the answer to C # would be useful, although I could, for example, read C and C ++.
sinni800
source share