Subclassing a window in another application? 
Author Message
 Subclassing a window in another application?

Is it possible to subclass a window in another application.  I want to know
the string in a edit box in another application.  What is the best method to
do this.  Thanks in advance.

Niraj Shah

remove to x- to send me email



Fri, 05 Apr 2002 03:00:00 GMT  
 Subclassing a window in another application?

Quote:

> Is it possible to subclass a window in another application.

Yes, but you will need to write a hook dll, or use some other method) to
ineject a dll containing your subclass code into that process.

Quote:
>I want to know the string in a edit box in another application.

How about sending it a WM_GETTEXT message? The system automatically marshals
the standard window messages accross process boundries, so you can send a
WM_GETTEXT to any window in the system sure in the knowledge that it will
work.

Quote:
>What is the best method to do this.

WM_GETTEXT over subclassing any day. :)

Chris
--
Please keep newsgroup correspondence within the newsgroups.

<http://www.mvps.org/vcfaq> Visual C & Win32 FAQ
<http://users.lia.net/chris/win32> My Win32 Development Page



Fri, 05 Apr 2002 03:00:00 GMT  
 Subclassing a window in another application?
I did that and I have a polling kind of solution by getting the windowtext.
It would be nice to be keyed (onselchange) when somebody changes that edit
control.  Is subclassing not possible across processes?

Thanks for the info,

Niraj

Quote:


>> Is it possible to subclass a window in another application.

>Yes, but you will need to write a hook dll, or use some other method) to
>ineject a dll containing your subclass code into that process.

>>I want to know the string in a edit box in another application.

>How about sending it a WM_GETTEXT message? The system automatically
marshals
>the standard window messages accross process boundries, so you can send a
>WM_GETTEXT to any window in the system sure in the knowledge that it will
>work.

>>What is the best method to do this.

>WM_GETTEXT over subclassing any day. :)

>Chris
>--
>Please keep newsgroup correspondence within the newsgroups.

><http://www.mvps.org/vcfaq> Visual C & Win32 FAQ
><http://users.lia.net/chris/win32> My Win32 Development Page



Fri, 05 Apr 2002 03:00:00 GMT  
 Subclassing a window in another application?
Niraj,

Quote:
> I did that and I have a polling kind of solution by getting the
windowtext.
> It would be nice to be keyed (onselchange) when somebody changes that edit
> control.  Is subclassing not possible across processes?

Yes it is, but as Chris already mentioned, you need to inject some code into
the other process' address space. This is because the replacement WndProc()
needs to be in the context of the process that owns the window. One simple
way to inject your code into the other process is to use a hook, like
WH_GETMESSAGE or whatever suits you best.

--
Tomas Restrepo

http://members.xoom.com/trestrep/



Fri, 05 Apr 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Q: subclassing windows in other application

2. running windows application from another windows application

3. Subclassing the procedure belonging to a dialog of another application

4. Subclassing a 3rd party application?!?

5. Challenge: Subclassing another application

6. Subclassing window

7. Subclassing foreign window and changing memory in it

8. Subclassing a window in different process

9. Subclassing window

10. Subclassing Problem with Unicode Windows

11. Q: subclassing problem, with hook and windows messages

12. Problems subclassing a window

 

 
Powered by phpBB® Forum Software