Subclassing window 
Author Message
 Subclassing window

Hi,

Can someone tell me how dangerous it is to subclass a window belonging to
another application.

For example, I have an EXE from which I do a FindWindow and get another
application's main window and Subclass it.

What are the precautions and is this advisable?

Can someone throw some light on the above?

Regards,
Sundari.



Mon, 01 Dec 2003 00:34:29 GMT  
 Subclassing window
You can't just subclass a window from another exe in the Win32 environment.
You need to use Windows Hooks, the only precaution I can suggest here is to
go buy a book that explains it before trying to use it. For that book I'd
suggest "Programming Applications for Windows" by Jeffrey Richter.


Quote:
> Hi,

> Can someone tell me how dangerous it is to subclass a window belonging to
> another application.

> For example, I have an EXE from which I do a FindWindow and get another
> application's main window and Subclass it.

> What are the precautions and is this advisable?

> Can someone throw some light on the above?

> Regards,
> Sundari.



Mon, 01 Dec 2003 00:58:31 GMT  
 Subclassing window
You can't subclass a window belonging to another application because the
other application is in another address space. In other words, your
application does not have access to most of the other application's memory
and it does not have access to most of your application's memory. Using a
system-wide hook will allow you to get a DLL to execute in the other
application's address space but system-wide hooks require advanced knowledge
of Windows.


Quote:
> Hi,

> Can someone tell me how dangerous it is to subclass a window belonging to
> another application.

> For example, I have an EXE from which I do a FindWindow and get another
> application's main window and Subclass it.

> What are the precautions and is this advisable?

> Can someone throw some light on the above?

> Regards,
> Sundari.



Mon, 01 Dec 2003 01:34:33 GMT  
 Subclassing window
As earlier mentioned, you would use hooks. You can use CInjectDll class
mentioned in this article:

http://msdn.microsoft.com/library/periodic/period97/C++0497.htm

--
Ajay Kalra [MVP - VC++]

Note: Please post all replies to newsgroup only.


Quote:
> Hi,

> Can someone tell me how dangerous it is to subclass a window belonging to
> another application.

> For example, I have an EXE from which I do a FindWindow and get another
> application's main window and Subclass it.

> What are the precautions and is this advisable?

> Can someone throw some light on the above?

> Regards,
> Sundari.



Mon, 01 Dec 2003 01:41:26 GMT  
 Subclassing window
I have some notes and links to most relevant documentation of hooks in:
http://www.cpp.atfreeweb.com/Hooks.html

And Joseph Newcomer has an article at:
http://www.pgh.net/~newcomer/hooks.htm


Quote:
> Hi,

> Can someone tell me how dangerous it is to subclass a window belonging to
> another application.

> For example, I have an EXE from which I do a FindWindow and get another
> application's main window and Subclass it.

> What are the precautions and is this advisable?

> Can someone throw some light on the above?

> Regards,
> Sundari.



Mon, 01 Dec 2003 02:22:11 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Subclassing window

2. Subclassing window

3. Subclassing Windows

4. Subclassing Windows class in MFC

5. Subclassing Windows

6. Q: subclassing windows in other application

7. Subclassing windows

8. Subclassing window

9. Subclassing Window Question

10. Help:ACIVEX controls- subclassing Windows Control

11. Subclassing foreign window and changing memory in it

12. Subclassing a window in different process

 

 
Powered by phpBB® Forum Software