制做像QQ那种自动停靠.自动收缩的窗口.[2]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 hxblvc 的 blog

                  on_message(wm_mouseleave,onmouseleave)
            end_message_map()
      .......

     lresult cdlg::onmouseleave(hwnd hwnd, uint msg, wparam wparam,                                                                   lparam lparam  )
        {
             if(m_isautohide)
             {
                  cpoint tpoint;
                  getcursorpos(&tpoint);
                  crect trect;
                  getwindowrect(&trect);
                  if(!(trect.ptinrect(tpoint)))
                  {
                      m_iswinhide=true;
                   trect.top= trect.top - trect.bottom +5;
                   trect.bottom= 5;
                   movewindow(trect);

                   ::setwindowpos(
                            ::getdesktopwindow()
                            ,hwnd_topmost,trect.left,trect.top
                            ,trect.width(),trect.height    ()
                            ,swp_showwindow);
                 }
            }
      return true;
    }


    void cdlg::onmousemove(uint nflags, cpoint point)
        {
                 if(m_iswinhide)
                 {
                      crect trect;
                      getwindowrect(&trect);
                     trect.bottom+= (trect.bottom-trect.top-5);
                     trect.top=0;
                     movewindow(trect);
                     m_iswinhide= false;
                  }

本文关键:制做像QQ那种自动停靠.自动收缩的窗口.
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top