diff options
Diffstat (limited to 'plugins/Spamotron')
-rw-r--r-- | plugins/Spamotron/src/options.cpp | 51 | ||||
-rw-r--r-- | plugins/Spamotron/src/popups.cpp | 34 |
2 files changed, 42 insertions, 43 deletions
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 70de5acef5..dd04e495ac 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -184,13 +184,13 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM }
switch (((NMHDR*)lParam)->code) {
case PSN_APPLY:
- _setOptB("ApproveOnMsgOut", SendDlgItemMessage(optDlg, IDC_OPT_OUT_MSG_APPROVE, BM_GETCHECK, 0, 0));
- _setOptB("ApproveOnMsgIn", SendDlgItemMessage(optDlg, IDC_OPT_IN_MSG_APPROVE, BM_GETCHECK, 0, 0));
- _setOptB("DontReplySameMsg", SendDlgItemMessage(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG, BM_GETCHECK, 0, 0));
- _setOptB("DontReplyMsg", SendDlgItemMessage(optDlg, IDC_OPT_DONT_REPLY_MSG, BM_GETCHECK, 0, 0));
- _setOptB("AddPermanently", SendDlgItemMessage(optDlg, IDC_OPT_ADD_PERMANENTLY, BM_GETCHECK, 0, 0));
- _setOptB("HideUnverified", SendDlgItemMessage(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED, BM_GETCHECK, 0, 0));
- _setOptB("LogActions", SendDlgItemMessage(optDlg, IDC_OPT_LOG_ACTIONS, BM_GETCHECK, 0, 0));
+ _setOptB("ApproveOnMsgOut", IsDlgButtonChecked(optDlg, IDC_OPT_OUT_MSG_APPROVE));
+ _setOptB("ApproveOnMsgIn", IsDlgButtonChecked(optDlg, IDC_OPT_IN_MSG_APPROVE));
+ _setOptB("DontReplySameMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_SAME_MSG));
+ _setOptB("DontReplyMsg", IsDlgButtonChecked(optDlg, IDC_OPT_DONT_REPLY_MSG));
+ _setOptB("AddPermanently", IsDlgButtonChecked(optDlg, IDC_OPT_ADD_PERMANENTLY));
+ _setOptB("HideUnverified", IsDlgButtonChecked(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED));
+ _setOptB("LogActions", IsDlgButtonChecked(optDlg, IDC_OPT_LOG_ACTIONS));
_saveDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, "ApproveOnMsgInWordlist");
_saveDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, "DontReplyMsgWordlist");
_saveDlgItemInt(optDlg, IDC_OPT_MAX_MSG_CONTACT, "MaxMsgContactCountPerDay");
@@ -321,7 +321,7 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP case IDC_OPT_KEEP_BLOCKED_MSG:
case IDC_OPT_MARK_MSG_UNREAD_ON_APPROVAL:
case IDC_OPT_CCRESPONSE:
- EnableWindow(GetDlgItem(optDlg, IDC_OPT_MARK_MSG_UNREAD_ON_APPROVAL), SendDlgItemMessage(optDlg, IDC_OPT_KEEP_BLOCKED_MSG, BM_GETCHECK, 0, 0));
+ EnableWindow(GetDlgItem(optDlg, IDC_OPT_MARK_MSG_UNREAD_ON_APPROVAL), IsDlgButtonChecked(optDlg, IDC_OPT_KEEP_BLOCKED_MSG));
if (HIWORD(wParam) != BN_CLICKED)
return FALSE;
break;
@@ -358,12 +358,12 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP i = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETCURSEL, 0, 0);
selectedMode = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETITEMDATA, i, 0);
_setOptB("Mode", selectedMode);
- _setOptB("ReplyOnSuccess", SendDlgItemMessage(optDlg, IDC_OPT_REPLY_ON_SUCCESS, BM_GETCHECK, 0, 0));
- _setOptB("ReplyOnAuth", SendDlgItemMessage(optDlg, IDC_OPT_REPLY_ON_AUTH, BM_GETCHECK, 0, 0));
- _setOptB("ReplyOnMsg", SendDlgItemMessage(optDlg, IDC_OPT_REPLY_ON_MSG, BM_GETCHECK, 0, 0));
- _setOptB("KeepBlockedMsg", SendDlgItemMessage(optDlg, IDC_OPT_KEEP_BLOCKED_MSG, BM_GETCHECK, 0, 0));
- _setOptB("MarkMsgUnreadOnApproval", SendDlgItemMessage(optDlg, IDC_OPT_MARK_MSG_UNREAD_ON_APPROVAL, BM_GETCHECK, 0, 0));
- _setOptB("ResponseCC", SendDlgItemMessage(optDlg, IDC_OPT_CCRESPONSE, BM_GETCHECK, 0, 0));
+ _setOptB("ReplyOnSuccess", IsDlgButtonChecked(optDlg, IDC_OPT_REPLY_ON_SUCCESS));
+ _setOptB("ReplyOnAuth", IsDlgButtonChecked(optDlg, IDC_OPT_REPLY_ON_AUTH));
+ _setOptB("ReplyOnMsg", IsDlgButtonChecked(optDlg, IDC_OPT_REPLY_ON_MSG));
+ _setOptB("KeepBlockedMsg", IsDlgButtonChecked(optDlg, IDC_OPT_KEEP_BLOCKED_MSG));
+ _setOptB("MarkMsgUnreadOnApproval", IsDlgButtonChecked(optDlg, IDC_OPT_MARK_MSG_UNREAD_ON_APPROVAL));
+ _setOptB("ResponseCC", IsDlgButtonChecked(optDlg, IDC_OPT_CCRESPONSE));
switch (selectedMode) {
case SPAMOTRON_MODE_PLAIN:
_saveDlgItemText(optDlg, IDC_OPT_CHALLENGE, "Challenge");
@@ -399,8 +399,7 @@ void EnableControlsBayes(HWND hwnd, BOOL enable) EnableWindow(GetDlgItem(hwnd, IDC_OPT_BAYES_AUTO_APPROVE), enable);
EnableWindow(GetDlgItem(hwnd, IDC_OPT_BAYES_HAM_SCORE), enable);
EnableWindow(GetDlgItem(hwnd, IDC_OPT_BAYES_AUTOLEARN_APPROVED), enable);
- EnableWindow(GetDlgItem(hwnd, IDC_OPT_BAYES_AUTOLEARN_AUTOAPPROVED), enable &&
- SendDlgItemMessage(hwnd, IDC_OPT_BAYES_AUTO_APPROVE, BM_GETCHECK, 0, 0));
+ EnableWindow(GetDlgItem(hwnd, IDC_OPT_BAYES_AUTOLEARN_AUTOAPPROVED), enable && IsDlgButtonChecked(hwnd, IDC_OPT_BAYES_AUTO_APPROVE));
EnableWindow(GetDlgItem(hwnd, IDC_OPT_BAYES_AUTOLEARN_NOT_APPROVED), enable);
EnableWindow(GetDlgItem(hwnd, IDC_OPT_BAYES_WAIT_APPROVE), enable);
EnableWindow(GetDlgItem(hwnd, IDC_OPT_BAYES_AUTOLEARN_NOT_APPROVED2), enable);
@@ -459,12 +458,12 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA return FALSE;
switch (LOWORD(wParam)) {
case IDC_OPT_BAYES_ENABLED:
- bEnabled = SendDlgItemMessage(optDlg, IDC_OPT_BAYES_ENABLED, BM_GETCHECK, 0, 0);
+ bEnabled = IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_ENABLED);
EnableControlsBayes(optDlg, bEnabled);
case IDC_OPT_BAYES_AUTO_APPROVE:
- bEnabled = SendDlgItemMessage(optDlg, IDC_OPT_BAYES_ENABLED, BM_GETCHECK, 0, 0);
+ bEnabled = IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_ENABLED);
EnableWindow(GetDlgItem(optDlg, IDC_OPT_BAYES_AUTOLEARN_AUTOAPPROVED),
- bEnabled && SendDlgItemMessage(optDlg, IDC_OPT_BAYES_AUTO_APPROVE, BM_GETCHECK, 0, 0));
+ bEnabled && IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_AUTO_APPROVE));
case IDC_OPT_BAYES_BLOCK_MSG:
case IDC_OPT_BAYES_AUTOLEARN_APPROVED:
case IDC_OPT_BAYES_AUTOLEARN_AUTOAPPROVED:
@@ -533,13 +532,13 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY:
switch (((NMHDR*)lParam)->code) {
case PSN_APPLY:
- _setOptB("BayesEnabled", SendDlgItemMessage(optDlg, IDC_OPT_BAYES_ENABLED, BM_GETCHECK, 0, 0));
- _setOptB("BayesBlockMsg", SendDlgItemMessage(optDlg, IDC_OPT_BAYES_BLOCK_MSG, BM_GETCHECK, 0, 0));
- _setOptB("BayesAutoApprove", SendDlgItemMessage(optDlg, IDC_OPT_BAYES_AUTO_APPROVE, BM_GETCHECK, 0, 0));
- _setOptB("BayesAutolearnApproved", SendDlgItemMessage(optDlg, IDC_OPT_BAYES_AUTOLEARN_APPROVED, BM_GETCHECK, 0, 0));
- _setOptB("BayesAutolearnAutoApproved", SendDlgItemMessage(optDlg, IDC_OPT_BAYES_AUTOLEARN_AUTOAPPROVED, BM_GETCHECK, 0, 0));
- _setOptB("BayesAutolearnNotApproved", SendDlgItemMessage(optDlg, IDC_OPT_BAYES_AUTOLEARN_NOT_APPROVED, BM_GETCHECK, 0, 0));
- _setOptB("BayesAutolearnOutgoing", SendDlgItemMessage(optDlg, IDC_OPT_BAYES_AUTOLEARN_OUTGOING, BM_GETCHECK, 0, 0));
+ _setOptB("BayesEnabled", IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_ENABLED));
+ _setOptB("BayesBlockMsg", IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_BLOCK_MSG));
+ _setOptB("BayesAutoApprove", IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_AUTO_APPROVE));
+ _setOptB("BayesAutolearnApproved", IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_AUTOLEARN_APPROVED));
+ _setOptB("BayesAutolearnAutoApproved", IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_AUTOLEARN_AUTOAPPROVED));
+ _setOptB("BayesAutolearnNotApproved", IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_AUTOLEARN_NOT_APPROVED));
+ _setOptB("BayesAutolearnOutgoing", IsDlgButtonChecked(optDlg, IDC_OPT_BAYES_AUTOLEARN_OUTGOING));
_saveDlgItemScore(optDlg, IDC_OPT_BAYES_SPAM_SCORE, "BayesSpamScore");
_saveDlgItemScore(optDlg, IDC_OPT_BAYES_HAM_SCORE, "BayesHamScore");
_saveDlgItemInt(optDlg, IDC_OPT_BAYES_WAIT_APPROVE, "BayesWaitApprove");
diff --git a/plugins/Spamotron/src/popups.cpp b/plugins/Spamotron/src/popups.cpp index 3635aa33bc..eb03aec353 100644 --- a/plugins/Spamotron/src/popups.cpp +++ b/plugins/Spamotron/src/popups.cpp @@ -25,7 +25,7 @@ void EnablePopupControls(HWND hwnd, BOOL enable) void EnablePopupColors(HWND hwnd, BOOL enableDefault, BOOL enableWindows)
{
BOOL enable, bEnabled;
- bEnabled = SendDlgItemMessage(hwnd, IDC_OPT_POPUPS_ENABLED, BM_GETCHECK, 0, 0);
+ bEnabled = IsDlgButtonChecked(hwnd, IDC_OPT_POPUPS_ENABLED);
enable = enableDefault || enableWindows;
EnableWindow(GetDlgItem(hwnd, IDC_OPT_POPUPS_BLOCKED_FOREGROUND), !enable && bEnabled);
EnableWindow(GetDlgItem(hwnd, IDC_OPT_POPUPS_BLOCKED_BACKGROUND), !enable && bEnabled);
@@ -40,7 +40,7 @@ void EnablePopupColors(HWND hwnd, BOOL enableDefault, BOOL enableWindows) void EnablePopupTimeouts(HWND hwnd, BOOL enable)
{
- BOOL bEnabled = SendDlgItemMessage(hwnd, IDC_OPT_POPUPS_ENABLED, BM_GETCHECK, 0, 0);
+ BOOL bEnabled = IsDlgButtonChecked(hwnd, IDC_OPT_POPUPS_ENABLED);
EnableWindow(GetDlgItem(hwnd, IDC_OPT_POPUPS_BLOCKED_TIMEOUT), !enable && bEnabled);
EnableWindow(GetDlgItem(hwnd, IDC_OPT_POPUPS_APPROVED_TIMEOUT), !enable && bEnabled);
EnableWindow(GetDlgItem(hwnd, IDC_OPT_POPUPS_CHALLENGE_TIMEOUT), !enable && bEnabled);
@@ -73,7 +73,7 @@ INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_APPROVED_BACKGROUND, CPM_SETCOLOUR, 0, _getOptD("PopupApprovedBackground", defaultPopupApprovedBackground));
SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_CHALLENGE_FOREGROUND, CPM_SETCOLOUR, 0, _getOptD("PopupChallengeForeground", defaultPopupChallengeForeground));
SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_CHALLENGE_BACKGROUND, CPM_SETCOLOUR, 0, _getOptD("PopupChallengeBackground", defaultPopupChallengeBackground));
- EnablePopupTimeouts(optDlg, SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT, BM_GETCHECK, 0, 0));
+ EnablePopupTimeouts(optDlg, IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT));
EnablePopupColors(optDlg,
_getOptB("PopupDefaultColors", defaultPopupDefaultColors),
_getOptB("PopupWindowsColors", defaultPopupWindowsColors));
@@ -85,7 +85,7 @@ INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wParam, LPAR return FALSE;
switch (LOWORD(wParam)) {
case IDC_OPT_POPUPS_ENABLED:
- bEnabled = SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_ENABLED, BM_GETCHECK, 0, 0);
+ bEnabled = IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_ENABLED);
EnablePopupControls(optDlg, bEnabled);
case IDC_OPT_POPUPS_NOTIFY_BLOCKED:
case IDC_OPT_POPUPS_NOTIFY_APPROVED:
@@ -94,9 +94,9 @@ INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wParam, LPAR case IDC_OPT_POPUPS_WINDOWS_COLORS:
case IDC_OPT_POPUPS_DEFAULT_TIMEOUT:
EnablePopupColors(optDlg,
- SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_COLORS, BM_GETCHECK, 0, 0),
- SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_WINDOWS_COLORS, BM_GETCHECK, 0, 0));
- EnablePopupTimeouts(optDlg, SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT, BM_GETCHECK, 0, 0));
+ IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_DEFAULT_COLORS),
+ IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_WINDOWS_COLORS));
+ EnablePopupTimeouts(optDlg, IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT));
if (HIWORD(wParam) != BN_CLICKED)
return FALSE;
@@ -118,13 +118,13 @@ INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wParam, LPAR case WM_NOTIFY:
switch (((NMHDR*)lParam)->code) {
case PSN_APPLY:
- _setOptB("NotifyPopup", SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_ENABLED, BM_GETCHECK, 0, 0));
- _setOptB("NotifyPopupBlocked", SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_NOTIFY_BLOCKED, BM_GETCHECK, 0, 0));
- _setOptB("NotifyPopupApproved", SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_NOTIFY_APPROVED, BM_GETCHECK, 0, 0));
- _setOptB("NotifyPopupChallenge", SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_NOTIFY_CHALLENGE, BM_GETCHECK, 0, 0));
- _setOptB("PopupDefaultColors", SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_COLORS, BM_GETCHECK, 0, 0));
- _setOptB("PopupWindowsColors", SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_WINDOWS_COLORS, BM_GETCHECK, 0, 0));
- _setOptB("PopupDefaultTimeout", SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT, BM_GETCHECK, 0, 0));
+ _setOptB("NotifyPopup", IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_ENABLED));
+ _setOptB("NotifyPopupBlocked", IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_NOTIFY_BLOCKED));
+ _setOptB("NotifyPopupApproved", IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_NOTIFY_APPROVED));
+ _setOptB("NotifyPopupChallenge", IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_NOTIFY_CHALLENGE));
+ _setOptB("PopupDefaultColors", IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_DEFAULT_COLORS));
+ _setOptB("PopupWindowsColors", IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_WINDOWS_COLORS));
+ _setOptB("PopupDefaultTimeout", IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT));
_saveDlgItemInt(optDlg, IDC_OPT_POPUPS_BLOCKED_TIMEOUT, "PopupBlockedTimeout");
_saveDlgItemInt(optDlg, IDC_OPT_POPUPS_APPROVED_TIMEOUT, "PopupApprovedTimeout");
_saveDlgItemInt(optDlg, IDC_OPT_POPUPS_CHALLENGE_TIMEOUT, "PopupChallengeTimeout");
@@ -171,17 +171,17 @@ int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2) ppdp.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
break;
}
- if (SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_WINDOWS_COLORS, BM_GETCHECK, 0, 0)) {
+ if (IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_WINDOWS_COLORS)) {
ppdp.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppdp.colorBack = GetSysColor(COLOR_WINDOW);
}
- if (SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_COLORS, BM_GETCHECK, 0, 0)) {
+ if (IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_DEFAULT_COLORS)) {
ppdp.colorText = NULL;
ppdp.colorBack = NULL;
}
if (ppdp.iSeconds < 1)
ppdp.iSeconds = -1;
- if (SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT, BM_GETCHECK, 0, 0) || popupType == POPUP_DEFAULT)
+ if (IsDlgButtonChecked(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT) || popupType == POPUP_DEFAULT)
ppdp.iSeconds = 0;
ppdp.lchContact = NULL;
|