如何根据所得到的窗口句柄得到相应的控件ID?
在OnMouseMove中,我想根据鼠标所指向的位置得到所指向的控件的ID,该如何做呢?
OnMouseMove(UINT nFlags, CPoint point)
{
HWND hwndParent;
wchar_t lp[MAX_PATH],ld[MAX_PATH];
POINT ptCur;
::GetCursorPos(&ptCur);
hwndParent=::WindowFromPoint(ptCur);
if(hwndParent == IDC_EDIT2)
AfxMessageBox(_T("edit2"));
}