the list of the combobox

the list of the combobox

Author

Message

yoram#1 / 8

the list of the combobox

I have a dialog that has a combobox on it and I need to know when the left mouse button is pressed on the list of the combobox. So on the PreTranslateMessage of the mainframe I wrote the following code:

but IsChild does not return true when I press on the combobox list. Can any one help!!

please send email as well. Thanks yoram

Sun, 10 Dec 2000 03:00:00 GMT

Doug Sutherlan#2 / 8

the list of the combobox

Catch it in the PreTranslateMessage for the dialog instead. - Doug S.

Quote:

> I have a dialog that has a combobox on it and I need to know when the left > mouse button is pressed on the list of the combobox. > So on the PreTranslateMessage of the mainframe I wrote the following code:

> but IsChild does not return true when I press on the combobox list. > Can any one help!!

> please send email as well. > Thanks > yoram

Sun, 10 Dec 2000 03:00:00 GMT

steve mcadam#3 / 8

the list of the combobox

Quote:

> I have a dialog that has a combobox on it and I need to know when the left > mouse button is pressed on the list of the combobox. > So on the PreTranslateMessage of the mainframe I wrote the following code:

> BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) > { ...snip > }

> but IsChild does not return true when I press on the combobox list. > Can any one help!!

The listbox in a combobox is not a child window, it's a popup. See if the CBN_SELCHANGE notification does what you need. Otherwise you will have to get the handle of the listbox within the combo and then subclass it. -steve

Sun, 10 Dec 2000 03:00:00 GMT

JHil#4 / 8

the list of the combobox

Doug, I would make the control CMyComboBox derived form CComboBox and just add the message handler for OnLButtonDown message. Jim

Quote:

> Catch it in the PreTranslateMessage for the dialog instead. - Doug S.

>> I have a dialog that has a combobox on it and I need to know when the left >> mouse button is pressed on the list of the combobox. >> So on the PreTranslateMessage of the mainframe I wrote the following code:

Remarks Call this member function to "dynamically subclass" a control created from a dialog template and attach it to this CWnd object. When a control is dynamically subclassed, windows messages will route through the CWnd's message map and call message handlers in the CWnd's class first. Messages that are passed to the base class will be passed to the default message handler in the control.

This member function attaches the Windows control to a CWnd object and replaces the control's WndProc and AfxWndProc functions. The function stores the old WndProc in the location returned by the GetSuperWndProcAddr member function.

Quote:

> I have a dialog that has a combobox on it and I need to know when the left > mouse button is pressed on the list of the combobox. > So on the PreTranslateMessage of the mainframe I wrote the following code: