Execute program, on windows shutdown/restart
Posted on 2003-11-17
I want to execute program just before windows shutdown or restart. I can trap WM_QUERYENDSESSION, but windows prevents executing programs at this point. I could prevent stutting down, wait a while, then execute the program and post shutdown message again, but I don't know exactly what was the event (shutdown, restart, end task...)
All I want to do is execute something(PostgreSQL stop bat file in this case) before restart or shutdown.