this code sends 2 Tabs when it should only send one, shouldn't it?both WM_KEYDOWN and WM_KEYUP are causing a tab to be fired.VB Code:
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" ( _ ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _ ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Const WM_KEYDOWN = &H100 Private Const WM_KEYUP = &H101 Private Sub Command1_Click() Dim lhWnd As Long lhWnd = FindWindowEx(FindWindowEx(0&, 0&, "notepad", vbNullString), 0&, "Edit", vbNullString) PostMessage lhWnd, WM_KEYDOWN, vbKeyTab, 1& PostMessage lhWnd, WM_KEYUP, vbKeyTab, 1& End Sub
Should I be expecting this? I'm tired and confused...




Reply With Quote