I found some examples of sending messages to other windows made with VB6 :
Expand|Select|Wrap|Line Numbers
- Dim lNotepadHwnd As Long
- Dim lNotepadEdit As Long
- Dim sMsg As String = "q"
- lNotepadHwnd = FindWindow("Notepad", vbNullString)
- lNotepadEdit = FindWindowEx(lNotepadHwnd, 0&, "Edit", vbNullString)
- SendMessageSTRING(lNotepadEdit, WM_SETTEXT, 256, sMsg)
I can get as far as getting the handle of the process but i cant find what i need to send the message.
This is my Stop button code :
Expand|Select|Wrap|Line Numbers
- Private Sub Btn_Stop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Stop.Click
- Dim processHandle As Long = Process1.Handle
- 'What type of command do i need hear to send "q" key to hidden cmd shell ?
- Btn_Stop.Enabled = False
- Btn_Record.Enabled = True
- UD_Minutes.Enabled = True
- End Sub