Пример #1
0
LRESULT CALLBACK VideoWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	switch (Msg) 
	{
		//HANDLE_MSG(hWnd, WM_CREATE,				OnCreate);
		//HANDLE_MSG(hWnd, WM_SIZE,			OnSize);
		HANDLE_MSG(hWnd, WM_MDIACTIVATE,	OnMDIActivate);
		HANDLE_MSGB(hWnd, WM_PAINT,			OnPaint);
		HANDLE_MSG(hWnd, WM_MOUSEMOVE,		OnMouseMove);
		HANDLE_MSG(hWnd, WM_LBUTTONUP,		OnLButtonUp);
		HANDLE_MSG(hWnd, WM_LBUTTONDOWN,	OnLButtonDown);
		HANDLE_MSG(hWnd, WM_LBUTTONDBLCLK,	OnLButtonDblClk);
		HANDLE_MSG(hWnd, WM_RBUTTONUP,		OnRButtonUp);
		HANDLE_MSG(hWnd, WM_RBUTTONDBLCLK,	OnRButtonDown);
		HANDLE_MSG(hWnd, WM_RBUTTONDOWN,	OnRButtonDown);

		// We can't use the macro from windowsx.h macro for this one
		case WM_SYSCOMMAND: 
		{
			if (OnSysCommand(hWnd,(UINT)wParam,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam))) {
				return 0;
			}
			break;
		}

		default:
			return DefMDIChildProc(hWnd, Msg, wParam, lParam);
	}
	return 0;
}
Пример #2
0
static LRESULT CALLBACK scrnProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
    switch (Msg) {
        HANDLE_MSG(hWnd, WM_CREATE,			onCreate);
        HANDLE_MSG(hWnd, WM_ACTIVATEAPP,	onActivateApp);
        HANDLE_MSGB(hWnd,WM_PAINT,			onPaint);
        HANDLE_MSG(hWnd, WM_CLOSE,			onClose);
        HANDLE_MSG(hWnd, WM_DESTROY,		onDestroy);
        HANDLE_MSG(hWnd, WM_COMMAND,		onCommand);

    // We can't use the macro from windowsx.h macro for this one
    case WM_SYSCOMMAND: {
        if (onSysCommand(hWnd,(UINT)wParam,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam))) {
            return 0;
        }
        break;
    }

    HANDLE_MSG(hWnd, WM_SIZE,			onSize);
    HANDLE_MSG(hWnd, WM_ENTERSIZEMOVE,	onEnterSizeMove);
    HANDLE_MSG(hWnd, WM_EXITSIZEMOVE,	onExitSizeMove);

    HANDLE_MSGB(hWnd, WM_SIZING,		onSizing);		// set screen visible size, added by regret
    HANDLE_MSGB(hWnd, WM_DROPFILES,		onDropFiles);	// drag & drop support, added by regret

    HANDLE_MSG(hWnd, WM_ENTERIDLE,		onEnterIdle);
    HANDLE_MSG(hWnd, WM_MOUSEMOVE,		onMouseMove);
    HANDLE_MSG(hWnd, WM_LBUTTONUP,		onLButtonUp);
    HANDLE_MSG(hWnd, WM_LBUTTONDOWN,	onLButtonDown);
    HANDLE_MSG(hWnd, WM_LBUTTONDBLCLK,	onLButtonDblClk);
//		HANDLE_MSG(hWnd, WM_RBUTTONUP,		onRButtonUp);
    HANDLE_MSG(hWnd, WM_RBUTTONDBLCLK,	onRButtonDown);
    HANDLE_MSG(hWnd, WM_RBUTTONDOWN,	onRButtonDown);

    HANDLE_MSG(hWnd, WM_ENTERMENULOOP,	onEnterMenuLoop);
    HANDLE_MSGB(hWnd,WM_EXITMENULOOP,	onExitMenuLoop);

    HANDLE_MSG(hWnd, WM_DISPLAYCHANGE,	onDisplayChange);
    }

    return DefWindowProc(hWnd, Msg, wParam, lParam);
}