Re: Catching custom message ...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jeff Johnson [MVP: VB] (i.get_at_enough.spam)
Date: 01/20/05


Date: Thu, 20 Jan 2005 09:16:25 -0500


"H.B." <hbcrdv@_hotmail_.com> wrote in message
news:1106228011.88828@news.drenet.dnd.ca...

> How can I catch custom (user-defined) messages in VB application. The
> messages are posted with PostMessage() in a C++ DLL and I need a way to
> catch them that works like the ON_MESSAGE() macro in C++.

You'd just subclass the window procedure and look at the uMsg parameter to
see if it's your message. Info on subclassing can be found all over the
place. Here are some starters: http://vbnet.mvps.org, www.softcircuits.com,
www.vbaccelerator.com.



Relevant Pages

  • Re: SubClassWindow, a big confusion for me
    ... When you subclass a window, all you are doing is inserting by inserting ... a window procedure ahead of whatever proc is currently present. ... gives you opportunity to respond to selected messages as you want. ...
    (microsoft.public.vc.mfc)
  • Re: WinSetWindowPtr() for WinFileDlg ?
    ... you supply your "subclass" proc in the ... subclassed file dialog, the GBM file dialog. ... using the provided pfnDlgProc and is in a separate DLL. ... WinSubclassWindowto get its window procedure. ...
    (comp.os.os2.programmer.misc)
  • Re: WindowProc: combobox messages problem
    ... > window procedure." ... > so I will have to subclass the CComboBox anyway to be able to handle ... > Another question about the message map (I couldn't find on MSDN, ...
    (microsoft.public.vc.mfc)
  • Re: CComboxbox , dropdown
    ... subclass it nicely in MFC? ... I need to provide my own window procedure so that I can handle the F6 ... Derive a class from CEdit, map the WM_KEYDOWN message, add a member ... edit member's SubclassWindow with the HWND of the combo's child edit. ...
    (microsoft.public.vc.mfc)
  • Re: my own mfc, per window instance data?
    ... Will it work with new NX protection bit? ... > dynamically allocated assembly code that is used to subclass the window. ... > This new window procedure calls a member function of the corresponding ...
    (microsoft.public.win32.programmer.kernel)