Здравствуйте, Vi2, Вы писали:
Vi2>4. У интересующего приложения через объект можно получить его библиотеку типов. Один из способов — использовать TLBINF32.DLL (TypeLib Information).
Vi2>Vi2>Dim ta As TLI.TLIApplication, tlinfo As TLI.TypeLibInfo
Vi2>Set ta = New TLI.TLIApplication
Vi2>Set tlinfo = ta.ClassInfoFromObject(app).Parent
Vi2>
Vi2>5. Использовать эту библиотеку типов для своих целей.
А можно получить объект app используя ответные данные функции EnumWindows?
Вот пример работы функции EnumWindows:
'Add this code to a form
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Set the form's graphics mode to persistent
Me.AutoRedraw = True
'call the Enumwindows-function
EnumWindows AddressOf EnumWindowsProc, ByVal 0&
End Sub
'Add this code to a module
Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Boolean
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Dim sSave As String, Ret As Long
Ret = GetWindowTextLength(hwnd)
sSave = Space(Ret)
GetWindowText hwnd, sSave, Ret + 1
Form1.Print Str$(hwnd) + " " + sSave
'continue enumeration
EnumWindowsProc = True
End Function