MessageBoxWnd.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #include "MessageBoxWnd.h"
  2. int MessageBoxWnd::Show(HWND m_hWnd,MessageContentType Content)
  3. {
  4. int result = 0;
  5. switch (Content)
  6. {
  7. case MessageContentType::LongInstallingPath:
  8. result = CMsgWnd::MessageBox(
  9. m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_ContentInstallFailed).c_str(),
  10. CLanguage::GetText(TextType::MSG_BtnBackHomePage).c_str(),
  11. CLanguage::GetText(TextType::MSG_BtnUseDefaultPath).c_str()
  12. );
  13. break;
  14. case MessageContentType::IsExitApp:
  15. result = CMsgWnd::MessageBox(
  16. m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_IsExitApp).c_str(),
  17. CLanguage::GetText(TextType::MSG_BtnYes).c_str(),
  18. CLanguage::GetText(TextType::MSG_BtnNo).c_str()
  19. );
  20. break;
  21. case MessageContentType::InstalledIsExitApp:
  22. result = CMsgWnd::MessageBox(
  23. m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_InstalledIsExitApp).c_str(),
  24. CLanguage::GetText(TextType::MSG_BtnYes).c_str(),
  25. CLanguage::GetText(TextType::MSG_BtnNo).c_str()
  26. );
  27. break;
  28. case MessageContentType::DiskNoSpace:
  29. result = CMsgWnd::MessageBox(
  30. m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_DiskNoSpace).c_str(),
  31. CLanguage::GetText(TextType::MSG_BtnOK).c_str()
  32. );
  33. break;
  34. case MessageContentType::HighVertion:
  35. result = MessageBox(m_hWnd, CLanguage::GetText(TextType::MSG_OverHighVersion).c_str(), L"", MB_ICONWARNING);
  36. break;
  37. case MessageContentType::LowVersion:
  38. result = MessageBox(m_hWnd, CLanguage::GetText(TextType::MSG_UpgradeVersion).c_str(), L"", MB_OKCANCEL);
  39. break;
  40. case MessageContentType::SameVersion:
  41. result = MessageBox(m_hWnd, CLanguage::GetText(TextType::MSG_LatestVersion).c_str(), L"", MB_ICONWARNING);
  42. break;
  43. case MessageContentType::InstallingFailed:
  44. result = CMsgWnd::MessageBox(
  45. m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_ContentOpenInstallationFolder).c_str(),
  46. CLanguage::GetText(TextType::MSG_BtnOpenInstallationFolder).c_str(),1/*临时的补丁,因为打开安装文件所在目录的按钮被定义为取消按钮对应的CMsgWnd.cpp有加判断Tag的条件*/
  47. );
  48. break;
  49. case MessageContentType::ProxyNetError:
  50. result = MessageBox(m_hWnd, L"代理服务器没有响应,请检查代理设置。", L"", MB_ICONWARNING);
  51. break;
  52. case MessageContentType::ReStartSystem:
  53. result = CMsgWnd::MessageBox(
  54. m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_InstalledNetReStartSystem).c_str(),
  55. CLanguage::GetText(TextType::MSG_BtnRestartSystem).c_str()
  56. );
  57. break;
  58. default:
  59. break;
  60. }
  61. return result;
  62. }
  63. int MessageBoxWnd::Show(HWND m_hWnd, MessageContentType Content, wstring parameter)
  64. {
  65. int result = 0;
  66. switch (Content)
  67. {
  68. case MessageContentType::InstallingFailed:
  69. /*result = CMsgWnd::MessageBox(
  70. m_hWnd, _T(""), parameter.c_str(),
  71. L"打开安装路径"
  72. );*/
  73. break;
  74. default:
  75. break;
  76. }
  77. return result;
  78. }