Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As LongPublic Declare Function SendKeys(ByVal hwnd As long,ByVal keycode as long)
PostMessage hwnd,256,keycode,0
End function这样就可以调用(你可以用计算器的窗口句柄试一下):SendKeys(hWnd,asc("1"));