SendKeys command
am 17.11.2007 11:30:13 von Tom RahavHi,
I developed an application in VB.NET 2005 that opens a small window whenever
I click the mouse middle-button.
The application attened to detect what program is now in focus (after the
mouse middle-button click) and then to display the pop-up window. In that
window I wnat to allow the user to enter commands and by "SendKeys" command
I want to send it to the foreground program. Sounds easy, and actually most
of it already works, but not all.
When I click the mouse middle-buttom let's say while I'm working with MS
Word, a new pop-up window appears, I type string in a textbox and send it to
the MS Word document. The problem is that it works for me only with normal
text stings such as "sample text" but does not work for MS Word's commands
shortcuts. What I mean is that I've tried to send some known commands to the
MS Word, such as: "CTRL+O" (sent as "^(O)") for opening file dialogue-box,
"CTRL+A" (sent as "^(A)") for selecting all the text, etc. but nothing
worked... the MS Word does not response to such commands. To make it
clearer, when instead of "^(O)" I send "this is text" string for instance,
that sentence was sent and appeared successfully in the MS Word document.
Can someone please suggest?
Thanks!
Tom.