/********************************************************************* * * WM_BringToTop */ void WM_BringToTop(WM_HWIN hWin) { WM_LOCK(); _BringToTop(hWin); WM_UNLOCK(); }
void FloatDialog::OnTimer(TNotifyUI& msg) { if (msg.wParam == TIMER_BEGIN) { KillTimer(m_hWnd, TIMER_BEGIN); _BringToTop(); } else if (msg.wParam == 2) { CRect rect; GetClientRect(m_hWnd,rect); DuiLib::CPoint curPoint; GetCursorPos(&curPoint); ScreenToClient(m_hWnd,&curPoint); if (rect.PtInRect(curPoint))return; KillTimer(m_hWnd,2); if (m_nOffset <= 0) { PostMessage(WM_CLOSE); return; } else { m_nOffset -= 20; ::MoveWindow(m_hWnd, m_rcWnd.left, m_rcWnd.top - m_nOffset, m_rcWnd.Width(),m_rcWnd.Height(),TRUE); // CPaintManagerUI::SetTimer(this, 2, 30); SetTimer(m_hWnd, 2, 30, nullptr); } } else if (1 == msg.wParam) { KillTimer(m_hWnd,1); if (m_nOffset >= m_rcWnd.Height()) { if (m_iInterval > 0) // CPaintManagerUI::SetTimer(this, 2, m_iInterval); SetTimer(m_hWnd, 2, m_iInterval, nullptr); return; } else { if (m_nOffset + 20 > m_rcWnd.Height()) { m_nOffset = m_rcWnd.Height(); } else { m_nOffset += 20; } ::MoveWindow(m_hWnd, m_rcWnd.left, m_rcWnd.top - m_nOffset,m_rcWnd.Width(),m_rcWnd.Height(),TRUE); //SetFormPosition(CRect(m_rcWnd.left, m_rcWnd.top - m_nOffset, m_rcWnd.right, m_rcWnd.bottom - m_nOffset)); if (m_nOffset < 20 * 2) { //TODO SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER); } //Refresh(); // CPaintManagerUI::SetTimer(this, 1, 30); SetTimer(m_hWnd, 1, 20, nullptr); } } }