Event Handlers

  • Thread starter Thread starter mphanke
  • Start date Start date
M

mphanke

Hi,

I have a form containing a toolbar which came in a DLL. Now I want to
change the behavior of a single button, and have the handling of the
others unchanged. Problem: I don't have access to the source code...

Can I retrieve the old eventhandler somehow and replace it with my new
one(,in all other cases I would pass on the eventargs to the old func)?

Is this somehow possible??

Thanks,

Martin
 
Hi Martin,

Since you haven't the toolbar's source code and the class wizard could not
add an event-handler with that control, it appears you need to hook the
toolbar's window proc, I suggest you can use the spyxx.exe to detect which
message is corresponding to the specific button click event in that
toolbar, then you can handle this message in your custom window proc for
that toolbar control...


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Hi Martin,

Please refer the following MSDN doc and KB articles, you can find some
general guide and sample code:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI
/WindowsUserInterface/Windowing/WindowProcedures/UsingWindowProcedures.asp

How to subclass windows in Windows Forms by using Visual C++ .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;815774

How to trap keystrokes in .NET controls by using Visual C++ .NET
http://support.microsoft.com/default.aspx?kbid=816190


By the way, is your application a pure MC++ WinForm project? And if you
want some code snippet particular to your scenario, would you please upload
the toolbar's control(zipped) to us, if possible?


Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Back
Top