|Unfortuately this code as written wont work in anything later than Windows 98, |
It is the Declare Function GetFocus Lib "User" () as Integer that throws it. You need to change all reference to "User" to "User32.dll". and change the send message function as below.
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long
It should work then.
it is the difference between 16 bit and 32 bit function calls.