15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Process wide subclassing

R Venkat Raghavan -- venkat.raghavan@blr.sni.de
Wednesday, January 08, 1997

Environment : VC++ 4.2-flat, NT 4.0

Hi,

I have a client-server application wherein the parent window is created
in one process ( client ) and the child windows is created in another
process ( server ), due to some design constraint.

The client creates a Frame Window, say CClientWnd. The client then
passes the 
HWND( aClientWnd.m_hWnd ) onto the server. The server then creates child
windows
on it. The processing of messages for the child windows are done at the
server side.

Now all the mouse messages that are sent to child windows are consumed
at the server side.
But at the client side, I would like to know of the mouse messages sent
to the child windows before/after the child windows receive it.

Though I can get the handle to the Child windows, I do not know how to
look at the messages sent to them.

I thought subclassing is the best solution for this. But then since this
is across processes, subclassing too becomes messy( Injecting code into
server process's address space etc, etc !! ). Is there any neater
workaround for subclassing other than the 3 listed in MFC KB Q125860 ? 

Is there any way out ? Pl. note that the code at the server side cannot
be changed.

Thanx in advance.

Bye
Venkat



Bibhas Bhattacharya -- bibhas@isgtec.com
Thursday, January 09, 1997

> 
> Environment : VC++ 4.2-flat, NT 4.0
> 
> Hi,
> 
> I have a client-server application wherein the parent window is created
> in one process ( client ) and the child windows is created in another
> process ( server ), due to some design constraint.
> 
...
> 
> Now all the mouse messages that are sent to child windows are consumed
> at the server side.
> But at the client side, I would like to know of the mouse messages sent
> to the child windows before/after the child windows receive it.
> 

How flexible is the current server design? Can you request a modification?
If so, the server's client side library could accept message handlers
which will be called for every event in the child window.

Bibhas.
bibhas@isgtec.com




P. Senthil -- senthilp@geocities.com
Wednesday, January 15, 1997

R Venkat Raghavan wrote:
>The processing of messages for the child windows are done at the
> server side.
> 
> Now all the mouse messages that are sent to child windows are consumed
> at the server side.
> But at the client side, I would like to know of the mouse messages sent
> to the child windows before/after the child windows receive it.
> 
Install a Mouse message hook for each window on your client side. This
requires the thread id of the window creating thread. There is no
necessity to subclass the window.

P. Senthil




| Вернуться в корень Архива |