Custom WM_NOTIFY NMHDR code
-
I'm currently building a custom control from scratch in Win32 API (no MFC). It's a divder control (something like the MFC splitter). I defined some notification events to be sent to the parent window like DVN_DELETEDPANE, but I don't know what number to give to the constant. It will be put in NMHDR.code to be sent with WM_NOTIFY to the parent control. I want to know how to define them so they don't conflict with existing values for other controls. Thank You David
-
I'm currently building a custom control from scratch in Win32 API (no MFC). It's a divder control (something like the MFC splitter). I defined some notification events to be sent to the parent window like DVN_DELETEDPANE, but I don't know what number to give to the constant. It will be put in NMHDR.code to be sent with WM_NOTIFY to the parent control. I want to know how to define them so they don't conflict with existing values for other controls. Thank You David
this probably won't help you much but you might want to just define your own message instead of using WM_NOTIFY. when MS updates the common controls new constants for NMHDR.code might be added so i don't think there is any way of knowing for sure there won't be any conflicts in the future...
-
this probably won't help you much but you might want to just define your own message instead of using WM_NOTIFY. when MS updates the common controls new constants for NMHDR.code might be added so i don't think there is any way of knowing for sure there won't be any conflicts in the future...
-
I understand, but then how to define a custom WM_???? that doesn't conflict with other conrols using WM_USER or WM_APP as I see common controls also use WM_USER + N do define their custom messages.
the only things i can think of are put
#ifndef divctrl_notify #define divctrl_notify (wm_app+1) #endif
in the divctrl header and if it conflicts with other msgs you've defined, define divctrl_notify as something else before you include the header. a better way might be to just use WM_COMMAND like other windows controls and let the notification codes be anything you want (the notification codes for the different win ctrls seem to all conflict anyway). just make sure you check the id of the ctrl (so you what type of ctrl it is) before parsing the notification codes and there shouldn't be a problem (i think??).
-
the only things i can think of are put
#ifndef divctrl_notify #define divctrl_notify (wm_app+1) #endif
in the divctrl header and if it conflicts with other msgs you've defined, define divctrl_notify as something else before you include the header. a better way might be to just use WM_COMMAND like other windows controls and let the notification codes be anything you want (the notification codes for the different win ctrls seem to all conflict anyway). just make sure you check the id of the ctrl (so you what type of ctrl it is) before parsing the notification codes and there shouldn't be a problem (i think??).
The problem is that this is a DLL to add support for UI making in another application. The ID of the control is not know to the DLL window procedures, it just parses the correct messages and sends the info back to the calling app through callback support. Anyways, thanks for the information, I'll see what I can do to get around the problem, I think I have a solution that will work even though there is a conflict.
-
The problem is that this is a DLL to add support for UI making in another application. The ID of the control is not know to the DLL window procedures, it just parses the correct messages and sends the info back to the calling app through callback support. Anyways, thanks for the information, I'll see what I can do to get around the problem, I think I have a solution that will work even though there is a conflict.
-
I'm currently building a custom control from scratch in Win32 API (no MFC). It's a divder control (something like the MFC splitter). I defined some notification events to be sent to the parent window like DVN_DELETEDPANE, but I don't know what number to give to the constant. It will be put in NMHDR.code to be sent with WM_NOTIFY to the parent control. I want to know how to define them so they don't conflict with existing values for other controls. Thank You David
Read this: http://blogs.msdn.com/oldnewthing/archive/2009/08/21/9877791.aspx[^] The two key portions are: "WM_NOTIFY is basically a sender-defined version of WM_USER" "It is an unwritten convention that the notification codes for the common controls are all negative numbers. This leaves positive numbers for applications to use for their own purposes."