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
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.