123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- #include "CFrameWnd.h"
- #pragma region 事件逻辑处理
- LRESULT CFrameWnd::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
- {
- switch (wParam)
- {
- case Timer_Banner_ID:
- SetTimerBannerSwitch();
- break;
- case Timer_Installing_ID:
- SetTimerInstalling();
- break;
- case Timer_WaitForNetwork_ID:
- SetTimerBanner();
- break;
- case Timer_SilentInstall_ID:
- SetTimerSilen();
- break;
- default:
- break;
- }
- bHandled = false;
- return 0;
- }
- void CFrameWnd::KillAllTimer()
- {
- KillTimer(m_hWnd, Timer_Banner_ID);
- KillTimer(m_hWnd, Timer_Installing_ID);
- KillTimer(m_hWnd, Timer_WaitForNetwork_ID);
- KillTimer(m_hWnd, Timer_SilentInstall_ID);
- }
- void CFrameWnd::StartTimer(UINT_PTR ID)
- {
- switch (ID)
- {
- case Timer_WaitForNetwork_ID:
- SetTimer(m_hWnd, Timer_WaitForNetwork_ID, Timer_WaitForNetwork_times, NULL);
- break;
- case Timer_Installing_ID:
- SetTimer(m_hWnd, Timer_Installing_ID, Timer_Installing_times, NULL);
- break;
- case Timer_Banner_ID:
- SetTimer(m_hWnd, Timer_Banner_ID, Timer_Banner_Times, NULL);
- break;
- case Timer_SilentInstall_ID:
- KillTimer(m_hWnd, Timer_WaitForNetwork_ID);
- KillTimer(m_hWnd, Timer_Installing_ID);
- SetTimer(m_hWnd, Timer_SilentInstall_ID, Timer_SilentInstall_Times, NULL);
- break;
- default:
- break;
- }
- }
- #pragma endregion
- void CFrameWnd::SlotMsg(TNotifyUI& msg)
- {
- if (msg.sType == DUI_MSGTYPE_CLICK)
- {
- if (msg.pSender->GetName() == _T("BtnClose"))
- {
- if (m_State.m_LayoutType == LayoutType::Home)
- {
- if (MSGID_OK == MessageBoxWnd::Show(m_hWnd, MessageContentType::IsExitApp))
- {
- ::DestroyWindow(m_hWnd);
- }
- }
- else
- {
- if (MSGID_OK == MessageBoxWnd::Show(m_hWnd, MessageContentType::InstalledIsExitApp))
- {
- ::DestroyWindow(m_hWnd);
- }
- }
- }
- if (msg.pSender->GetName() == _T("Btnminsize"))
- {
- SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
- }
- }
- }
- LRESULT CFrameWnd::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
- {
- LRESULT lRes = 0;
- //关闭窗口标识:任务栏右键菜单-》关闭窗口
- if (wParam == 61536)
- {
- //正在安装时,并且在联网的情况下,不允许退出程序窗口
- if (this->m_State.m_LayoutType == LayoutType::Installing && NetWorkState::IsNetWorking())
- return lRes;
- }
- lRes = CWindowWnd::HandleMessage(uMsg, wParam, lParam);
- return lRes;
-
- }
- void CFrameWnd::SelectLayout(LayoutType LayoutType)
- {
- this->m_State.m_LayoutType = LayoutType;
- m_InstallationPage->LayoutHome->SetVisible(false);
- m_InstallingPage->LayoutInstalling->SetVisible(false);
- m_InstalledPage->LayoutInstalled->SetVisible(false);
- switch (LayoutType)
- {
- case LayoutType::Home:
- IsNeedReStartSystem = false;
- m_InstallationPage->LayoutHome->SetVisible(true);
- m_InstallationPage->BtnClose->SetVisible(true);
- break;
- case LayoutType::Installing:
- m_InstallingPage->LayoutInstalling->SetVisible(true);
- m_InstallationPage->BtnClose->SetVisible(false);
- break;
- case LayoutType::Installed:
- m_InstalledPage->LayoutInstalled->SetVisible(true);
- m_InstallationPage->BtnClose->SetVisible(true);
- KillAllTimer();
- break;
- default:
- break;
- }
-
- }
|