Show timeout in support window
This commit is contained in:
parent
ce233b00d8
commit
0429c207e6
|
@ -5,6 +5,7 @@
|
||||||
HWND CSupportWindow::m_hParent = NULL;
|
HWND CSupportWindow::m_hParent = NULL;
|
||||||
CSupportWindow * CSupportWindow::m_this = NULL;
|
CSupportWindow * CSupportWindow::m_this = NULL;
|
||||||
uint32_t CSupportWindow::m_RunCount = 0;
|
uint32_t CSupportWindow::m_RunCount = 0;
|
||||||
|
uint32_t CSupportWindow::m_TimeOutTime = 30;
|
||||||
|
|
||||||
CSupportWindow::CSupportWindow(void)
|
CSupportWindow::CSupportWindow(void)
|
||||||
{
|
{
|
||||||
|
@ -91,7 +92,7 @@ LRESULT CSupportWindow::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
|
||||||
|
|
||||||
::EnableWindow(GetDlgItem(IDCANCEL), false);
|
::EnableWindow(GetDlgItem(IDCANCEL), false);
|
||||||
srand ((uint32_t)time(NULL));
|
srand ((uint32_t)time(NULL));
|
||||||
SetTimer(0, ((rand() % 35) + 5) * 1000, NULL);
|
SetTimer(0, 1000, NULL);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -120,8 +121,14 @@ LRESULT CSupportWindow::OnEraseBackground(UINT /*uMsg*/, WPARAM wParam, LPARAM /
|
||||||
|
|
||||||
LRESULT CSupportWindow::OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
LRESULT CSupportWindow::OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||||
{
|
{
|
||||||
KillTimer(wParam);
|
m_TimeOutTime -= 1;
|
||||||
EnableContinue();
|
if (m_TimeOutTime == 0)
|
||||||
|
{
|
||||||
|
KillTimer(wParam);
|
||||||
|
EnableContinue();
|
||||||
|
}
|
||||||
|
stdstr_f continue_txt(m_TimeOutTime > 0 ? "%s (%d)" : "%s", GS(MSG_SUPPORT_CONTINUE), m_TimeOutTime);
|
||||||
|
SetWindowTextW(GetDlgItem(IDCANCEL), continue_txt.ToUTF16().c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +140,8 @@ LRESULT CSupportWindow::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCt
|
||||||
|
|
||||||
LRESULT CSupportWindow::OnSupportProject64(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
LRESULT CSupportWindow::OnSupportProject64(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||||
{
|
{
|
||||||
ShellExecute(NULL, "open", "http://www.pj64-emu.com/support-project64.html", NULL, NULL, SW_SHOWMAXIMIZED);
|
std::string SupportURL = stdstr_f("http://www.pj64-emu.com/support-project64.html?ver=%s", VER_FILE_VERSION_STR);
|
||||||
|
ShellExecute(NULL, "open", SupportURL.c_str(), NULL, NULL, SW_SHOWMAXIMIZED);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,4 +40,5 @@ private:
|
||||||
static HWND m_hParent;
|
static HWND m_hParent;
|
||||||
static CSupportWindow * m_this;
|
static CSupportWindow * m_this;
|
||||||
static uint32_t m_RunCount;
|
static uint32_t m_RunCount;
|
||||||
|
static uint32_t m_TimeOutTime;
|
||||||
};
|
};
|
Loading…
Reference in New Issue