views:

69

answers:

2

I want to a create dialog box like window before displaying the console window. I haven't actually tried anything yet but was just wondering if it can be displayed as a start-up window.

A: 

I'm not sure, but if it's a windowed application already, it might be worth making your own console window to redirect standard IO. It'll certainly look nicer. If you want the exact behavior of the regular console, such as the same copy/paste, you'd have to reimplement it.

Matt Olenik
No don't have to reimplement anything - there's an API call for creating standard console windows.
Joe Gauterin
is regular console like cmd.exe?
Dave18
Yes, same appearance as cmd.exe
Joe Gauterin
+6  A: 

If you compile your win32 application as a console app, the console window will appear before you get a chance to do anything else.

To get around this, you need to use a windows application - this won't display a console window at all by default. Some time after startup you can then call AllocConsole to create a console window.

Joe Gauterin
Man that is so usefull, I have once, in the past, spent ages looking for this function call
Hassan Syed