replacing the default console emulator under Windows XP
Solution 1:
I'm an author of ConEmu - Windows console emulator. One of its features is capturing to its tab existing consoles or simple GUI applications. So, after starting console program in standard console (CSRSS/ConHost), you may:
-
In the ConEmu system menu, choose "Attach..." item (Win+G by default) and choose attaching window. If ConEmu was not started, you may optionally start it without creating console/tab on startup:
C:\Tools\ConEmu.exe /detached
-
Or, if applicable, run in the started console the following command (ConEmu\Attach.cmd) which initiates attaching from console side. Note, in that case, ConEmu.exe (GUI) will be started automatically, if not already exists.
ConEmuC.exe /ATTACH /NOCMD
-
There is one more way. I think it doesn't match your requirements, however I'll disclose it. There is a key in the registry, which contents cmd/tcc executes after console startup. While you are starting
consoleapp.exe
, notcmd.exe
, this miss. There isCmd_Autorun.cmd
file in ConEmu distrib to install/uninstall this command.[HKEY_CURRENT_USER\Software\Microsoft\Command Processor] "AutoRun"="\"<Command to be executed>\""
There is a tag here, on Superuser.com
UPD. Build 120704. Alternative nonintrusive attach mode for console windows.
UPD2. Build 121128. It is possible to intercept "creation of console window" from specified (by user) applications, for example explorer.exe,vcexpress.exe
. Read more about this intrusive experimental feature.
Solution 2:
You can't. Win32 consoles always use the built-in console windows provided by CSRSS.