forked from bruderstein/PythonScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAboutDialog2.cpp
More file actions
76 lines (60 loc) · 1.39 KB
/
AboutDialog2.cpp
File metadata and controls
76 lines (60 loc) · 1.39 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "stdafx.h"
#include "AboutDialog.h"
#include "PythonScriptVersion.h"
#include "resource.h"
//using namespace std;
AboutDialog::AboutDialog(void)
{
m_hbrBackground = CreateSolidBrush(RGB(255,255,255));
}
AboutDialog::~AboutDialog(void)
{
}
void AboutDialog::doDialog()
{
if (!isCreated())
create(IDD_ABOUTDLG);
goToCenter();
}
BOOL CALLBACK AboutDialog::run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM /* lParam */)
{
switch (Message)
{
case WM_INITDIALOG :
{
std::string message("Python ");
message.append(Py_GetVersion());
message.append("\n");
message.append(Py_GetCopyright());
for (size_t pos = 0;(pos = message.find("\n", pos + 1)) != std::string::npos;)
{
message.replace(pos, 1, "\r\n");
++pos;
}
::SetWindowTextA(GetDlgItem(hWnd, IDC_COPYRIGHT), message.c_str());
::SetWindowText(GetDlgItem(hWnd, IDC_VERSION), _T(PYSCR_VERSION_STRING));
return TRUE;
}
case WM_CTLCOLORDLG:
return (LONG)m_hbrBackground;
case WM_CTLCOLORSTATIC:
{
HDC hdcStatic = (HDC)wParam;
SetBkMode(hdcStatic, TRANSPARENT);
return (LONG)m_hbrBackground;
}
case WM_COMMAND :
{
switch (wParam)
{
case IDOK :
case IDCANCEL :
display(FALSE);
return TRUE;
default :
break;
}
}
}
return FALSE;
}