New notification code for subclassed CButton
-
I want a different behaviour for a button when keeping it pressed with the LButton of the mouse. To repeat the BN_CLICKED using a timer inside the new class is no big deal, it all works fine and dandy. The thing is that I want to add a new notification code to be repeated while the button is pushed in, something like BN_KEPTDOWN, but I'd like to pick a value that doesn't conflict with some other notification code in a later release of DevStudio and/or MFC (running on VC6 at the moment). Are there some guidelines regarding creating new notification codes? I tried MSDN but I was unable to find anything about this. Links, anyone? -- Roger
It's supposed to be hard, otherwise anybody could do it!
-
I want a different behaviour for a button when keeping it pressed with the LButton of the mouse. To repeat the BN_CLICKED using a timer inside the new class is no big deal, it all works fine and dandy. The thing is that I want to add a new notification code to be repeated while the button is pushed in, something like BN_KEPTDOWN, but I'd like to pick a value that doesn't conflict with some other notification code in a later release of DevStudio and/or MFC (running on VC6 at the moment). Are there some guidelines regarding creating new notification codes? I tried MSDN but I was unable to find anything about this. Links, anyone? -- Roger
It's supposed to be hard, otherwise anybody could do it!
you can use WM_USER then just add to it if you need more than one
-
you can use WM_USER then just add to it if you need more than one
Probably, but WM_USER has nothing to do with notification codes since WM_USER is a message ID. When you handle the BN_CLICKED event, a WM_COMMAND message is sent from the child to the parent with a 16-bit notification code in the WPARAM parameter of the message. The other 16 bits are the ID of the control and the LPARAM parameter is the window handle of the control. This is normally taken care of by the framework/MFC. What I want is a new notification code that is guaranteed not to conflict with other notification codes for buttons. -- Roger
It's supposed to be hard, otherwise anybody could do it!