Make a project using below code. Compile it and call it SendKeysA.exe
Now make another project and put a Text1 on it. Compile it and call it SendKeysB.exeCode:Dim ReturnValue As Long Private Sub Cpmmand1_Click() ReturnValue = Shell(App.Path & "\SendKeysB.exe", 1) End Sub Private Sub Command2_Click() AppActivate ReturnValue SendKeys "Hello from program A" & vbCrLf Exit Sub MsgBox "Press OK to do a Ctrl+M - " & Chr(34) & "^M" & Chr(34) SendKeys "^M", True ' Send Ctrl + M MsgBox "Press OK to do a Ctrl+M - " & Chr(34) & "^(M)" & Chr(34) SendKeys "^(M)", True ' Send Ctrl + M MsgBox "Press OK to do a Alt+S - " & Chr(34) & "%S" & Chr(34) SendKeys "%S", True ' Send Alt + S MsgBox "Press OK to do a Alt+S - " & Chr(34) & "%(S)" & Chr(34) SendKeys "%(S)", True ' Send Alt + S End Sub
Run SendKeysA.exe only. Click on Command1. SendKeysB.exe will be launched. Now click on Command2.




Reply With Quote