Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AboutDialog.cpp « FileManager « UI « 7zip « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a450a765da18bdf7d12904d3b0e819bba33c9e9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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;
}