We have an application (written in VB 2005) that reads incoming characters on a virtual serial port (on which a Cognex barcode scanner is connected), validate the stream and send it to the focused object using the SendKeys
command.
It has worked perfectly for years, but now customers have new software and the SendKeys
no longer works for a specific field in this software (it works everywhere else but this field). They did some tests and found out that, when they copy-paste text, it works using ctrl-c, ctrl-v.
My question is: how can I emulate those keystroke from our application?
With
SendKeys
, the control key is^
. Then any additional keys can follow.So copy would be:
And paste:
Instead of copying, you can just directly put it on the clipboard (like you suggested), like:
My.Computer.Clipboard.SetText("This is a test string.")