Not possible add Event handler for Custom Control

Hi people,



There is any way to add a Message for Custom Control?

Event Handler Wizard dialog does not show any option. Blank list for Message type:

I have a grid implemented on a Custom control (do not ask me why, i am new in the company), now a have to implement some controls for datas and i do not want to re-implement all dialog for List Control.

Please, tell me that is possible :-)


Regards, Emanuel
WM_USER are used to define private messages for use by private window classes.
I might be able to help you with this Emanuel, because Custom Controls and ActioveX Controls are things I code and work with all the time. But I do everything straight SDK with no wizards or Class Frameworks or anything like that. I'm not sure what an 'Event Handler Wizard' is. Something in MFC?

But in general, custom controls use something I refer to as WM_NOTIFY transport for messaging back to their host app. There is a struct named NMHDR which forms the basis of the transport. The address of an object containing one of these is sent to the host (SendMessage()) as part of the WM_NOTIFY message.

Here is a link to the NMHDR struct...

https://msdn.microsoft.com/en-us/library/windows/desktop/bb775514(v=vs.85).aspx

Note the 3rd member - NMHDR::code, is where you pass your custom message back to the host. Of course, the host needs an equate/define so it can recognize it when it comes through in a WM_NOTIFY. The LPARAM of the WM_NOTIFY call received in the host will be the address of the object passed from the custom control.

Unfortunately, I don't have much C/C++ code showing how all this works. I have a PowerBASIC demo here though that you might be able to figure out...

http://www.jose.it-berater.org/smfforum/index.php?topic=2907.0
Last edited on
Topic archived. No new replies allowed.