I want to know how to hide a console window when it starts.
It's for a keylogger program, but it's not my intention to hack someone. It's for a little school project that I want to make to show the dangers about hackers.
Here's my code so far:
#include <cstdlib>
#include <iostream>
#include <Windows.h>
using namespace std;
int main()
{
cout << "Note. This program is only created to show the risk of being unaware of hackers." << endl;
cout << "This program should never be used to actually hack someone." << endl;
cout << "Therefore this program will never be avaiable to anyone, except me." << endl;
FreeConsole();
system("PAUSE");
return 0;
}
I see the window appear and immediately disappear at startup. It seems to open a new console right after that, which is just blank. (By blank I mean "Press any key to continue.." I'm wondering if it has anything to do with system("PAUSE")
)
So I want to know why it opens a new console, instead of only creating and hiding the first one.
Thanks. :)