1. Lets say I have a MFC SDI with a dialog containing 5 edit boxes. 2. I want to left click on any of the five edits and generate "Hello" in it. 3. I have reached the point where I can click anywhere on the dialog and generate "Hello" into one single edit box. 4. I haven't figured out how to determine if the click is in one of the edit boxes rather than anywhere in the dialog. 5. Then I need to know which edit box. So, I need advice on #4 and #5. Here is what I have: CTest.h afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
CTest.cpp BEGIN_MESSAGE_MAP(CTest, CDialog) //{{AFX_MSG_MAP(CTest) ON_WM_LBUTTONDOWN() //}}AFX_MSG_MAP END_MESSAGE_MAP() ... void CTest::OnLButtonDown(UINT nFlags, CPoint point) { CDialog::OnLButtonDown(nFlags, point); //this is anywhere on the dialog GetDlgItem(IDC_EDIT_C1L1)->SetWindowText("Hello"); //if I knew where it clicked, I could target correct editbox }
Thanks
modified on Tuesday, January 01, 2008 7:07:59 PM