summaryrefslogtreecommitdiff
path: root/plugins/KeyboardNotify/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/KeyboardNotify/src
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/KeyboardNotify/src')
-rw-r--r--plugins/KeyboardNotify/src/constants.h2
-rw-r--r--plugins/KeyboardNotify/src/flash.cpp6
-rw-r--r--plugins/KeyboardNotify/src/ignore.cpp8
-rw-r--r--plugins/KeyboardNotify/src/main.cpp94
-rw-r--r--plugins/KeyboardNotify/src/options.cpp110
-rw-r--r--plugins/KeyboardNotify/src/stdafx.h4
6 files changed, 115 insertions, 109 deletions
diff --git a/plugins/KeyboardNotify/src/constants.h b/plugins/KeyboardNotify/src/constants.h
index f9000b0160..61c6304906 100644
--- a/plugins/KeyboardNotify/src/constants.h
+++ b/plugins/KeyboardNotify/src/constants.h
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma once
// Settings values
-#define KEYBDMODULE "keybdnotify"
+#define MODULENAME "keybdnotify"
#define FLASH_SAMETIME 0
#define FLASH_INTURN 1
#define FLASH_INSEQUENCE 2
diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp
index b5da36a964..20c7888ba7 100644
--- a/plugins/KeyboardNotify/src/flash.cpp
+++ b/plugins/KeyboardNotify/src/flash.cpp
@@ -88,7 +88,7 @@ void setFlashingSequence(void)
FLASHING_SEQUENCE *getCustomSeq(void)
{
- ptrW tszSeq( db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", wCustomTheme)));
+ ptrW tszSeq( db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", wCustomTheme)));
static FLASHING_SEQUENCE Custom = {0};
Custom = str2FS((tszSeq != 0) ? tszSeq : L"");
@@ -317,8 +317,8 @@ void testSequence(wchar_t *testStr)
static void __cdecl TestThread(void *param)
{
FLASHING_SEQUENCE *pTest = (FLASHING_SEQUENCE *)param;
- unsigned int testNum = (unsigned int)db_get_b(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM);
- unsigned int testSecs = (unsigned int)db_get_b(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS);
+ unsigned int testNum = (unsigned int)db_get_b(NULL, MODULENAME, "testnum", DEF_SETTING_TESTNUM);
+ unsigned int testSecs = (unsigned int)db_get_b(NULL, MODULENAME, "testsecs", DEF_SETTING_TESTSECS);
for (unsigned i=0, dwEndTest=GetTickCount()+testSecs*1000; i < testNum || GetTickCount() < dwEndTest; i++)
for (pTest->index=0; pTest->index < pTest->size; pTest->index++) {
diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp
index 5869374523..35abefc6d4 100644
--- a/plugins/KeyboardNotify/src/ignore.cpp
+++ b/plugins/KeyboardNotify/src/ignore.cpp
@@ -27,15 +27,15 @@ static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = {PF1_IMRECV, PF1_URLRECV, PF
static DWORD GetMask(MCONTACT hContact)
{
- DWORD mask = db_get_dw(hContact, KEYBDMODULE, "Mask1", (DWORD)(-1));
+ DWORD mask = db_get_dw(hContact, MODULENAME, "Mask1", (DWORD)(-1));
if(mask == (DWORD)(-1)) {
if(hContact == NULL)
mask=0;
else {
if(db_get_b(hContact, "CList", "Hidden", 0) || db_get_b(hContact, "CList", "NotOnList", 0))
- mask = db_get_dw(NULL, KEYBDMODULE, "Mask1", 0);
+ mask = db_get_dw(NULL, MODULENAME, "Mask1", 0);
else
- mask = db_get_dw(NULL, KEYBDMODULE, "Default1", 0);
+ mask = db_get_dw(NULL, MODULENAME, "Default1", 0);
}
}
return mask;
@@ -164,7 +164,7 @@ static void SaveItemMask(HWND hwndList, MCONTACT hContact, HANDLE hItem, const c
if(iImage && iImage != EMPTY_EXTRA_ICON)
mask |= 1<<i;
}
- db_set_dw(hContact, KEYBDMODULE, pszSetting, mask);
+ db_set_dw(hContact, MODULENAME, pszSetting, mask);
}
static void SetAllContactIcons(HWND hwndList)
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp
index 5919340b29..1d9637abee 100644
--- a/plugins/KeyboardNotify/src/main.cpp
+++ b/plugins/KeyboardNotify/src/main.cpp
@@ -86,7 +86,9 @@ BOOL bReminderDisabled = FALSE;
BYTE bMetaProtoEnabled = 0;
-PLUGININFOEX pluginInfo =
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -100,11 +102,17 @@ PLUGININFOEX pluginInfo =
{0x119d7288, 0x2050, 0x448d, {0x99, 0x00, 0xd8, 0x6a, 0xc7, 0x04, 0x26, 0xbf}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
int InitializeOptions(WPARAM, LPARAM);
BOOL CheckMsgWnd(MCONTACT, BOOL *);
@@ -508,13 +516,13 @@ void StartBlinkAction(char *flashSequence, WORD eventMaxSeconds)
void createProcessList(void)
{
- int count = db_get_w(NULL, KEYBDMODULE, "processcount", 0);
+ int count = db_get_w(NULL, MODULENAME, "processcount", 0);
ProcessList.count = 0;
ProcessList.szFileName = (wchar_t **)mir_alloc(count * sizeof(wchar_t *));
if (ProcessList.szFileName) {
for (int i = 0; i < count; i++)
- ProcessList.szFileName[i] = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i));
+ ProcessList.szFileName[i] = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("process%d", i));
ProcessList.count = count;
}
@@ -664,36 +672,36 @@ int UnhookWindowsHooks()
void LoadSettings(void)
{
- bFlashOnMsg = db_get_b(NULL, KEYBDMODULE, "onmsg", DEF_SETTING_ONMSG);
- bFlashOnURL = db_get_b(NULL, KEYBDMODULE, "onurl", DEF_SETTING_ONURL);
- bFlashOnFile = db_get_b(NULL, KEYBDMODULE, "onfile", DEF_SETTING_ONFILE);
- bFlashOnOther = db_get_b(NULL, KEYBDMODULE, "onother", DEF_SETTING_OTHER);
- bFullScreenMode = db_get_b(NULL, KEYBDMODULE, "fscreenmode", DEF_SETTING_FSCREEN);
- bScreenSaverRunning = db_get_b(NULL, KEYBDMODULE, "ssaverrunning", DEF_SETTING_SSAVER);
- bWorkstationLocked = db_get_b(NULL, KEYBDMODULE, "wstationlocked", DEF_SETTING_LOCKED);
- bProcessesAreRunning = db_get_b(NULL, KEYBDMODULE, "procsrunning", DEF_SETTING_PROCS);
- bWorkstationActive = db_get_b(NULL, KEYBDMODULE, "wstationactive", DEF_SETTING_ACTIVE);
- bFlashIfMsgOpen = db_get_b(NULL, KEYBDMODULE, "ifmsgopen", DEF_SETTING_IFMSGOPEN);
- bFlashIfMsgWinNotTop = db_get_b(NULL, KEYBDMODULE, "ifmsgnottop", DEF_SETTING_IFMSGNOTTOP);
- bFlashIfMsgOlder = db_get_b(NULL, KEYBDMODULE, "ifmsgolder", DEF_SETTING_IFMSGOLDER);
- wSecondsOlder = db_get_w(NULL, KEYBDMODULE, "secsolder", DEF_SETTING_SECSOLDER);
- bFlashUntil = db_get_b(NULL, KEYBDMODULE, "funtil", DEF_SETTING_FLASHUNTIL);
- wBlinksNumber = db_get_w(NULL, KEYBDMODULE, "nblinks", DEF_SETTING_NBLINKS);
- bMirandaOrWindows = db_get_b(NULL, KEYBDMODULE, "mirorwin", DEF_SETTING_MIRORWIN);
- wStatusMap = db_get_w(NULL, KEYBDMODULE, "status", DEF_SETTING_STATUS);
- wReminderCheck = db_get_w(NULL, KEYBDMODULE, "remcheck", DEF_SETTING_CHECKTIME);
- bFlashLed[0] = db_get_b(NULL, KEYBDMODULE, "fnum", DEF_SETTING_FLASHNUM);
- bFlashLed[1] = db_get_b(NULL, KEYBDMODULE, "fcaps", DEF_SETTING_FLASHCAPS);
- bFlashLed[2] = db_get_b(NULL, KEYBDMODULE, "fscroll", DEF_SETTING_FLASHSCROLL);
- bFlashEffect = db_get_b(NULL, KEYBDMODULE, "feffect", DEF_SETTING_FLASHEFFECT);
- bSequenceOrder = db_get_b(NULL, KEYBDMODULE, "order", DEF_SETTING_SEQORDER);
- wCustomTheme = db_get_w(NULL, KEYBDMODULE, "custom", DEF_SETTING_CUSTOMTHEME);
- bTrillianLedsMsg = db_get_b(NULL, KEYBDMODULE, "ledsmsg", DEF_SETTING_LEDSMSG);
- bTrillianLedsURL = db_get_b(NULL, KEYBDMODULE, "ledsurl", DEF_SETTING_LEDSURL);
- bTrillianLedsFile = db_get_b(NULL, KEYBDMODULE, "ledsfile", DEF_SETTING_LEDSFILE);
- bTrillianLedsOther = db_get_b(NULL, KEYBDMODULE, "ledsother", DEF_SETTING_LEDSOTHER);
- wStartDelay = db_get_w(NULL, KEYBDMODULE, "sdelay", DEF_SETTING_STARTDELAY);
- bFlashSpeed = db_get_b(NULL, KEYBDMODULE, "speed", DEF_SETTING_FLASHSPEED);
+ bFlashOnMsg = db_get_b(NULL, MODULENAME, "onmsg", DEF_SETTING_ONMSG);
+ bFlashOnURL = db_get_b(NULL, MODULENAME, "onurl", DEF_SETTING_ONURL);
+ bFlashOnFile = db_get_b(NULL, MODULENAME, "onfile", DEF_SETTING_ONFILE);
+ bFlashOnOther = db_get_b(NULL, MODULENAME, "onother", DEF_SETTING_OTHER);
+ bFullScreenMode = db_get_b(NULL, MODULENAME, "fscreenmode", DEF_SETTING_FSCREEN);
+ bScreenSaverRunning = db_get_b(NULL, MODULENAME, "ssaverrunning", DEF_SETTING_SSAVER);
+ bWorkstationLocked = db_get_b(NULL, MODULENAME, "wstationlocked", DEF_SETTING_LOCKED);
+ bProcessesAreRunning = db_get_b(NULL, MODULENAME, "procsrunning", DEF_SETTING_PROCS);
+ bWorkstationActive = db_get_b(NULL, MODULENAME, "wstationactive", DEF_SETTING_ACTIVE);
+ bFlashIfMsgOpen = db_get_b(NULL, MODULENAME, "ifmsgopen", DEF_SETTING_IFMSGOPEN);
+ bFlashIfMsgWinNotTop = db_get_b(NULL, MODULENAME, "ifmsgnottop", DEF_SETTING_IFMSGNOTTOP);
+ bFlashIfMsgOlder = db_get_b(NULL, MODULENAME, "ifmsgolder", DEF_SETTING_IFMSGOLDER);
+ wSecondsOlder = db_get_w(NULL, MODULENAME, "secsolder", DEF_SETTING_SECSOLDER);
+ bFlashUntil = db_get_b(NULL, MODULENAME, "funtil", DEF_SETTING_FLASHUNTIL);
+ wBlinksNumber = db_get_w(NULL, MODULENAME, "nblinks", DEF_SETTING_NBLINKS);
+ bMirandaOrWindows = db_get_b(NULL, MODULENAME, "mirorwin", DEF_SETTING_MIRORWIN);
+ wStatusMap = db_get_w(NULL, MODULENAME, "status", DEF_SETTING_STATUS);
+ wReminderCheck = db_get_w(NULL, MODULENAME, "remcheck", DEF_SETTING_CHECKTIME);
+ bFlashLed[0] = db_get_b(NULL, MODULENAME, "fnum", DEF_SETTING_FLASHNUM);
+ bFlashLed[1] = db_get_b(NULL, MODULENAME, "fcaps", DEF_SETTING_FLASHCAPS);
+ bFlashLed[2] = db_get_b(NULL, MODULENAME, "fscroll", DEF_SETTING_FLASHSCROLL);
+ bFlashEffect = db_get_b(NULL, MODULENAME, "feffect", DEF_SETTING_FLASHEFFECT);
+ bSequenceOrder = db_get_b(NULL, MODULENAME, "order", DEF_SETTING_SEQORDER);
+ wCustomTheme = db_get_w(NULL, MODULENAME, "custom", DEF_SETTING_CUSTOMTHEME);
+ bTrillianLedsMsg = db_get_b(NULL, MODULENAME, "ledsmsg", DEF_SETTING_LEDSMSG);
+ bTrillianLedsURL = db_get_b(NULL, MODULENAME, "ledsurl", DEF_SETTING_LEDSURL);
+ bTrillianLedsFile = db_get_b(NULL, MODULENAME, "ledsfile", DEF_SETTING_LEDSFILE);
+ bTrillianLedsOther = db_get_b(NULL, MODULENAME, "ledsother", DEF_SETTING_LEDSOTHER);
+ wStartDelay = db_get_w(NULL, MODULENAME, "sdelay", DEF_SETTING_STARTDELAY);
+ bFlashSpeed = db_get_b(NULL, MODULENAME, "speed", DEF_SETTING_FLASHSPEED);
switch (bFlashSpeed) {
case 0: nWaitDelay = 1500; break;
case 1: nWaitDelay = 0750; break;
@@ -703,19 +711,19 @@ void LoadSettings(void)
default: nWaitDelay = 0050; break;
}
setFlashingSequence();
- bEmulateKeypresses = db_get_b(NULL, KEYBDMODULE, "keypresses", DEF_SETTING_KEYPRESSES);
- bOverride = db_get_b(NULL, KEYBDMODULE, "override", DEF_SETTING_OVERRIDE);
+ bEmulateKeypresses = db_get_b(NULL, MODULENAME, "keypresses", DEF_SETTING_KEYPRESSES);
+ bOverride = db_get_b(NULL, MODULENAME, "override", DEF_SETTING_OVERRIDE);
// Create hidden settings (for test button) if needed
- if (db_get_b(NULL, KEYBDMODULE, "testnum", -1) == -1)
- db_set_b(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM);
- if (db_get_b(NULL, KEYBDMODULE, "testsecs", -1) == -1)
- db_set_b(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS);
+ if (db_get_b(NULL, MODULENAME, "testnum", -1) == -1)
+ db_set_b(NULL, MODULENAME, "testnum", DEF_SETTING_TESTNUM);
+ if (db_get_b(NULL, MODULENAME, "testsecs", -1) == -1)
+ db_set_b(NULL, MODULENAME, "testsecs", DEF_SETTING_TESTSECS);
for (int i = 0; i < ProtoList.protoCount; i++)
if (ProtoList.protoInfo[i].visible) {
unsigned int j;
- ProtoList.protoInfo[i].enabled = db_get_b(NULL, KEYBDMODULE, ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL);
+ ProtoList.protoInfo[i].enabled = db_get_b(NULL, MODULENAME, ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL);
for (j = 0; j < ProtoList.protoInfo[i].xstatus.count; j++)
- ProtoList.protoInfo[i].xstatus.enabled[j] = db_get_b(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS);
+ ProtoList.protoInfo[i].xstatus.enabled[j] = db_get_b(NULL, MODULENAME, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS);
}
bMetaProtoEnabled = db_mc_isEnabled();
@@ -925,7 +933,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
extern "C" __declspec(dllexport) int Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
GetWindowsVersion();
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp
index 1d48df4dd0..a66c01ca97 100644
--- a/plugins/KeyboardNotify/src/options.cpp
+++ b/plugins/KeyboardNotify/src/options.cpp
@@ -65,10 +65,10 @@ void exportThemes(const wchar_t *filename)
fwprintf(fExport, TranslateT("\n; Automatically generated Keyboard Notify Theme file\n\n\n"));
wchar_t *szTheme;
- for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) {
+ for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) {
fwprintf(fExport, L"[%s]\n", szTheme);
mir_free(szTheme);
- if (szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i))) {
+ if (szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", i))) {
fwprintf(fExport, L"%s\n\n", szTheme);
mir_free(szTheme);
}
@@ -551,7 +551,7 @@ static INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM, LPAR
for (int i = 0; i < ListView_GetItemCount(hList); i++) {
lvItem.iItem = i;
ListView_GetItem(hList, &lvItem);
- db_set_b(NULL, KEYBDMODULE, (char *)lvItem.lParam, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
+ db_set_b(NULL, MODULENAME, (char *)lvItem.lParam, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
}
}
@@ -750,21 +750,21 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, KEYBDMODULE, "onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "onurl", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONURL) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1 : 0));
-
- db_set_b(NULL, KEYBDMODULE, "fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1 : 0));
-
- db_set_b(NULL, KEYBDMODULE, "ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1 : 0));
- db_set_w(NULL, KEYBDMODULE, "secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, MODULENAME, "onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "onurl", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONURL) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1 : 0));
+
+ db_set_b(NULL, MODULENAME, "fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1 : 0));
+
+ db_set_b(NULL, MODULENAME, "ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1 : 0));
+ db_set_w(NULL, MODULENAME, "secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0));
if (IsDlgButtonChecked(hwndDlg, IDC_UNTILBLK) == BST_CHECKED)
untilMap |= UNTIL_NBLINKS;
@@ -774,9 +774,9 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara
untilMap |= UNTIL_EVENTSOPEN;
if (IsDlgButtonChecked(hwndDlg, IDC_UNTILCOND) == BST_CHECKED)
untilMap |= UNTIL_CONDITIONS;
- db_set_b(NULL, KEYBDMODULE, "funtil", untilMap);
- db_set_w(NULL, KEYBDMODULE, "nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- db_set_b(NULL, KEYBDMODULE, "mirorwin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0));
+ db_set_b(NULL, MODULENAME, "funtil", untilMap);
+ db_set_w(NULL, MODULENAME, "nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, MODULENAME, "mirorwin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0));
if (IsDlgButtonChecked(hwndDlg, IDC_ONLINE) == BST_CHECKED)
statusMap |= MAP_ONLINE;
@@ -798,21 +798,21 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara
statusMap |= MAP_OUTTOLUNCH;
if (IsDlgButtonChecked(hwndDlg, IDC_OFFLINE) == BST_CHECKED)
statusMap |= MAP_OFFLINE;
- db_set_w(NULL, KEYBDMODULE, "status", statusMap);
+ db_set_w(NULL, MODULENAME, "status", statusMap);
- db_set_w(NULL, KEYBDMODULE, "remcheck", (WORD)SendDlgItemMessage(hwndDlg, IDC_REMCHECK, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, MODULENAME, "remcheck", (WORD)SendDlgItemMessage(hwndDlg, IDC_REMCHECK, UDM_GETPOS, 0, 0));
int i = 0;
for (int j = 0; j < ProcessListAux.count; j++)
if (ProcessListAux.szFileName[j])
- db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]);
- db_set_w(NULL, KEYBDMODULE, "processcount", (WORD)i);
- while (!db_unset(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++)));
+ db_set_ws(NULL, MODULENAME, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]);
+ db_set_w(NULL, MODULENAME, "processcount", (WORD)i);
+ while (!db_unset(NULL, MODULENAME, fmtDBSettingName("process%d", i++)));
if (XstatusListAux)
for (i = 0; i < ProtoList.protoCount; i++)
for (int j = 0; j < (int)XstatusListAux[i].count; j++)
- db_set_b(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]);
+ db_set_b(NULL, MODULENAME, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]);
LoadSettings();
@@ -863,7 +863,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar
CheckDlgButton(hwndDlg, IDC_CUSTOM, bFlashEffect == FLASH_CUSTOM ? BST_CHECKED : BST_UNCHECKED);
wchar_t *szTheme;
- for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) {
+ for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme);
mir_free(szTheme);
if (index != CB_ERR && index != CB_ERRSPACE)
@@ -941,33 +941,33 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, KEYBDMODULE, "fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1 : 0));
- db_set_b(NULL, KEYBDMODULE, "fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1 : 0));
if (IsDlgButtonChecked(hwndDlg, IDC_INTURN) == BST_CHECKED)
- db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INTURN);
+ db_set_b(NULL, MODULENAME, "feffect", FLASH_INTURN);
else if (IsDlgButtonChecked(hwndDlg, IDC_INSEQUENCE) == BST_CHECKED)
- db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INSEQUENCE);
+ db_set_b(NULL, MODULENAME, "feffect", FLASH_INSEQUENCE);
else if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOM) == BST_CHECKED)
- db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_CUSTOM);
+ db_set_b(NULL, MODULENAME, "feffect", FLASH_CUSTOM);
else if (IsDlgButtonChecked(hwndDlg, IDC_TRILLIAN) == BST_CHECKED)
- db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_TRILLIAN);
+ db_set_b(NULL, MODULENAME, "feffect", FLASH_TRILLIAN);
else
- db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_SAMETIME);
- db_set_b(NULL, KEYBDMODULE, "order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0));
- db_set_w(NULL, KEYBDMODULE, "custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0));
+ db_set_b(NULL, MODULENAME, "feffect", FLASH_SAMETIME);
+ db_set_b(NULL, MODULENAME, "order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0));
+ db_set_w(NULL, MODULENAME, "custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0));
- db_set_b(NULL, KEYBDMODULE, "ledsmsg", trillianLedsMsg);
- db_set_b(NULL, KEYBDMODULE, "ledsfile", trillianLedsFile);
- db_set_b(NULL, KEYBDMODULE, "ledsurl", trillianLedsURL);
- db_set_b(NULL, KEYBDMODULE, "ledsother", trillianLedsOther);
+ db_set_b(NULL, MODULENAME, "ledsmsg", trillianLedsMsg);
+ db_set_b(NULL, MODULENAME, "ledsfile", trillianLedsFile);
+ db_set_b(NULL, MODULENAME, "ledsurl", trillianLedsURL);
+ db_set_b(NULL, MODULENAME, "ledsother", trillianLedsOther);
- db_set_w(NULL, KEYBDMODULE, "sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, MODULENAME, "sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0));
- db_set_b(NULL, KEYBDMODULE, "speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0));
+ db_set_b(NULL, MODULENAME, "speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0));
- db_set_b(NULL, KEYBDMODULE, "keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1 : 0));
LoadSettings();
@@ -999,11 +999,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
SendDlgItemMessage(hwndDlg, IDC_CUSTOMSTRING, EM_LIMITTEXT, MAX_PATH, 0);
wchar_t *szTheme;
- for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) {
+ for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme);
mir_free(szTheme);
if (index != CB_ERR && index != CB_ERRSPACE) {
- wchar_t *str = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i));
+ wchar_t *str = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", i));
if (str)
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)str);
}
@@ -1224,7 +1224,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- if (szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", wCustomTheme))) {
+ if (szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", wCustomTheme))) {
mir_wstrcpy(theme, szTheme);
mir_free(szTheme);
}
@@ -1237,12 +1237,12 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
count = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)themeAux);
- db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux);
+ db_set_ws(NULL, MODULENAME, fmtDBSettingName("theme%d", i), themeAux);
wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0);
if (str)
- db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str);
+ db_set_ws(NULL, MODULENAME, fmtDBSettingName("custom%d", i), str);
else
- db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), L"");
+ db_set_ws(NULL, MODULENAME, fmtDBSettingName("custom%d", i), L"");
if (!mir_wstrcmp(theme, themeAux))
wCustomTheme = i;
@@ -1251,14 +1251,14 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)i, (LPARAM)themeAux);
SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETITEMDATA, (WPARAM)i, (LPARAM)i);
}
- for (int i = count; !db_unset(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++)
- db_unset(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i));
+ for (int i = count; !db_unset(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++)
+ db_unset(NULL, MODULENAME, fmtDBSettingName("custom%d", i));
- db_set_w(NULL, KEYBDMODULE, "custom", wCustomTheme);
+ db_set_w(NULL, MODULENAME, "custom", wCustomTheme);
// Still updating here the the Flashing tab's controls
SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETCURSEL, (WPARAM)wCustomTheme, 0);
- db_set_b(NULL, KEYBDMODULE, "override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1 : 0));
+ db_set_b(NULL, MODULENAME, "override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1 : 0));
return TRUE;
} // switch code
diff --git a/plugins/KeyboardNotify/src/stdafx.h b/plugins/KeyboardNotify/src/stdafx.h
index 992962837a..6af0fffa14 100644
--- a/plugins/KeyboardNotify/src/stdafx.h
+++ b/plugins/KeyboardNotify/src/stdafx.h
@@ -57,7 +57,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(KEYBDMODULE)
- {}
+ CMPlugin();
};