PDA

View Full Version : Accessing keyboard input in child process



GTBuilder
22nd January 2008, 16:04
This is a first post from an absolute newbie so sorry if it's really a trivial question.

I support a group of volunteer senior citizens who have limited computer skills and seldom back up their work. I want to build an app to send a few bytes to a child app as if the user had hit the F2 key. Child app is a Windows program that I have no control over.

I launch the child from a simple widget using


process.setWorkingDirectory(...);
process.start( ....);

and then


QTimer::singleShot( 120000, this, SLOT(sendText()));

void myApp::sendText()
{
if( process.state() == 2)
{

}

Child app gets stated ok. Problem is how to send the bytes. I've tried putChar and write() but nothing seems to get to the child process, which has keyboard focus as user is entering data.