You have to use popen("appname","w") instead of system("appname"). Then with the handle returned by popen() you can fwrite() the keypress to the process's stdin. Call pclose() when done.
Edit: this may also work though I haven't tried it.
Try calling system("echo X | appname");
I'd be surprised if it doesn't work.
Last edited by randyding; 10-06-2006 at 11:38 PM.
|