Is there any way to hide the command line window where the program runs on? I got a little program and I want to it to go hidden if user writes hide. Is there any way?

Recommended Answers

All 3 Replies

#include <windows.h>

int main()
{
   HWND hWnd = GetConsoleWindow();
   ShowWindow(hWnd,SW_HIDE);
}
commented: Useful! +1
commented: do u have such an easy solution 2 everything? +1

Thanks very much!!

#include <windows.h>

int main()
{
   HWND hWnd = GetConsoleWindow();
   ShowWindow(hWnd,SW_HIDE);
}

Wow I had no idea that was so easy! I might actually have use of that too, thanks ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.