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
|
#include "main.h"
#include "resource.h"
int config_ask=1;
int config_ask_each_album=1;
int config_ignore_gained_album=0;
void DoButtons(HWND hwndDlg)
{
config_ask = IsDlgButtonChecked(hwndDlg, IDC_ASK);
config_ask_each_album = IsDlgButtonChecked(hwndDlg, IDC_ALBUM);
EnableWindow(GetDlgItem(hwndDlg, IDC_ALBUM), config_ask);
EnableWindow(GetDlgItem(hwndDlg, IDC_ALL), config_ask);
}
INT_PTR WINAPI RGConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_INITDIALOG:
CheckDlgButton(hwndDlg, IDC_ASK, config_ask);
if (config_ask_each_album)
CheckDlgButton(hwndDlg, IDC_ALBUM, BST_CHECKED);
else
CheckDlgButton(hwndDlg, IDC_ALL, BST_CHECKED);
DoButtons(hwndDlg);
break;
case WM_DESTROY:
{
config_ask = IsDlgButtonChecked(hwndDlg, IDC_ASK);
config_ask_each_album = IsDlgButtonChecked(hwndDlg, IDC_ALBUM);
WritePrivateProfileStringA("ml_rg", "config_ask", config_ask ? "1" : "0", iniFile);
WritePrivateProfileStringA("ml_rg", "config_ask_each_album", config_ask_each_album ? "1" : "0", iniFile);
break;
}
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDCANCEL:
case IDOK:
EndDialog(hwndDlg, 0);
break;
case IDC_ASK:
case IDC_ALBUM:
case IDC_ALL:
DoButtons(hwndDlg);
break;
}
break;
}
return 0;
}
|