打算用这个做为PtInRegion矩形范围判断,现在关键是这种提示效果如何做出。
如把鼠标放到"我的电脑"上时会出现黄框提示:"提供计算机上硬盘信息。"等等这些提示效果!

解决方案 »

  1.   

    如果我自己没理解错。应该就是:当移动某一矩形区域出现ToolTip
      

  2.   

    RECT rc;    GetMyItemRect(&rc);
        SendMessage(hwndToolTip, TTM_ADJUSTRECT, TRUE, (LPARAM)&rc);
        SetWindowPos(hwndToolTip,
                     NULL,
                     rc.left, rc.top,
                     0, 0,
                     SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
      

  3.   

    GetMyitemRect()是??????
    hwndToolTip 应该申明什么类型的?
      

  4.   

    GetMyitemRect()用来得到你的提示框的大小的,自定义函数
    hwndToolTip 你的提示框的句柄。
      

  5.   

    谢谢,我采用了如下方法:
    CToolTipCtrl  m_ToolTip;  
    CTestView::OnInitialUpdate()    
    {  
               CView::OnInitialUpdate();  
                 
               m_ToolTip.Create(this,TTS_ALWAYSTIP);  
               m_ToolTip.AddTool(this,"ToolTip");  
    }  
     
    void  CTestView::OnMouseMove(UINT  nFlags,  CPoint  point)    
    {  
               CRgn  rgn;  
               rgn.CreateRectRgnIndirect(CRect  m_rect);  
                 
               if(rgn.PtInRegion(point))  
               {  
                           CString  str;  
                           str.Format("CX  %d,CY  %d",point.x,point.y);//可以修改提示内容  
                           m_ToolTip.UpdateTipText(str,this);  
               }  
               CView::OnMouseMove(nFlags,  point);  
    }  
     
    LRESULT  CTestView::WindowProc(UINT  message,  WPARAM  wParam,  LPARAM  lParam)    
    {  
               //  TODO:  Add  your  specialized  code  here  and/or  call  the  base  class  
               if(message==  WM_MOUSEMOVE)  
               {  
                           MSG  msg;  
                           msg.hwnd  =  m_hWnd;  
                           msg.message  =  message;  
                           msg.wParam  =  wParam;  
                           msg.lParam  =  lParam;  
     
                           m_ToolTip.RelayEvent(&msg);  
               }  
               return  CView::WindowProc(message,  wParam,  lParam);  
    }