Click to See Complete Forum and Search --> : How to change a label in another exe
Kings
Aug 29th, 2001, 08:00 AM
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:D
Thanks
chrisjk
Aug 29th, 2001, 08:01 AM
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.
Megatron
Aug 29th, 2001, 09:08 AM
Are you talking about a VB-created application? C++? or Delphi?
Kings
Aug 29th, 2001, 09:12 AM
I think it's either a VB-created application or c++, not delphi:)
Kings
Aug 31st, 2001, 12:38 PM
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 :p
Thanks:D
Megatron
Aug 31st, 2001, 01:26 PM
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.
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.
Kings
Aug 31st, 2001, 01:30 PM
thanks megatron:D
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.