I’ll try to explain my problem, bear with me

I’m working on a windows version of SE (windows 7 32-bit to be exact)
I have a macro that runs a shell program, lets call it X, and using pipe to catch it’s output,
using the following syntax:
PIPE_INFO pipeInfo;
pipeInfo.processHandle=_PipeProcess(X, pipeInfo.processStdoutPipe, pipeInfo.processStdinPipe, pipeInfo.processStderrPipe,"");
On the new version of program X, the program calls anohter program (a java_launcher), let’s call it program Y where all the interesting stuff is happening
When I run the macro, I get a cmd window with the java_launcher, nothing on the pipe and in the end a cmd window that needs to be closed manually.
The reason I’m asking this question here, is because when I run program X from cmd (with the exact same syntax), I see the output of Y in the cmd as if it is still the same command (and no indication about the double processes).
Maybe there is a way to make SE pipe to do the same? Maybe a flag I should use? something else?
(the documentation for PipeProcess is scarce)