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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -