I don't know of a way to simulate that, but what I do is have a VM (I used VMware Player Free) and have WinXP, Win7, & Win8 VM's so I can load one up to test a program on that version of Windows since my main machine is Win10. That being said you can use the VM to test a program that does something when Windows shuts down or logs off because it's super easy to let the VM shut down/restart without disrupting you on your actual computer nor do you have to buy another computer just for testing.If I have build an application using visual studio that do something when some system event happens, how can I simulate such system events so that I can debug the application?