1

I have just started a course on the creation of keylogger and the first function I encountered was something to make the console disappear:

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

using namespace std;

int main() {
    MSG Msg;

    while (GetMessage(&Msg, NULL, 0, 0)) {
        TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }
}

The instructor is using Code Blocks and said that we will need to add a console flag "-mwindows" to the menu of console flags in Code Blocks, but I was not successful in finding neither the "console flag" nor an alternative option in Visual Studio.

Seymour
  • 64
  • 8
  • Project -> Properties -> C/C++. Also, if your instructor isn't using the Visual Studio compiler then the flags might be different. – eesiraed Jun 14 '20 at 04:36
  • @BessieTheCow is there a way to find a flag analogous to one used in Code Blocks for the Visual Studio? – Seymour Jun 14 '20 at 04:59
  • First of all, Code Blocks is an editor, not a compiler. The flags used depends on the compiler. You need to figure out what the flag does for whatever compiler your instructor is using and search up what flag does the same thing in Visual Studio. – eesiraed Jun 14 '20 at 05:06

1 Answers1

0

I have been digging around a little more, and found an answer here.

Since the purpose of the addition of the flag was to enable the option to stop the console from appearing, this solution is sufficient.

Seymour
  • 64
  • 8