-
how use sendkeys
hi,
i want copy a selected text from notepad to my aplication using the sendkeys and clipboard of windows i using this code:
SendKeys "{end}", True
SendKeys "+{home}", True
Clipboard.Clear
SendKeys "{DOWN}", True
so far so good this can select the text that i want now i want send this selected text to the clipboard i using this:
'SendKeys "^{c}", True
but this don´t work :mad: and i can´t understand why:confused:
so my question is how can i press "CTR + C" by using the sendkeys to copy a selected text? or there is other way using a api to do this?
thanks a lot for your help
:)
-
Re: how use sendkeys
Sometimes fighting the menus is a pain. Why not try this, instead? Same effect, but it is now Windows doing the work instead of Notepad.
Code:
SendKeys "^{INSERT}"
-
Re: how use sendkeys
Try
SendKeys "^(C)", True
use () instead of {}
-
Re: how use sendkeys
It's OK with : SendKeys "^(C)", True
But it's also OK with : SendKeys "^C", True
Parentheses are only required for multiple characters sent with Ctrl (or Shift or Alt) key:
SendKeys "^(CD)", True
is different with
SendKeys "^CD", True
Curly brackets { } are required and only be used with special keys on keyboard, such as {HOME}, {END}, {DOWN}, {TAB}, {F2}, ...
(See Help on SendKeys Statement for full listing.)
Example:
SendKeys "^(END)", True: hold down Control key while pressing "E" then "N" then "D".
SendKeys "^{END}", True: hold down Control key while pressing End-key.
SendKeys "^END", True: hold down Control-key while pressing "E", then release Control-key, then press "N" then "D".