C++ How do i hide a console window on startup -
i want know how hide console window when starts.
i want honest , tell it's keylogger program, it's not intention hack someone. it's little school project want make, show dangers hackers. (i thought pretty cool show off in school.)
i hope me this.
so. here code wrote looking on google. (don't mind notes intentions.)
#include <cstdlib> #include <iostream> #include <windows.h> using namespace std; int main() { /* note. program created show risk of being unaware of hackers. * program should never used hack someone. * therefore program never avaiable anyone, except me. */ cout << "note. program created show risk of being unaware of hackers." << endl; cout << "this program should never used hack someone." << endl; cout << "therefore program never avaiable anyone, except me." << endl; freeconsole(); system("pause"); return 0; }
as can see, included windows.h , wrote freeconsole(); in main.
yes, see window appearing , disappear. seems open new console right after that, blank. (with blank, mean: "press key continue.." i'm thinking if has "system("pause")")
so wanna know why opens new console, instead of create , hide first one.
thanks. :)
so wanna know why opens new console, instead of create , hide first one.
a console application doesn't create console itself, runs in one. if run executable explorer, windows creates console run in. when call freeconsole
, doesn't close new console, detaches process it.
as whozcraig noted in comments, create regular windows application , don't create window.
Comments
Post a Comment