- 分享
- 0
- 人气
- 0
- 主题
- 2
- 帖子
- 259
- UID
- 311150
- 积分
- 251
- 阅读权限
- 14
- 注册时间
- 2010-4-6
- 最后登录
- 2013-12-9
- 在线时间
- 185 小时
|
本帖最后由 shippo 于 2011-3-27 11:29 PM 编辑
刚试了没问题,vb 真麻烦。。。- Private Const WM_CHAR = &H102
- Private Const WM_KEYDOWN = &H100
- Private Const VK_RBUTTON = &H9
- Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (_
- ByVal hwnd As Int32, ByVal wMsg As Int32,_
- ByVal wParam As Int32, ByVal lParam As Int32) As Int32
- Private Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As String, _
- ByVal lpWindowName As String) As IntPtr
- Private Declare Auto Function FindWindowEx Lib "user32" (ByVal hWnd1 As IntPtr, _
- ByVal hWnd2 As IntPtr, ByVal lpsz1 As String, ByVal lpsz2 As String) As IntPtr
- Dim hwnd As Long = FindWindow(vbNullString, "Untitled - Notepad")
- Dim editwnd As Long = FindWindowEx(hwnd, 0, "Edit", vbNullString)
- PostMessage(editwnd, WM_KEYDOWN, VK_RBUTTON, 0)
复制代码 |
|