summaryrefslogtreecommitdiff
path: root/plugins/FileAsMessage/src/optionsdlg.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-15 06:14:17 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-15 06:14:17 +0000
commitcc2454c803eb6b96add654fbd99f616217056396 (patch)
tree31d12ba065f57c5c195cfd962243180ec9c01ff9 /plugins/FileAsMessage/src/optionsdlg.cpp
parentb1571e501505713f1ee2aa8fed181268286d8a1d (diff)
fixed buffer overrun
git-svn-id: http://svn.miranda-ng.org/main/trunk@13600 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FileAsMessage/src/optionsdlg.cpp')
-rw-r--r--plugins/FileAsMessage/src/optionsdlg.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/plugins/FileAsMessage/src/optionsdlg.cpp b/plugins/FileAsMessage/src/optionsdlg.cpp
index 679cade77e..df20bc5ade 100644
--- a/plugins/FileAsMessage/src/optionsdlg.cpp
+++ b/plugins/FileAsMessage/src/optionsdlg.cpp
@@ -2,10 +2,10 @@
DWORD settingDefault[] =
{
- RGB(64,255,64),
- RGB(255,255,64),
- RGB(128,128,128),
- RGB(192,192,192),
+ RGB(64, 255, 64),
+ RGB(255, 255, 64),
+ RGB(128, 128, 128),
+ RGB(192, 192, 192),
6000,
5000
@@ -35,76 +35,76 @@ int settingId[] =
// this handles the options page
// verwaltet die Optionsseite
//
-INT_PTR CALLBACK OptionsDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
+INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch( uMsg )
+ switch (uMsg)
{
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
-
- for(int indx = 0; indx < SIZEOF(settingId); indx++)
- if(settingId[indx] > 0)
- SendDlgItemMessage(hwndDlg, settingId[indx], CPM_SETCOLOUR, 0, db_get_dw(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]));
- else
- SetDlgItemInt(hwndDlg, -settingId[indx], db_get_dw(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]), FALSE);
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_ALPHANUM, db_get_dw(NULL, SERVICE_NAME, "base64", 1) ? BST_CHECKED : BST_UNCHECKED);
+ for (int indx = 0; indx < SIZEOF(settingId); indx++)
+ if (settingId[indx] > 0)
+ SendDlgItemMessage(hwndDlg, settingId[indx], CPM_SETCOLOUR, 0, db_get_dw(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]));
+ else
+ SetDlgItemInt(hwndDlg, -settingId[indx], db_get_dw(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]), FALSE);
- return TRUE;
+ CheckDlgButton(hwndDlg, IDC_ALPHANUM, db_get_dw(NULL, SERVICE_NAME, "base64", 1) ? BST_CHECKED : BST_UNCHECKED);
- }
- case WM_COMMAND:
+ return TRUE;
+
+ }
+ case WM_COMMAND:
+ {
+ if (//MAKEWPARAM(IDC_AUTO, BN_CLICKED) != wParam ||
+ MAKEWPARAM(IDC_ALPHANUM, BN_CLICKED) != wParam)
{
- if(//MAKEWPARAM(IDC_AUTO, BN_CLICKED) != wParam ||
- MAKEWPARAM(IDC_ALPHANUM, BN_CLICKED) != wParam)
- {
- for(int indx = 0; indx < SIZEOF(settingId); indx++)
+ for (int indx = 0; indx < SIZEOF(settingId); indx++)
+ {
+ if (LOWORD(wParam) == abs(settingId[indx]))
{
- if(LOWORD(wParam) == abs(settingId[indx]))
+ if (settingId[indx] > 0)
+ {
+ if (HIWORD(wParam) != CPN_COLOURCHANGED) return FALSE;
+ }
+ else
{
- if(settingId[indx] > 0)
- {
- if(HIWORD(wParam) != CPN_COLOURCHANGED) return FALSE;
- }
- else
- {
- if(HIWORD(wParam) != EN_CHANGE) return FALSE;
- if((HWND)lParam != GetFocus()) return FALSE;
- }
+ if (HIWORD(wParam) != EN_CHANGE) return FALSE;
+ if ((HWND)lParam != GetFocus()) return FALSE;
}
}
}
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0,0);
- break;
}
- case WM_DESTROY:
- return FALSE;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }
+ case WM_DESTROY:
+ return FALSE;
- case WM_NOTIFY:
+ case WM_NOTIFY:
+ {
+ if ((((NMHDR*)lParam)->idFrom == 0) && (((LPNMHDR)lParam)->code == PSN_APPLY))
{
- if((((NMHDR*)lParam)->idFrom == 0) && (((LPNMHDR)lParam)->code == PSN_APPLY))
+ int value;
+ BOOL succ;
+
+ for (int indx = 0; indx < SIZEOF(settingId); indx++)
{
- int value;
- BOOL succ;
-
- for(int indx = 0; indx < SIZEOF(settingId); indx++)
+ if (settingId[indx] > 0)
+ value = SendDlgItemMessage(hwndDlg, settingId[indx], CPM_GETCOLOUR, 0, 0);
+ else
{
- if(settingId[indx] > 0)
- value = SendDlgItemMessage(hwndDlg, settingId[indx], CPM_GETCOLOUR, 0, 0);
- else
- {
- value = GetDlgItemInt(hwndDlg, -settingId[indx], &succ, FALSE);
- if(!succ) value = settingDefault[indx];
- }
- db_set_dw(NULL,SERVICE_NAME,settingName[indx], value);
+ value = GetDlgItemInt(hwndDlg, -settingId[indx], &succ, FALSE);
+ if (!succ) value = settingDefault[indx];
}
- db_set_dw(NULL,SERVICE_NAME, "base64", (IsDlgButtonChecked(hwndDlg, IDC_ALPHANUM) == BST_CHECKED)?1:0);
-
- return TRUE;
+ db_set_dw(NULL, SERVICE_NAME, settingName[indx], value);
}
- break;
+ db_set_dw(NULL, SERVICE_NAME, "base64", (IsDlgButtonChecked(hwndDlg, IDC_ALPHANUM) == BST_CHECKED) ? 1 : 0);
+
+ return TRUE;
}
+ break;
+ }
}