-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatdlg.c
69 lines (47 loc) · 2.24 KB
/
statdlg.c
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
#include "defs.h"
LOCAL INT_PTR CALLBACK StatisticsDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
WCHAR szBuffer[MAX_STRING];
switch (uMsg)
{
case WM_INITDIALOG:
StringCchPrintfW (szBuffer, MAX_STRING, L"%d", g_nBlockStatistics[BLOCKL]);
SetDlgItemText (hDlg, IDC_STATISTICSBLOCKL, szBuffer);
StringCchPrintfW (szBuffer, MAX_STRING, L"%d", g_nBlockStatistics[BLOCKI]);
SetDlgItemText (hDlg, IDC_STATISTICSBLOCKI, szBuffer);
StringCchPrintfW (szBuffer, MAX_STRING, L"%d", g_nBlockStatistics[BLOCKT]);
SetDlgItemText (hDlg, IDC_STATISTICSBLOCKT, szBuffer);
StringCchPrintfW (szBuffer, MAX_STRING, L"%d", g_nBlockStatistics[BLOCKS]);
SetDlgItemText (hDlg, IDC_STATISTICSBLOCKS, szBuffer);
StringCchPrintfW (szBuffer, MAX_STRING, L"%d", g_nBlockStatistics[BLOCKZ]);
SetDlgItemText (hDlg, IDC_STATISTICSBLOCKZ, szBuffer);
StringCchPrintfW (szBuffer, MAX_STRING, L"%d", g_nBlockStatistics[BLOCKO]);
SetDlgItemText (hDlg, IDC_STATISTICSBLOCKO, szBuffer);
StringCchPrintfW (szBuffer, MAX_STRING, L"%d", g_nBlockStatistics[BLOCKJ]);
SetDlgItemText (hDlg, IDC_STATISTICSBLOCKJ, szBuffer);
StringCchPrintfW (szBuffer, MAX_STRING, L"%d",
g_nBlockStatistics[BLOCKL] +
g_nBlockStatistics[BLOCKI] +
g_nBlockStatistics[BLOCKT] +
g_nBlockStatistics[BLOCKS] +
g_nBlockStatistics[BLOCKZ] +
g_nBlockStatistics[BLOCKO] +
g_nBlockStatistics[BLOCKJ]
);
SetDlgItemText (hDlg, IDC_STATISTICSTOTAL, szBuffer);
return TRUE;
case WM_COMMAND:
switch (LOWORD (wParam))
{
case IDOK:
case IDCANCEL: // Cancel button in upper right corner of dialog window.
EndDialog (hDlg, wParam);
return TRUE;
}
}
return FALSE;
}
void ShowStatisticsDialog (void)
{
DialogBox (NULL, MAKEINTRESOURCE (IDD_STATISTICS), g_hwndMain, StatisticsDlgProc);
}