how can i get text from MDI Windows (such as word, pagemaker etc....)
Printable View
how can i get text from MDI Windows (such as word, pagemaker etc....)
First get their handle:
Code:Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Dim handle as Long
handle = FindWindow(classname, titletext)
'then
'use FindWindowEx to find the handle of the child window where the text is located
'then when you have thet handle
Dim tl As Long, t As String
tl = SendMessage(handleofchild, WM_GETTEXTLENGTH, 0, 0)
tl = tl + 1
t = Space(tl)
SendMessage handleofchild, WM_GETTEXT, tl, ByVal t
't contains the text