CComboBox
-
Hi all! Let's say I have 5 combo boxes in 1 dialog box. Instead of having 5 different functions to control the OnSelChange() events of those combo boxes, can I just have 1 function to handle all 5 combo boxes? I guess what I am asking is that if there exists a function call so that you can tell which one sends the request. Thank You Vu vucsuf
-
Hi all! Let's say I have 5 combo boxes in 1 dialog box. Instead of having 5 different functions to control the OnSelChange() events of those combo boxes, can I just have 1 function to handle all 5 combo boxes? I guess what I am asking is that if there exists a function call so that you can tell which one sends the request. Thank You Vu vucsuf
You can call CWnd::GetCurrentMessage() which will return the MSG struct for the notification message. Combobox notifications are sent with WM_COMMAND, so you can grab the control ID/HWND from wParam and lParam. --Mike-- http://home.inreach.com/mdunn/ "The Earth is doomed." -- Rupert Giles :love: your :bob: with :vegemite: and :beer:
-
Hi all! Let's say I have 5 combo boxes in 1 dialog box. Instead of having 5 different functions to control the OnSelChange() events of those combo boxes, can I just have 1 function to handle all 5 combo boxes? I guess what I am asking is that if there exists a function call so that you can tell which one sends the request. Thank You Vu vucsuf
Hello, the codegurus around the world.;) The other way is that you create only one OnSelChange(), and assign this function inside the message map. That is, all five ComboBoxes share one OnSelChange(). (Or create your own function associated the message) And, we can check which ComboBox get the input focus when this message is checked. I guess that this works.:confused: Have a nice day!
-Masaaki Onishi-