DefWindowProc (Windows CE 5.0)

Send Feedback

This function calls the default window procedure to provide default processing for any window messages that an application does not process. This function ensures that every message is processed. DefWindowProc is called with the same parameters received by the window procedure.

LRESULTDefWindowProc(   HWNDhWnd,   UINTMsg,   WPARAMwParam,   LPARAMlParam );

Parameters

  • hWnd
    [in] Handle to the window procedure that received the message.
  • Msg
    [in] Specifies the message
  • wParam
    [in] Specifies additional message information. The content of this parameter depends on the value of the Msg parameter.
  • lParam
    [in] Specifies additional message information. The content of this parameter depends on the value of the Msg parameter.

Return Values

The return value is the result of the message processing and depends on the message. If Msg is WM_SETTEXT, zero is returned.

Code Sample

The following code sample describes how a mouse move initiates window procedures.

case WM_MOUSEMOVE:
{
    hUIWnd = GetWindow(hStatusWnd, GW_OWNER);

    hUIPrivate = (HLOCAL)GetWindowLong(hUIWnd, IMMGWL_PRIVATE);
    if (!hUIPrivate)    
        return DefWindowProc (hStatusWnd, uMsg, wParam, lParam);

    lpUIPrivate = (LPUIPRIV)LocalLock(hUIPrivate);
    if (!lpUIPrivate) 
        return DefWindowProc (hStatusWnd, uMsg, wParam, lParam);
    
    if (lpUIPrivate->dwUIMoveOffset != WINDOW_NOT_DRAG) {
        POINT ptCursor;

        DrawDragBorder(hStatusWnd, lpUIPrivate->dwUIMoveXY, 
            lpUIPrivate->dwUIMoveOffset, lpUIPrivate->rcWorkArea);
        GetCursorPos(&ptCursor);
        lpUIPrivate->dwUIMoveXY = MAKELONG(ptCursor.x, ptCursor.y);
        DrawDragBorder(hStatusWnd, lpUIPrivate->dwUIMoveXY, 
            lpUIPrivate->dwUIMoveOffset, lpUIPrivate->rcWorkArea);
        } 
    else {
        LocalUnlock(hUIPrivate);
        return DefWindowProc (hStatusWnd, uMsg, wParam, lParam);
    }

    LocalUnlock(hUIPrivate);
}

Remarks

DefWindowProc does not automatically call PostQuitMessage when it handles a WM_DESTROY message.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winuser.h.

See Also

CallWindowProc | DefDlgProc | WindowProc | Windows Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.