Results 1 to 7 of 7

Thread: How to change a label in another exe

  1. #1

    Thread Starter
    Fanatic Member Kings's Avatar
    Join Date
    Aug 2001
    Posts
    673

    Question How to change a label in another exe

    Hiya'll

    How can I change a label in another program?

    I've tried WM_SETTEXT but I couldn't get it to change the label?

    If anyone knows how to do that please respond

    Thanks
    K i n g s

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    as far as I know, they can't be changed because they don't have a window handle. Windows draws them directly without using the Edit class to help save resources.

  3. #3
    Megatron
    Guest
    Are you talking about a VB-created application? C++? or Delphi?

  4. #4

    Thread Starter
    Fanatic Member Kings's Avatar
    Join Date
    Aug 2001
    Posts
    673
    I think it's either a VB-created application or c++, not delphi
    K i n g s

  5. #5

    Thread Starter
    Fanatic Member Kings's Avatar
    Join Date
    Aug 2001
    Posts
    673
    Ok.....

    Can maybe then someone tell me how to READ the caption/text of another program? I know for sure this can be done
    but I just don't know how

    Thanks
    K i n g s

  6. #6
    Megatron
    Guest
    The debate is not whether you can read or write, rather it's whether it's a C++ or a VB app.

    If it's a C++ App, then you could use this.
    Code:
    hwndParent = FindWindowEx(0, 0, "ClassName", "WindowName")
    hwndLabel = FindWindowEx(hwndParent, 0, "Static", "Text of label")
    SendMessage hwndLabel, WM_SETTEXT, 0, ByVal "My new Text"
    If it's a VB App, then you can't do it, because as Chrisjk explained, they are drawn on to the parent's DC.

  7. #7

    Thread Starter
    Fanatic Member Kings's Avatar
    Join Date
    Aug 2001
    Posts
    673
    thanks megatron
    K i n g s

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