' Grab the text highlighted in the other program.
Private Sub Command1_Click()
' Activate the other program.
AppActivate txtCaption.Text, True
' Clear the clipboard.
Clipboard.Clear
' Press Control.
keybd_event VK_CONTROL, 0, 0, 0
DoEvents
' Press C.
keybd_event VK_C, 1, 0, 0
DoEvents
' Release Control.
keybd_event VK_CONTROL, 0, KEYEVENTF_KEYUP, 0
DoEvents
' Get the text from the clipboard.
Text1.Text = Clipboard.GetText
End Sub
|