winapi - How to write a program that stops the shutdown process by C? -
programs notepad can stop computer shutdown process when files not saved. how can write program stops shutdown process (in c)?
for windows vista , above there exists fuction defined in user32.dll (user32.lib) called "shutdownblockreasoncreate".
takes 2 parameters:
- handle of window
- string representing message displayed
if call succeeds application block windows shutting down.
powerful function , should not abused!
Comments
Post a Comment