Exemplo n.º 1
0
LRESULT CNotice::ProcessWindowMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	if(WM_NCLBUTTONDOWN==uMsg)
		return OnNcLButtonDown(uMsg,wParam,lParam,bHandled);

	return 0;
}
Exemplo n.º 2
0
LRESULT CSkinDialog::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
	LRESULT lrst = TRUE;

	if (!::IsWindow(m_hWnd))
		return lrst;
	//重绘标题栏
	if (message==WM_NCPAINT||message==WM_NCACTIVATE)
	{
		DrawTitleBar();
		return lrst;
	}
	//鼠标双击标题栏
	if(message==WM_NCLBUTTONDBLCLK){
		CPoint pt;
		::GetCursorPos(&pt);
		OnNcLButtonDblClk(pt);
		return lrst;
	}

	//鼠标按下处理
	if(message==WM_NCLBUTTONDOWN){
		CPoint pt;
		::GetCursorPos(&pt);
		if(OnNcLButtonDown(pt)){
			return lrst;
		}
	}

	//重新计算标题栏高度
	if(message==WM_NCCALCSIZE){
		NCCALCSIZE_PARAMS* lpncsp = (NCCALCSIZE_PARAMS*)lParam;
		BOOL bCalcValidRects = (BOOL)wParam;
		OnNcCalcSize(bCalcValidRects,lpncsp);
	}

	//鼠标焦点处理
	if(message==WM_NCMOUSEMOVE){
		CPoint pt;
		::GetCursorPos(&pt);
		OnNcMouseMove(pt);
	}

	//鼠标弹起处理
	if(message==WM_NCLBUTTONUP){
		CPoint pt;
		::GetCursorPos(&pt);
		OnNcLButtonUp(pt);
	}
	//鼠标离开标题栏处理
	if(message==WM_NCMOUSELEAVE){
		OnNcMouseLeave();
	}
	//默认消息处理
	return CDialog::DefWindowProc(message, wParam, lParam);
}
Exemplo n.º 3
0
LRESULT CSkinWin::WindowProc(UINT msg, WPARAM wp, LPARAM lp)
{
    if ( !IsWindow(m_hWnd) )
        return 0;
    if ( !m_bInit  ) 
        return Default();
        
    switch ( msg )
    {
    case WM_SHOWWINDOW:
        //call setwindowpos to force OnNcCalcSize when hWnd is a dialog
        if ( wp )
            SetWindowPos( m_hWnd, 0, 0, 0, 400, 400, SWP_NOSIZE|SWP_NOMOVE|SWP_FRAMECHANGED );
        Default();
        return 0;
        break;
    //case WM_ERASEBKGND:
    case WM_INITMENUPOPUP:
        Default();
        return 0;
    //    return OnEraseBkgnd(CDC::FromHandle((HDC)wp) );
        /*
    case WM_INITMENU:
        //a hack, when popup sysmenu, redraw title bar
        HMENU h;
        h = (HMENU)wp;
        int c;
        h = GetSubMenu(h, 0);
        c = GetMenuItemID( h, 0 );
        if ( c == SC_RESTORE )
        {
            CRect r;
            GetClientRect( m_hWnd, r );
            OnNcPaint(0);
            r.bottom = GetSystemMetrics(SM_CYCAPTION);
            InvalidateRect( m_hWnd, r, TRUE );
            UpdateWindow( m_hWnd );
        }
        Default();
        return 0;
        */
    case WM_SYSCOMMAND:
        OnSysCommand( wp, lp );
        return 0;
    case WM_SETTEXT:
        return OnSetText( wp, lp );
    case WM_NCPAINT:
        OnNcPaint( (HRGN)wp );
        return 0;
    case WM_NCCALCSIZE:
        OnNcCalcSize( (BOOL)wp, (NCCALCSIZE_PARAMS *)lp );
        return 0;
    case WM_SIZE:
        OnSize( wp, LOWORD(lp), HIWORD(lp) );
        return 0;    
    case WM_NCACTIVATE:
        return OnNcActivate( (BOOL)wp );
    case WM_NCHITTEST:
        return OnNcHitTest(CPoint(LOWORD(lp), HIWORD(lp)));
    case WM_NCLBUTTONUP:
        OnNcLButtonUp(wp, CPoint(LOWORD(lp), HIWORD(lp)));
        return 0;
    case WM_NCLBUTTONDOWN:
        OnNcLButtonDown(wp, CPoint(LOWORD(lp), HIWORD(lp)));
        return 0;
   /* case WM_NCLBUTTONDBLCLK:
        OnNcLButtonDblClk(wp, CPoint(LOWORD(lp), HIWORD(lp)));
        return 0;*///liub_modify (去除双击弹出面板的响应事件)
    case WM_NCRBUTTONUP:
        OnNcRButtonUp(wp, CPoint(LOWORD(lp), HIWORD(lp)));
        return 0;
    case WM_NCRBUTTONDOWN:
        OnNcRButtonDown(wp, CPoint(LOWORD(lp), HIWORD(lp)));
        return 0;
    case WM_NCMOUSEMOVE:
        OnNcMouseMove( wp,CPoint(LOWORD(lp), HIWORD(lp)));
        return 0;
    case WM_GETMINMAXINFO:
        OnGetMinMaxInfo( (MINMAXINFO *)lp );
        return 0;
    case WM_WINDOWPOSCHANGING:
        OnWindowPosChanging((WINDOWPOS *)lp);
        return 0;
    case WM_SIZING:
        OnSizing( wp, (LPRECT)lp );
        return 0;
    case WM_ACTIVATE:
        OnActivate( wp, CWnd::FromHandle((HWND)lp), 0 );
        return 0;
    case WM_COMMAND:
        if ( !HandleSysCommand( wp, lp ) )
            Default();
        return 0;

#if 1
		// @@
	case WM_SETCURSOR:
		if (OnHitTestSetCursor(LOWORD(lp)))
			OnNcPaint(0);
		else
			Default();
		return 0;
#endif

    default:
        return Default();
    }
}
void CXTPSkinObjectFrame::OnNcLButtonDblClk(UINT nHitTest, CPoint point)
{
    OnNcLButtonDown(nHitTest, point);
}