This seems complicated... :)
that's why we need to simplify what we want to do ;-))
But, here's how I look at it:
If we start the program in our console, it makes use of it: xterm -e "wine myprog.exe" you say it should work just fine.
Now, in the case we start a console program from within Wine we do that when we execute: CreateProcess("myprog.exe") The way I see it is that in fact we're supposed to figure out that myprog.exe is a CUI app, and instead execute: CreateProcess("wineconsole myporg.exe") So, why can't we just do: CreateProcess("xterm -e 'wine myprog.exe'") instead?
this won't work, because CreateProcess passes from parent to child some context information the child get it from wineserver using its parent process id in your case, wine myprog.exe ppid will we xterm, not the parent process
A+