Is it possible to create a window and associate 2 windows procedures to it for event handling
I mean
LRESULT CALLBACK WndProc1(......
LRESULT CALLBACK WndProc2(......
and then
WNDCLASS wc
..
wc.lpfnWndProc = WndProc1
How to bind the second window procedure to the WNDCLASS?
Thanks in advance
Jochen Kalmbach - 14 Mar 2004 20:12 GMT
=?Utf-8?B?R0FFTA==?= wrote:
> Is it possible to create a window and associate 2 windows procedures
> to it for event handling? I mean:
No.
> wc.lpfnWndProc = WndProc1;
>
> How to bind the second window procedure to the WNDCLASS?.
Call the second WndProc2 from the first one if the message was not handled.

Signature
Greetings
Jochen
Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
Jeff Partch [MVP] - 14 Mar 2004 20:19 GMT
> Is it possible to create a window and associate 2 windows procedures to it for event handling?
> I mean:
[quoted text clipped - 9 lines]
>
> How to bind the second window procedure to the WNDCLASS?.
I'm still not quite sure what you mean, but you could have the 2nd procedure
address in the instance data and the first call/defer to it something like
WC_DIALOG does.

Signature
Jeff Partch [VC++ MVP]
GAEL - 15 Mar 2004 00:06 GMT
a part of what i want to do is : i want to create a win32 dll. That dll creates a window with some event handling. And I want any client application to be able to Interact with that window, by adding some additional event handling. How can I write event handling code within the client application?
Jeff Partch [MVP] - 15 Mar 2004 00:40 GMT
> a part of what i want to do is : i want to create a win32 dll. That dll creates a window with some event handling. And I want any client application
to be able to Interact with that window, by adding some additional event
handling. How can I write event handling code within the client application?
Export a function via which the client can pass the address of its handler
function to the dll (if you already have an exported Create the window
function, this can just be an optional parameter), store it in the window's
instance data and have the window's WindowProc check for it and call it when
appropriate. Of course, there's always subclassing too.

Signature
Jeff Partch [VC++ MVP]