2004-04-20 03:34:05 UTC
app is a CONSOLE app.
I previously posted a thread and got some good input, now I am continuing my
investigation of using AttachConsole() for a XP only solution.
See previous post: "Running a GUI app in CONSOLE mode, alternatives to
AttachConsole() and .com file"
I have a windows GUI subsystem app that normally runs as a windowed app.
The app can be driven using commandline parms.
If the app is invoked from a console, i.e. a command prompt, the app should
output to the command prompt window. (like a console app would do)
If the app is not invoked from a console, i.e. explorer, the app should
output nothing. (like a windows app would do if not displaying a window)
I created a test GUI app that in winmain calls
I launch the app from a command prompt.
Any text output is displayed in the command prompt.
But, I can continue typing in the command prompt, i.e. the AttachConsole()
did not take ownership of the console.
I used GetStdHandle(STD_INPUT_HANDLE) to get a handle to the input console.
I am using ReadConsoleInput() to capture keyboard events, but I am not
getting any key events from my attached console.
I also tried calling SetConsoleMode(), but I still do not receive any key
- How can I completely take over the parent console window?
- How can I get console input events?
- I assume that a command prompt that runs a console application waits for
the console app to terminate, but a command prompt that runs a windows app
does not wait. Is this correct?