'下面两个常量定义正确了没?
Private Const WM_KEYDOWN = &H100
Private Const WM_KEYUP = &H101
'如果你是模拟键盘按键最好指出特定的按键常量,如下面的 按回车键
PostMessage hwnd, WM_KEYDOWN, VK_RETURN, 0
PostMessage hwnd, WM_KEYUP, VK_RETURN, 0
'如果你是模拟类似鼠标的点击,那就用下面的代码
PostMessage hwnd, WM_LBUTTONDOWN, VK_LBUTTON, 0
PostMessage hwnd, WM_LBUTTONUP, VK_LBUTTON, 0