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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -