예제 #1
0
LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{
	switch(nmsg) {
	  case WM_LBUTTONDBLCLK:
	  case WM_RBUTTONDBLCLK:
	  case WM_MBUTTONDBLCLK:
		explorer_show_frame(SW_SHOWNORMAL);
		break;

      case WM_DISPLAYCHANGE:
        MoveWindow(_hwnd, 0, 0, LOWORD(lparam), HIWORD(lparam), TRUE);
        MoveWindow(g_Globals._hwndShellView, 0, 0, LOWORD(lparam), HIWORD(lparam), TRUE);
        MoveWindow(_desktopBar, 0, HIWORD(lparam) - DESKTOPBARBAR_HEIGHT, LOWORD(lparam), DESKTOPBARBAR_HEIGHT, TRUE);
        break;

	  case WM_GETISHELLBROWSER:
		return (LRESULT)static_cast<IShellBrowser*>(this);

	  case WM_DESTROY:

		///@todo use IShellBrowser::GetViewStateStream() and _pShellView->SaveViewState() to store view state

		if (SetShellWindow)
			SetShellWindow(0);
		break;

	  case WM_CLOSE:
		ShowExitWindowsDialog(_hwnd);
		break;

	  case WM_SYSCOMMAND:
		if (wparam == SC_TASKLIST) {
			if (_desktopBar)
				SendMessage(_desktopBar, nmsg, wparam, lparam);
		}
		goto def;

	  case WM_SYSCOLORCHANGE:
		// redraw background window - it's done by system
		//InvalidateRect(g_Globals._hwndShellView, NULL, TRUE);

		 // forward message to common controls
		SendMessage(g_Globals._hwndShellView, WM_SYSCOLORCHANGE, 0, 0);
		SendMessage(_desktopBar, WM_SYSCOLORCHANGE, 0, 0);
		break;

	  default: def:
		return super::WndProc(nmsg, wparam, lparam);
	}

	return 0;
}
예제 #2
0
LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{
	switch(nmsg) {
	  case WM_LBUTTONDBLCLK:
	  case WM_RBUTTONDBLCLK:
	  case WM_MBUTTONDBLCLK:
		explorer_show_frame(SW_SHOWNORMAL);
		break;

      case WM_DISPLAYCHANGE:
        MoveWindow(_hwnd, 0, 0, LOWORD(lparam), HIWORD(lparam), TRUE);
        MoveWindow(g_Globals._hwndShellView, 0, 0, LOWORD(lparam), HIWORD(lparam), TRUE);
        MoveWindow(_desktopBar, 0, HIWORD(lparam) - DESKTOPBARBAR_HEIGHT, LOWORD(lparam), DESKTOPBARBAR_HEIGHT, TRUE);
        break;

	  case WM_GETISHELLBROWSER:
		return (LRESULT)static_cast<IShellBrowser*>(this);

	  case WM_DESTROY:

		///@todo use IShellBrowser::GetViewStateStream() and _pShellView->SaveViewState() to store view state

		if (SetShellWindow)
			SetShellWindow(0);
		break;

	  case WM_CLOSE:
		ShowExitWindowsDialog(_hwnd);
		break;

	  case WM_SYSCOMMAND:
		if (wparam == SC_TASKLIST) {
			if (_desktopBar)
				SendMessage(_desktopBar, nmsg, wparam, lparam);
		}
		goto def;

	  case WM_SYSCOLORCHANGE:
		// redraw background window - it's done by system
		//InvalidateRect(g_Globals._hwndShellView, NULL, TRUE);

		// forward message to common controls
		SendMessage(g_Globals._hwndShellView, WM_SYSCOLORCHANGE, 0, 0);
		SendMessage(_desktopBar, WM_SYSCOLORCHANGE, 0, 0);
		break;

      case WM_SETTINGCHANGE:
        SendMessage(g_Globals._hwndShellView, nmsg, wparam, lparam);
        break;

      case PM_TRANSLATE_MSG:
      {
            /* TranslateAccelerator is called for all explorer windows that are open 
               so we have to decide if this is the correct recipient */
            LPMSG lpmsg = (LPMSG)lparam;
            HWND hwnd = lpmsg->hwnd;

            while(hwnd)
            {
                if(hwnd == _hwnd)
                    break;

                hwnd = GetParent(hwnd);
            }

            if (hwnd)
                return _pShellView->TranslateAccelerator(lpmsg) == S_OK;
            return false;
      }

	  default: def:
		return super::WndProc(nmsg, wparam, lparam);
	}

	return 0;
}