Results 1 to 2 of 2

Thread: windows handle

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    117

    Talking

    how can i get text from MDI Windows (such as word, pagemaker etc....)

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    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
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width