Non-close able program

How do you make a program that is not close able(Instead of just removing the X), Like not shown in Applications in the windows task manager, and access denied when you try to close it from the processes
Here is my existing code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//-----------------------------
#include <iostream>
#include <windows.h>
#include <string>
#include <ctime>

using namespace std;
//-----------------------------
void Delay( int secs )
{
  clock_t start = clock();
  clock_t end = clock();

  while( ( end - start )/CLOCKS_PER_SEC < secs )
  {
    end = clock();
  }
}

int main()
{
	int r = 0, f = 4;
int confirmexit = 0;
	RemoveMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);
	//Password that user types in
    string password ;
    const char correctpassword[] = "family";

	cout << "Enter Password: ";
    cin >> password;
    cout << "You typed " << password;

    system("pause>nul");
	cout << endl << endl << "Checking Password";
	cout << endl << "Press any key to continue";
	system("pause>nul");
    if(password == correctpassword)
    {
        cout << endl << endl << "Correct Password" << endl << endl;
    }
    else
    {
        while(password != correctpassword)
        {
			if(r == 3)
			{
			cout << "Too many failed attemps, you can enter your password in 5 minutes";
			Delay( 300 );
			f = 0;
			}
			f = 4;
			r += 1;
			f -= r;
            cout << endl << endl << "Incorrect Password, you have " << f << " Attempt(s) left";
            cout << endl << "Please type it again: ";
            cin >> password;
            if(password == correctpassword)		
            {
               cout << endl << "Correct Password";
            }
		}
	}
}


Please Help. BTW: I am not making trojans, so dont put irrelevant posts about wooden horses please.
confirm exit is not used, has been removed
Still no reply?
It's odd that you would complain when there's no reply, as you don't bother to thank people or respond to their advice when they do reply.
?
Yes I do most of the times...
Topic archived. No new replies allowed.