帮我修改一下代码:void CMySpin::OnLButtonUp(UINT nFlags, CPoint point) 
 {
    CWnd *pWnd = GetFocus();// 这句错误。点击SPIN时焦点在其配偶控件EDIT上。
                            // 那么怎么得到当前点击SPIN的ID????
    int id = pWnd->GetDlgCtrlID();
    if(IDC_SPIN1==id)
    {     
      .
      .
      .
 }
大家可以参考:
http://community.csdn.net/Expert/topic/4345/4345014.xml?temp=.1558954

解决方案 »

  1.   

    根据OnLButtonUp中的point得到
    WindowFromPoint
    The WindowFromPoint function retrieves a handle to the window that contains the specified point. HWND WindowFromPoint(
      POINT Point  // point
    );
      

  2.   

    int b = 0;
       int id = GetDlgCtrlID();
       if(IDC_SpinAbsorberSpeed==id)
       {
       }
       else if(IDC_SpinCurrentUseRatio==id)
       {
         b=200;
       }
       else if(IDC_SpinFuelUseRatio==id)
       {
         b=400;
       }   CString strB;
       strB.Format(_T("%d"), b);
       AfxMessageBox(strB);