.exe, .dll or .sys. CreateProcess WinAPI function will create a console window and attach STDIN, STDOUT and STDERR streams to the console. GetActiveWindow (Or ist it GetFocus()???). (Compare with GetForegroundWindow which reterns the window that currently is receiving input).