Question about event handling in a win32 c++ application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
=?Utf-8?B?R0FFTA==?= said:
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.


--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
 
GAEL said:
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?.

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.
 
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?
 
GAEL said:
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.
 
Back
Top