Hi,
I have opened the NotePad and I want to send key strokes using SendMessage. I have got parent and child window and tried to send keystrokes using SendMessage() but didn't work. Why ? As far as I know the code is correct.
Any help would be appreciated.PHP Code:Const WM_KEYDOWN As Integer = &H100
Const WM_KEYUP As Int32 = &H101
Const VK_RETURN As Integer = &HD
Dim hWnd_notepad As IntPtr = FindWindow(Nothing, "Untitled - Notepad")
Dim hWnd_notepad_class As IntPtr = FindWindowEx(hWnd_notepad, Nothing, "Edit", Nothing)
SendMessage(hWnd_notepad_class, WM_KEYDOWN, VK_RETURN, 0)
SendMessage(hWnd_notepad_class, WM_KEYUP, VK_RETURN, 0)
Thanks!




Reply With Quote
