Oct 23, 2010 at 4:37pm UTC
hi,
I wrote a small C++-console program, which runs in the background and controls a Visual C#-application. It works fine, but the big black console disturbs me. I would like to start this c++ program with a console minimized to a symbol. Is that possible?
I would be grateful for any help...
Oct 23, 2010 at 5:16pm UTC
Does it need to be a console program?
Maybe you can just make a WinAPI program and just not create a window.
Oct 23, 2010 at 10:29pm UTC
yes you can make just WinAPI APP for it
Oct 24, 2010 at 2:59am UTC
I have the perfect solution, i used this in an earlier project. I was making a cute little keylogger for my pc.
This is only for windows**
1 2 3 4 5 6 7 8 9 10 11
void setConsoleVisibility(bool isVisible)
{
HWND hConsole;
AllocConsole();
hConsole = FindWindowA("ConsoleWindowClass" , NULL);
if (isVisible)
ShowWindow(hConsole, 1);
else
ShowWindow(hConsole, 0);
}
EDIT:
You have to include <windows.h>
Last edited on Oct 24, 2010 at 3:01am UTC
Oct 25, 2010 at 11:19am UTC
The solution proposed by Thumper proved really perfect in my case, thank you!