예제 #1
0
LRESULT MenuCaptureWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled){

	switch(uMsg)
	{
	case WM_KILLFOCUS:
		onKillFocus(uMsg,wParam,lParam);
		bHandled = true;
		break;
	case WM_KEYDOWN:
		onKeyDown(uMsg,wParam,lParam);
		bHandled = true;
		break;
	default:
		bHandled = false;
	}
	return 0L;
}
예제 #2
0
bool ViewerWindow::onMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message) {
	case WM_SIZING:
		m_sizeIsChanged = true;
		return false;
	case WM_NCDESTROY:
		m_stopped = true;
		return true;
	case WM_USER_STOP:
		SendMessage(m_hWnd, WM_DESTROY, 0, 0);
		return true;
	case WM_USER_FS_WARNING:
		return onFsWarning();
	case WM_CLOSE:
		return onClose();
	case WM_DESTROY:
		return onDestroy();
	case WM_CREATE:
		return onCreate((LPCREATESTRUCT)lParam);
	case WM_SIZE:
		return onSize(wParam, lParam);
	case WM_USER_AUTH_ERROR:
		return onAuthError(wParam);
	case WM_USER_ERROR:
		return onError();
	case WM_USER_DISCONNECT:
		return onDisconnect();
	case WM_ACTIVATE:
		if ((LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE) && m_isFullScr) {
			try {
				// Registration of keyboard hook.
				m_winHooks.registerKeyboardHook(this);
				// Switching off ignoring win key.
				m_dsktWnd.setWinKeyIgnore(false);
			}
			catch (Exception &e) {
				m_logWriter.error(_T("%s"), e.getMessage());
			}
		}
		else if (LOWORD(wParam) == WA_INACTIVE && m_isFullScr) {
			// Unregistration of keyboard hook.
			m_winHooks.unregisterKeyboardHook(this);
			// Switching on ignoring win key.
			m_dsktWnd.setWinKeyIgnore(true);
		}
		return true;
	case WM_SETFOCUS:
		return onFocus(wParam);
	case WM_ERASEBKGND:
		return onEraseBackground((HDC)wParam);
	case WM_KILLFOCUS:
		return onKillFocus(wParam);
	case WM_TIMER:
		return onTimer(wParam);
	case WM_DISPLAYCHANGE:
		adjustWindowSize();

	}
	return false;
}