ON_COMMAND(ID_WINDOW_CLOSEALL, OnWindowCloseAll)
ON_UPDATE_COMMAND_UI(ID_WINDOW_CLOSEALL, OnUpdateWindowCloseAll)
ON_COMMAND(ID_FILE_SAVEPROJECT, OnSaveProject)
- ON_WM_TIMER()
- ON_WM_ACTIVATE()
ON_WM_ACTIVATEAPP()
ON_COMMAND_RANGE(ID_TOOLBAR_NONE, ID_TOOLBAR_HUGE, OnToolbarSize)
ON_UPDATE_COMMAND_UI_RANGE(ID_TOOLBAR_NONE, ID_TOOLBAR_HUGE, OnUpdateToolbarSize)
ID_INDICATOR_OVR, // Insert
};
-/** @brief Timer ID for window flashing timer. */
-static const UINT ID_TIMER_FLASH = 1;
-
-/** @brief Timeout for window flashing timer, in milliseconds. */
-static const UINT WINDOW_FLASH_TIMEOUT = 500;
-
/**
* @brief Return a const reference to a CMultiDocTemplate's list of documents.
*/
* @todo Preference for logging?
*/
CMainFrame::CMainFrame()
-: m_bFlashing(FALSE)
-, m_bFirstTime(TRUE)
+: m_bFirstTime(TRUE)
, m_pDropHandler(NULL)
{
ZeroMemory(&m_pMenus[0], sizeof(m_pMenus));
}
/**
- * @brief Handle timer events.
- * @param [in] nIDEvent Timer that timed out.
- */
-void CMainFrame::OnTimer(UINT_PTR nIDEvent)
-{
- switch (nIDEvent)
- {
- case WM_NONINTERACTIVE:
- KillTimer(WM_NONINTERACTIVE);
- PostMessage(WM_CLOSE);
- break;
-
- case ID_TIMER_FLASH:
- // This timer keeps running until window is activated
- // See OnActivate()
- FlashWindow(TRUE);
- break;
- }
- CMDIFrameWnd::OnTimer(nIDEvent);
-}
-
-/**
* @brief Close all open windows.
*
* Asks about saving unsaved files and then closes all open windows.
{
CWnd * activeWindow = GetActiveWindow();
if (activeWindow != this)
- {
- FlashWindow(TRUE);
- m_bFlashing = TRUE;
- SetTimer(ID_TIMER_FLASH, WINDOW_FLASH_TIMEOUT, NULL);
- }
-}
-
-/**
- * @brief Stop flashing window when window is activated.
- *
- * If WinMerge is inactive when compare finishes, we start flashing window
- * to alert user. When user activates WinMerge window we stop flashing.
- * @param [in] nState Tells if window is being activated or deactivated.
- * @param [in] pWndOther Pointer to window whose status is changing.
- * @param [in] Is window minimized?
- */
-void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
-{
- CMDIFrameWnd::OnActivate(nState, pWndOther, bMinimized);
-
- if (nState == WA_ACTIVE || nState == WA_CLICKACTIVE)
- {
- if (m_bFlashing)
- {
- m_bFlashing = FALSE;
- FlashWindow(FALSE);
- KillTimer(ID_TIMER_FLASH);
- }
- }
+ FlashWindowEx(FLASHW_ALL | FLASHW_TIMERNOFG, 0, 0);
}
#if _MFC_VER > 0x0600
FRAME_OTHER, /**< No frame? */
};
- enum { WM_NONINTERACTIVE = 888 }; // timer value
-
CMainFrame();
// Attributes
// Public implementation data
public:
BOOL m_bFirstTime; /**< If first time frame activated, get pos from reg */
- BOOL m_bFlashing; /**< Window is flashing. */
// Implementation data
protected:
afx_msg void OnFileOpenproject();
afx_msg LRESULT OnCopyData(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUser1(WPARAM wParam, LPARAM lParam);
- afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnWindowCloseAll();
afx_msg void OnUpdateWindowCloseAll(CCmdUI* pCmdUI);
afx_msg void OnSaveProject();
- afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
#if _MFC_VER > 0x0600
afx_msg void OnActivateApp(BOOL bActive, DWORD dwThreadID);
#else