Results 1 to 5 of 5

Thread: Extract info from other window?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    93

    Extract info from other window?

    Is there any way, like an API call or something with hwnd, to get information from another application like label names/captions/tags?

    Like, say I click on a label in another program thats running, is there any way to put the info from that label in my program?

    edit: alright, I've done some looking around, and realize that there is no hWnd for a label, but is there any way to get the info off of another program's form window?
    Last edited by thetakerfan; Aug 6th, 2003 at 04:30 PM.

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    To get the Caption of the Form window use

    GetWindowTextLength
    and GetWindowText API..
    To get The size use
    GetWindowRect


    What else u want to get about the other window?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    93
    I actually wanted to get the caption from a label, not the form, but there might be another way to do it.

    On the form, there is a listview or listbox, which I believe does have hWnd, whereas a label does not. When an item in the list is selected, it then fills the rest of the labels on the form, which is the info I want to get from the form.

    Is there anyway to intercept the routine that happens when an item in the list is clicked and get the info from their as it adds it to the form?

  4. #4
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    416
    some labels do, some dont. depends on what the creator intended.

    use GetWindowText API to get text from an hWnd. (or use SendMessage API with WM_GETTEXT param...... either works)

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    93
    I don't see any of the labels using Spy++, so I don't know if I'm just missing something or not.

    Anyway to catch the stuff from the listbox?

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