
-----------------------------------
AnubisProgrammer
Wed Apr 19, 2006 7:53 am

win32 console app with no window
-----------------------------------
I'm tryign to make a win32 console app that won't pop up a window.  Someone told me that I could turn it into a service process or something to that effect?  Any advice on writing a program with no pop-up window would be appreciated.

-----------------------------------
Andy
Wed Apr 19, 2006 10:02 am


-----------------------------------
if your code does not contain any outputs, then simply compile it and it shouldnt pop up the command prompt window

-----------------------------------
AnubisProgrammer
Wed Apr 19, 2006 11:00 am


-----------------------------------
ya, with no cout statements I still get a command prompt.  I'm outputting to a text file but not to the screen, I'm not sure if that would affect it or not.

-----------------------------------
Andy
Wed Apr 19, 2006 12:22 pm


-----------------------------------
what does it say on the output?

-----------------------------------
AnubisProgrammer
Wed Apr 19, 2006 5:46 pm


-----------------------------------
well, to the screen there is no output, just a black screen.  To the text file is just a letter.

-----------------------------------
Andy
Thu Apr 20, 2006 8:54 am


-----------------------------------
what compiler is this?

-----------------------------------
Onega
Sun May 07, 2006 8:57 pm


-----------------------------------
There is no way to hide to command window, but there are workarounds. 
Method 1: Create an application with entry point WinMain, but you don't create a windows inside WinMain. The simplest way is to call main(...) inside winmain if you have access to source code of that console application.
Method 2: Create a windows application without a visible window, then start the console application and redirect its output to somewhere. You can refer to
http://support.microsoft.com/default.aspx?scid=kb;en-us;190351
http://www.codeproject.com/threads/consolepipe.asp

-----------------------------------
md
Sun May 07, 2006 9:36 pm


-----------------------------------
Umm... I'm pretty sure there is a way... and unless I _really_ don't remember anything it's as simple as a #define. 'Course I haven't done anything on windows in a long time and when I did I only got rid of the window once or twice... but I do know it can be done.
