Results 1 to 2 of 2

Thread: Getting text from active window

  1. #1

    Thread Starter
    Addicted Member rpk_20061975's Avatar
    Join Date
    Jun 2001
    Location
    India
    Posts
    234

    Question Getting text from active window

    Hi,
    This question can be easily understood by PGP/GnuPG users.
    My VB application starts in the system tray. I want that as the user selects an option to encrypt or decrypt text, the text in any window opened on the desktop (e.g., Notepad) should automatically get selected and transferred to my program.

    I thing some API function like "GetWindowText" is there for doing this.

    Any Idea?

    .............
    Rohit.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Check out this API website.
    This function cannot retrieve the text of an 'EDIT' control in another application.
    This function is for reading or setting the title bar caption of a window.
    Try looking at GetActiveWindow function.
    It will return the handle of the Active window.
    Then you just need to find the "EDIT" type of child window.
    For that try using FindWindowEx.
    Then Enumerate the child windows until you find the 'EDIT' type.

    I don't know how you are going to determine which EDIT window
    is the right one since different apps are going to have a different window structures.

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