Subclassing a window in different process 
Author Message
 Subclassing a window in different process

Hi everyone
I would like to know how can I subclass a window in a different process, to
manipulate its behavior?

I have some kind of idea that I have to use Windows Hooks, or subclassing or
both of them.

but I am not sure how to do it?

I know that most of the manipulation procedures should be in a DLL, that
should be injected in the window process. but I don't know how.

Can somebody please help me with this problem.   Any hint or tip will be
greatly appreciated, maybe a book name or address to a web site, or a even
better some code samples.

Best regards.



Sun, 16 Dec 2001 03:00:00 GMT  
 Subclassing a window in different process
wael,

It depends on what you need to do. Whether you only need to subclass a
specific windows or everywindows.

In the first case you can use regular subclassing, getting the windows
function and so on. The only thing is that the code must be in a DLL that
you place in the other process calling SetWindowsHookEx.

In the second case you still need the dll and a call to SetWindowsHookEx but
you must code everything in the callback function.

Fill free to cantact me for more information.

Alessandro


Quote:

> Hi everyone
> I would like to know how can I subclass a window in a different process,
to
> manipulate its behavior?

> I have some kind of idea that I have to use Windows Hooks, or subclassing
or
> both of them.

> but I am not sure how to do it?

> I know that most of the manipulation procedures should be in a DLL, that
> should be injected in the window process. but I don't know how.

> Can somebody please help me with this problem.   Any hint or tip will be
> greatly appreciated, maybe a book name or address to a web site, or a even
> better some code samples.

> Best regards.



Sun, 16 Dec 2001 03:00:00 GMT  
 Subclassing a window in different process

Quote:
> I would like to know how can I subclass a window in a different process,
to
> manipulate its behavior?

Here's how to do it for just one window:

Use SetWindowLong to set the GWL_WNDPROC of the window to point to your
"subclass" window proc.  Your subclass window proc should pass any messages
that it doesn't completely intercept on to the previous window proc using
CallWindowProc(pointer to previous wndproc is obtained before you changed
the GWL_WNDPROC, using GetWindowLong) .  Also, intercept WM_DESTROY and in
there you should restore the previous value of GWL_WNDPROC

That's all there is to it.

If you wanna subclass a whole bunch of windows, consider using the window
message hook stuff.



Wed, 19 Dec 2001 03:00:00 GMT  
 Subclassing a window in different process

Quote:

> > I would like to know how can I subclass a window in a different process,
> to
> > manipulate its behavior?

> Here's how to do it for just one window:

> Use SetWindowLong to set the GWL_WNDPROC of the window to point to your
> "subclass" window proc.  Your subclass window proc should pass any messages
> that it doesn't completely intercept on to the previous window proc using
> CallWindowProc(pointer to previous wndproc is obtained before you changed
> the GWL_WNDPROC, using GetWindowLong) .  Also, intercept WM_DESTROY and in
> there you should restore the previous value of GWL_WNDPROC

> That's all there is to it.

Shouldn't you do something to get the code for your "subclass" window
proc into the address space of the other process ?


Sat, 22 Dec 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. HOWTO: Subclass window from different Process ???

2. Destroying window from different process?

3. HOWTO: Subclass window from different Process ???

4. How to move data between windows in different process spaces

5. Create child windows from a different process

6. Utilizing ODBC to communicate two different processes on different machines

7. Different structs on different windows versions ?

8. Different Heights for a Window on different machines

9. subclassing in a specific process

10. Process Windows Messages during lengthy process

11. Find out the name of a process (process.exe) from a window handle (CWnd)

12. GetTextExtent Problem: Different results in WIndows NT and Windows 95

 

 
Powered by phpBB® Forum Software