I have a Visual C++ console application (I am using windows Vista, Visual studio 2008). When executing the program i don't want to see the Console popping up. How do i code this.

I tried simply removing all cout and printf statements but yet this didn't help.

Need help here.

Recommended Answers

All 3 Replies

this might help you out

Or much more simple you could create a main win32 project and not define or register a window class:

int __stdcall WInMain (HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR szCmdArg,INT nCmdShow)  {
//code here
   MessageBox (NULL,"Output",NULL,MB_OK); //output stuff
 }

or just hide the window

#include <windows.h>
int main()
{
   HWND hWnd = GetConsoleWindow();
   ShowWindow(hWnd,SW_HIDE);
}
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.