If you use (I think) CreateProcess, then you can redirect STDOUT to your program.