devxlogo

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

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Engineering Leaders Spot Weak Proposals

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.