B
Ben
Hi, I've written a program (shex) that executes another program using
the
win32 ShellExecute() function, similar to what cygstart does for
cygwin (except without the argument length limit). For example, "shex
gvim" will start a new instance of gvim completely independently of
the parent shell.
An enhancement I would like to make is to be able to redirect the
stdin that my program (shex) receives to the stdin of the program
opened with ShellExecute(). This would enable me to do something like
"echo 'asdf' | shex gvim -", which would cause shex to take its stdin
('asdf') and redirect it to the new gvim process's stdin, which would
then be read by gvim into a new file (because of the '-' argument).
Obviously, I can read shex's stdin from within shex, but I have no
idea how to get a hold of the stdin of the spawned process from
ShellExecute() so I can write to it. Does anyone know how I can do
this? Also, it would be nice if I could simply perform some operations
on the stdin file descriptors themselves, rather than actually reading
and writing the stdin contents from my program, but I don't know how
to do that either. Any help is appreciated.
the
win32 ShellExecute() function, similar to what cygstart does for
cygwin (except without the argument length limit). For example, "shex
gvim" will start a new instance of gvim completely independently of
the parent shell.
An enhancement I would like to make is to be able to redirect the
stdin that my program (shex) receives to the stdin of the program
opened with ShellExecute(). This would enable me to do something like
"echo 'asdf' | shex gvim -", which would cause shex to take its stdin
('asdf') and redirect it to the new gvim process's stdin, which would
then be read by gvim into a new file (because of the '-' argument).
Obviously, I can read shex's stdin from within shex, but I have no
idea how to get a hold of the stdin of the spawned process from
ShellExecute() so I can write to it. Does anyone know how I can do
this? Also, it would be nice if I could simply perform some operations
on the stdin file descriptors themselves, rather than actually reading
and writing the stdin contents from my program, but I don't know how
to do that either. Any help is appreciated.