devxlogo

Workaround for SendKeys

Workaround for SendKeys

Sendkeys “{TAB}” can lockup the keyboard in Windows 2000. Here’s how toexecute a tab in the keydown event using the Win32 API to get around thisWindows 2000 bug:

 Private Sub text1_KeyDown(KeyCode As Integer, 
Shift As Integer)Dim l As Long l = PostMessage(hwnd, WM_KEYDOWN, VK_TAB, 0)End SubPublic Declare Function PostMessage Lib "user32"
Alias "PostMessageA" (ByValhwnd As Long, ByVal wMsg As Long,
ByVal wParam As Long, ByVal lParam AsLong) As LongPublic Const WM_KEYDOWN As Long = &H100Public Const VK_TAB As Long = &H9

devx-admin

Share the Post: