shell函数调用应用程序,如何获取应用程序中的内容
shell函数调用应用程序,如何获取应用程序中的内容,如word,公式编辑器等 --------------------编程问答-------------------- 给一个思路:用process类 或API得到窗口句柄,再取某控件的内容:' 相关的API:
Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Integer
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As IntPtr, ByVal lpString As StringBuilder, _
ByVal cch As Integer) As Long
Declare Function GetWindow Lib "user32" (ByVal hwnd As Integer, _
ByVal wCmd As Integer) As Integer
Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As IntPtr, _
ByVal wMsg As Integer, ByVal wParam As Integer, _
ByVal lParam As Integer) As Integer
Public Delegate Function EnumWindowsCallback(ByVal hWnd As Integer, _
ByVal lParam As Integer) As Boolean
Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As EnumWindowsCallback, _
ByVal lParam As Integer) As Integer
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Integer, _
ByVal lpClassName As StringBuilder, _
ByVal nMaxCount As Integer) As Integer '为指定的窗口取得类名
自己慢慢试吧。
--------------------编程问答-------------------- 难.
还是建议COM引用吧.
补充:.NET技术 , VB.NET