Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 win32 console app with no window
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AnubisProgrammer




PostPosted: Wed Apr 19, 2006 7:53 am   Post subject: 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.
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Wed Apr 19, 2006 10:02 am   Post subject: (No subject)

if your code does not contain any outputs, then simply compile it and it shouldnt pop up the command prompt window
AnubisProgrammer




PostPosted: Wed Apr 19, 2006 11:00 am   Post subject: (No subject)

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




PostPosted: Wed Apr 19, 2006 12:22 pm   Post subject: (No subject)

what does it say on the output?
AnubisProgrammer




PostPosted: Wed Apr 19, 2006 5:46 pm   Post subject: (No subject)

well, to the screen there is no output, just a black screen. To the text file is just a letter.
Andy




PostPosted: Thu Apr 20, 2006 8:54 am   Post subject: (No subject)

what compiler is this?
Onega




PostPosted: Sun May 07, 2006 8:57 pm   Post subject: (No subject)

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




PostPosted: Sun May 07, 2006 9:36 pm   Post subject: (No subject)

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.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: