Esempio n. 1
0
LRESULT CResizablePage::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
    if (message != WM_NCCALCSIZE || wParam == 0)
        return CPropertyPage::WindowProc(message, wParam, lParam);

    LRESULT lResult = 0;
    HandleNcCalcSize(FALSE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
    lResult = CPropertyPage::WindowProc(message, wParam, lParam);
    HandleNcCalcSize(TRUE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
    return lResult;
}
LRESULT CResizableMDIChild::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
	if (message != WM_NCCALCSIZE || wParam == 0)
		return CMDIChildWnd::WindowProc(message, wParam, lParam);

	// specifying valid rects needs controls already anchored
	LRESULT lResult = 0;
	HandleNcCalcSize(FALSE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
	lResult = CMDIChildWnd::WindowProc(message, wParam, lParam);
	HandleNcCalcSize(TRUE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
	return lResult;
}
LRESULT CResizableSheetEx::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
	if (message != WM_NCCALCSIZE || wParam == 0 || !m_bLayoutDone)
		return CPropertySheetEx::WindowProc(message, wParam, lParam);

	// specifying valid rects needs controls already anchored
	LRESULT lResult = 0;
	HandleNcCalcSize(FALSE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
	lResult = CPropertySheetEx::WindowProc(message, wParam, lParam);
	HandleNcCalcSize(TRUE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
	return lResult;
}
Esempio n. 4
0
LRESULT CResizableFormView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
	if (message == WM_INITDIALOG)
		return (LRESULT)OnInitDialog();

	if (message != WM_NCCALCSIZE || wParam == 0)
		return CFormView::WindowProc(message, wParam, lParam);

	// specifying valid rects needs controls already anchored
	LRESULT lResult = 0;
	HandleNcCalcSize(FALSE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
	lResult = CFormView::WindowProc(message, wParam, lParam);
	HandleNcCalcSize(TRUE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
	return lResult;
}
// Helper to dispatch messages to the Desktop Window Manager for processing
LRESULT cef_dark_aero_window::DwpCustomFrameProc(UINT message, WPARAM wParam, LPARAM lParam, bool* pfCallDefWindowProc)
{
    LRESULT lr = 0L;

    *pfCallDefWindowProc = CDwmDLL::DwmDefWindowProc(mWnd, message, wParam, lParam, &lr) == 0;
    
    switch (message) {
    case WM_CREATE:
        if (HandleCreate()) {
            *pfCallDefWindowProc = true;
            lr = 0L;
        }
        break;
    case WM_ACTIVATE:
        if (HandleActivate()) {
            *pfCallDefWindowProc = true;
            lr = 0L;
        }
        break;
    case WM_PAINT:
        if (HandlePaint()) {
            *pfCallDefWindowProc = true;
            lr = 0L;
        }
        break;
    case WM_NCCALCSIZE:
        if (HandleNcCalcSize((BOOL)(wParam != 0), reinterpret_cast<NCCALCSIZE_PARAMS*>(lParam), &lr)) {
            *pfCallDefWindowProc = false;
        }
        break;
    case WM_NCHITTEST:    
        if (lr == 0) {
            // Handle hit testing in the NCA if not handled by DwmDefWindowProc.

            POINT pt;
            POINTSTOPOINT(pt, lParam);

            lr = HandleNcHitTest(&pt);
    
            if (lr != HTNOWHERE) {
                *pfCallDefWindowProc = false;
            }
        }
        break;
    }


    return lr;
}