Page 1 of 1

SendKeys to cmd.exe When PUB is always OnTop?

PostPosted: Sat Dec 02, 2006 8:34 pm
by phlm
Is there a way or workaround to use the SendKeys command to an application running behind my PUB that is alway on top and in full screen mode?

I've tried hpwSendKeysToHandle which works in demo mode but after compiling it no longer works.

Thanks for any help on this.

PostPosted: Sun Dec 03, 2006 1:24 am
by HPW
I've tried hpwSendKeysToHandle which works in demo mode but after compiling it no longer works.


Which neobook version? (NB5 demo mode is quite similar to compiled)
Demo mode does not make a difference.
Where do you get the handle from? Is it valid?

PostPosted: Sun Dec 03, 2006 12:20 pm
by phlm
Hi HPW!
I'm using NB 5.5.2a.
And I look up the handle via hpwFindaWindow. In regards to it being the right handle I don't know. Should cmd.exe come up with the same handle each time?

Thanks

PostPosted: Sun Dec 03, 2006 2:14 pm
by HPW
Should cmd.exe come up with the same handle each time?


Definatly not. Windows set the handles everytime new.

PostPosted: Sun Dec 03, 2006 2:26 pm
by phlm
Hi Hans-Peter,
Well I run hpwFindaWindow before I do a hpwSendKeysToHandle so I'm OK there...
Still can't get the pub to run correctly after compile.

PostPosted: Sun Dec 03, 2006 11:25 pm
by HPW
Take the hpwSendkeys demo pub and compile it.
Start it and type in the title string of your manually started cmd-window.
Press 'FindAWindow' and see is a handle number appears in the first field of 'Send To Handle'.
Type in some Text in the middle field of 'Send To Handle'.
Press 'Send To Handle'.

Does the text appear in cmd-window?

This works for me here.

PostPosted: Mon Dec 04, 2006 11:55 am
by phlm
Hi Hans_Peter,
I found the error...
Run "!C:\WINDOWS\system32\cmd.exe" "" "LoadComplete" "" "[Command]"

The LoadComplete doesn't really mean cmd.exe is ready to accept input. I added a delay and everything works fine now.

Thanks for you help!