-2

I am using this Code to hide the console window:

C++:

void Stealth() 
{ 
  HWND Stealth; 
  AllocConsole(); 
  Stealth = FindWindowA("ConsoleWindowClass", NULL); 
  ShowWindow(Stealth,0); 
}  

It is still showing for a second, so as a task it is very annoying. A tip was to create a Win32 GUI program with no GUI. I tried that, but by deleting some parts of the Visual Studio GUI example the code always got corrupt. Could you please provide an empty GUI program with everything removed, so I can use it?

Keshava GN
  • 4,195
  • 2
  • 36
  • 47
Marabunta
  • 45
  • 1
  • 7

1 Answers1

0

The question proposed for duplicate candidate explains how to create a program the does not need a console.

As an alternative, you could create a normal console application, and simply starts it from a shortlink and in the shortlink, you ask for a minimized window (shortlink tab).

It is not really a hiden window, since it exists in the task bar and can be reopened as normal, but I often prefer this. Because if things go wrong, it means that you can open it and look for possible messages, and when things go well, you hardly notice a new console icon in the task bar.

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252