Beispiel #1
0
// unhide and display the window, if the current window is maximized make sure we
// maximize the window we're unhiding.
void CChildCommon::ActivateWindow( void )
{
  BOOL bMaximized = FALSE;
  CWindow ActiveWnd = g_pMainWnd->MDIGetActive(&bMaximized);
  CWindow ParentWnd = ActiveWnd.GetParent();

  if (bMaximized)
    ParentWnd.SetRedraw(FALSE);

  g_pMainWnd->MDIActivate(m_hWnd);
#ifdef USE_TABBEDMDI
	::SendMessage(GetParent(), UWM_MDICHILDACTIVATIONCHANGE, (WPARAM)m_hWnd, 0);
  SendMessage(WM_UPDATETAB, (WPARAM)0, (LPARAM)NULL);
  //SetTabText("SHOWN");
#endif

	if(bMaximized == TRUE)
  {
		ShowWindow(SW_SHOWMAXIMIZED);
		
		ParentWnd.SetRedraw(TRUE);
		ParentWnd.RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN);
	}

  /*
  if (BOOLPREF(PREF_bHideNotMinimize))
  {
    SetWindowPos(HWND_TOP,0,0,0,0,SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW );
    RedrawWindow(0,0,RDW_FRAME|RDW_INVALIDATE|RDW_ERASENOW|RDW_ALLCHILDREN);
  }
  else
  {
    g_pMainWnd->MDIActivate(m_hWnd);
  }
  */
}
Beispiel #2
0
// **************************************************************************
//
// CMainWindow::TranslateAccelerator
//
// Required to forward messages to the PIEWebBrowser control (and any other
// ActiveX controls that may be added to the main window's design).
//
// **************************************************************************
BOOL CMainWindow::TranslateAccelerator(MSG* pMsg)
{
#if defined( OS_WINCE) && !defined( OS_PLATFORM_MOTCE )
	if (pMsg->message == WM_CONTEXTMENU){
		/*
		CMenuHandle menu;
		menu.LoadMenu(IDR_MAIN_MENU);
		menu = menu.GetSubMenu(0);
		return menu.TrackPopupMenu( TPM_CENTERALIGN | TPM_VERTICAL, LOWORD(pMsg->lParam), HIWORD(pMsg->lParam), m_hWnd);
		*/
		
		return TRUE;
	}

	if (m_bFullScreen && pMsg->message == WM_KEYUP && 
		(pMsg->wParam == VK_F1 ||  pMsg->wParam == VK_F2))
	        SetFullScreen(false);
#endif

    // Accelerators are only keyboard or mouse messages
    UINT uMsg = pMsg->message;
    if (!(WM_KEYFIRST   <= uMsg && uMsg <= WM_KEYLAST) &&
        !(WM_MOUSEFIRST <= uMsg && uMsg <= WM_MOUSELAST))
    {

#ifdef OS_WINCE			
        if ( uMsg == WM_HOTKEY )
        {
            int idHotKey = (int) pMsg->wParam; 
            int fuModifiers = (UINT) LOWORD(pMsg->lParam); 
            int uVirtKey = (UINT) HIWORD(pMsg->lParam);

            if ( uVirtKey == VK_ESCAPE ){
                if ( fuModifiers&MOD_KEYUP )
                    RHODESAPP().navigateBack();
                    //PostMessageW(WM_COMMAND,MAKEWPARAM(IDM_BACK,1),NULL);

                return TRUE;
            }
        }
#endif //OS_WINCE

        return FALSE;
    }

    if (NULL == m_hWnd)
    {
        return FALSE;
    }

    // Find a direct child of this window from the window that has focus.
    // This will be AtlAxWin window for the hosted control.
    CWindow control = ::GetFocus();
    if (IsChild(control) && m_hWnd != control.GetParent())
    {
        do
        {
            control = control.GetParent();
        } while (m_hWnd != control.GetParent());
    }

    // Give the control (via the AtlAxWin) a chance to translate this message
    if (control.m_hWnd && control.SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg))
    {
        return TRUE;
    }

    // If the main window used accelerators, we could have called the global
    // ::TranslateAccelerator() function here, instead of simply returning FALSE.
    return FALSE;
}