Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PROCESS.VCX (API_APPRUN)
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00225698
Message ID:
00226509
Views:
38
Dragan,

Thanks, I might try this when I get a chance.

When you say "The last three DWORDs of the STARTUPINFO structure can contain file handles to be passed to the new process to redirect the STDIN, STDOUT and STDERROR of the new process respectively." I assume that you mean to change the REPL(CHR(0),23) line below and insert the 4 byte string representing the handle as the third 4 byte string from the end. Is that right?
  cStartUpInfo = CHR(68) + ;
	        REPL(CHR(0),43) + ;
           	CHR(1) + ;
        	REPL(CHR(0),23)
The dwFlag that you talk about; Is this the dwCreatFlags parameter that is the 6th parameter in the statement below or is there a flag in the cStartInfo parameter created above?
 lResult = CrPr(	0, ;
	        cCommandLine, ;
        	0, 0, 0, 0, 0, ;
	        uFromDir, ;
        	@cStartUpInfo, ;
	        @cProcessInfo)
Thanks for the help. I'm a little out of my league when dealing with API calls.

You say "where I build the structure in the LaunchApp method.". I was wondering, since it is not signed, who shoud I be thanking for this wonderful class? You or Ed Rauh?

Ed

>With a little tweaking, you can redirect STDIN, STDERROR and STDOUT through the STARTUPINFO structure. The last three DWORDs of the STARTUPINFO structure can contain file handles to be passed to the new process to redirect the STDIN, STDOUT and STDERROR of the new process respectively. You'd need to open the source for STDIN in your process, set an additional bit in the STARTUPINFO dwFlags member to indicate that you wanted to override the stard I/O (you'd OR the current value of the dwFlags member with 0x0100), convert the handle to a DWORD (a 4 byte string representing an unsigned 32 bit integer integer) and put the DWORD into the STARTINFO structure at the correct offset in the structure. If you look at the source for API_APPRUN, you can see where I build the structure in the LaunchApp method.
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform