How to detect which object called the message
-
Hi everyone, I am using VC++ 6. I have a 3 listcontrols which display different data. I have customized the list control for the look and feel by creating a class "CCustomListCtrl" .I have created 3 instances of "CCustomListCtrl" in CMainFrame. class which I am using notification message "NM_CLICK" to detect the click on the list. Now i want to identify which of the user has clicked.
-
Hi everyone, I am using VC++ 6. I have a 3 listcontrols which display different data. I have customized the list control for the look and feel by creating a class "CCustomListCtrl" .I have created 3 instances of "CCustomListCtrl" in CMainFrame. class which I am using notification message "NM_CLICK" to detect the click on the list. Now i want to identify which of the user has clicked.
chaitannya_m wrote:
Now i want to identify which of the user has clicked.
There is an
NMHDR
structure that's given as parameter to the function. It contains a variable calledhwndFrom
which denotes the control from which the notification came. You can use this handle.
Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com
-
Hi everyone, I am using VC++ 6. I have a 3 listcontrols which display different data. I have customized the list control for the look and feel by creating a class "CCustomListCtrl" .I have created 3 instances of "CCustomListCtrl" in CMainFrame. class which I am using notification message "NM_CLICK" to detect the click on the list. Now i want to identify which of the user has clicked.
chaitannya_m wrote:
class which I am using notification message "NM_CLICK"
Instead of handling the message in the CCustomListCtrl, handle that message in the CMainFrame itself. NM_CLICK is actually a notification. So handle the WM_NOTIFY message in the CMainFrame and check whether the code is NM_CLICK.
nave [OpenedFileFinder]
-
Hi everyone, I am using VC++ 6. I have a 3 listcontrols which display different data. I have customized the list control for the look and feel by creating a class "CCustomListCtrl" .I have created 3 instances of "CCustomListCtrl" in CMainFrame. class which I am using notification message "NM_CLICK" to detect the click on the list. Now i want to identify which of the user has clicked.
I guess you need to identify the list control which send the NM_CLICK notification message. NM_CLICK notification returns the id and handle to window of list control, this can be used to identify the control. Best Regards Raj
-
I guess you need to identify the list control which send the NM_CLICK notification message. NM_CLICK notification returns the id and handle to window of list control, this can be used to identify the control. Best Regards Raj
how to use the handle dude...i tried NMHDR ..it does give different values for the list, but how to identify which value is for what. Well i have to use the custom control for sure, its for different purpose. Also i can't use the click notification in the mainframe since i have listcontrols in different windows
-
how to use the handle dude...i tried NMHDR ..it does give different values for the list, but how to identify which value is for what. Well i have to use the custom control for sure, its for different purpose. Also i can't use the click notification in the mainframe since i have listcontrols in different windows
chaitannya_m wrote:
how to use the handle dude
I prefer to use ID than handle but no matters.
chaitannya_m wrote:
i tried NMHDR ..it does give different values for the list, but how to identify which value is for what.
You need to store the values of ID when the list control is created and matching the value with which the NMHDR returns identifies the list control.
chaitannya_m wrote:
Also i can't use the click notification in the mainframe since i have listcontrols in different windows
You can use message handlers in its parent window.