ANIT-shutdown

Put your programming skills to the test in these challenges.

ANIT-shutdown

Post by 323LORDofWAR323 on Sun Mar 17, 2013 7:49 pm
([msg=74592]see ANIT-shutdown[/msg])

I know the system command in C++ to abort shutdown is
system("shutdown.exe -a")

what im wondering:
Write a program that i run on startup, and i someone attempts to shut my computer down, this program will stop them.
so far ive got this:


#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
int a=1;

while(a=1)
{
system("shutdown.exe -a");
}
}

Is there a better way to do what I'm trying to do. LOL i know there is help me out guys
This works...but eventually it stops responding. Is there a way to intercept the shutdown command before it is implimented, and a way to accomplish my goal without munching so much RAM

Any help appreciated :mrgreen:
323LORDofWAR323
New User
New User
 
Posts: 8
Joined: Fri Mar 08, 2013 7:56 pm
Blog: View Blog (0)


Re: ANIT-shutdown

Post by static_cast on Tue Apr 09, 2013 3:52 pm
([msg=75015]see Re: ANIT-shutdown[/msg])

http://stackoverflow.com/questions/9813 ... restarting
That may help. [In my might there may be some sort of DLL thing you could do.
static_cast
New User
New User
 
Posts: 1
Joined: Tue Apr 09, 2013 3:45 pm
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests