diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-08-27 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:54 +0300 |
commit | 051769bbc577aeede90558b6ab5c9be187940ca0 (patch) | |
tree | e6330cb80f2d4a526d8aa27812528e053b0cda90 /CPP/7zip/UI/FileManager/AboutDialog.cpp | |
parent | 33ccab7e728a996800e166d849fe1e92a17e1afe (diff) |
4.53 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/AboutDialog.cpp')
-rwxr-xr-x | CPP/7zip/UI/FileManager/AboutDialog.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/CPP/7zip/UI/FileManager/AboutDialog.cpp b/CPP/7zip/UI/FileManager/AboutDialog.cpp new file mode 100755 index 00000000..fcdea7e0 --- /dev/null +++ b/CPP/7zip/UI/FileManager/AboutDialog.cpp @@ -0,0 +1,60 @@ +// AboutDialog.cpp + +#include "StdAfx.h" + +#include "AboutDialogRes.h" +#include "AboutDialog.h" +#include "HelpUtils.h" +#include "LangUtils.h" + +static CIDLangPair kIDLangPairs[] = +{ + { IDC_ABOUT_STATIC_REGISTER_INFO, 0x01000103 }, + { IDC_ABOUT_BUTTON_SUPPORT, 0x01000104 }, + { IDC_ABOUT_BUTTON_REGISTER, 0x01000105 }, + { IDOK, 0x02000702 } +}; + +#define MY_HOME_PAGE TEXT("http://www.7-zip.org/") + +static LPCTSTR kHomePageURL = MY_HOME_PAGE; +static LPCTSTR kRegisterPageURL = MY_HOME_PAGE TEXT("register.html"); +static LPCTSTR kSupportPageURL = MY_HOME_PAGE TEXT("support.html"); + +static LPCWSTR kHelpTopic = L"start.htm"; + +bool CAboutDialog::OnInit() +{ + LangSetWindowText(HWND(*this), 0x01000100); + LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0])); + return CModalDialog::OnInit(); +} + +void CAboutDialog::OnHelp() +{ + ShowHelpWindow(NULL, kHelpTopic); +} + +static void MyShellExecute(LPCTSTR url) +{ + ::ShellExecute(NULL, NULL, url, NULL, NULL, SW_SHOWNORMAL); +} + +bool CAboutDialog::OnButtonClicked(int buttonID, HWND buttonHWND) +{ + switch(buttonID) + { + case IDC_ABOUT_BUTTON_HOMEPAGE: + ::MyShellExecute(kHomePageURL); + break; + case IDC_ABOUT_BUTTON_REGISTER: + ::MyShellExecute(kRegisterPageURL); + break; + case IDC_ABOUT_BUTTON_SUPPORT: + ::MyShellExecute(kSupportPageURL); + break; + default: + return CModalDialog::OnButtonClicked(buttonID, buttonHWND); + } + return true; +} |