Home > Software engineering >  How the text in Text1 to send to the other programs
How the text in Text1 to send to the other programs

Time:10-08

How the text in Text1, the Tab key, Text2 text, the enter key to send to the other programs?

CodePudding user response:

Sent to the other programs? Also the VB wrote it?

If it is
You can see the LinkTopic textbox control, LinkMode, LinkExecute, these a few properties
Send to Form_LinkExecute process and accept

CodePudding user response:

External programs don't know what to write? My program is a vb and is
 Private Sub Timer1_Timer () 
SetWindowPos Me. The HWND, a, 0, 0, 0, 0, b Or c
ShowWindow Me. HWND SW_SHOWMAXIMIZED
End Sub

Window front, how out of focus,
Send text,
 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long 
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd1 As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Command1_Click ()
Dim hWnd1As Lon
HWnd1=FindWindow (" Myexe vbNullString)
The SetForegroundWindow hWnd
Sleep 100
SendKeys Text1. Text
SendKeys "{Tab}
"EndKeys Text2. Text
SendKeys "{Enter}
"End Sub

CodePudding user response:

 Private Sub Command1_Click () 
Dim hWnd1As Lon
HWnd1=FindWindow (" Myexe vbNullString)
The SetForegroundWindow hWnd1
Sleep 100
SendKeys Text1. Text
SendKeys "{Tab}
"EndKeys Text2. Text
SendKeys "{Enter}
"End Sub

CodePudding user response:

Please help solve, thank you,

CodePudding user response:

The building Lord at games landers, will know that do you use directly handle the assignment, use sendkeys unreliable

CodePudding user response:

API: sendmessage
But for the game, the success rate is not big,,,,
  • Related