summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Mir_core/modules.cpp10
-rw-r--r--plugins/Variables/variables.cpp22
2 files changed, 14 insertions, 18 deletions
diff --git a/plugins/Mir_core/modules.cpp b/plugins/Mir_core/modules.cpp
index 121ed1282b..61e7344676 100644
--- a/plugins/Mir_core/modules.cpp
+++ b/plugins/Mir_core/modules.cpp
@@ -213,12 +213,14 @@ MIR_CORE_DLL(int) CallHookSubscribers(HANDLE hEvent, WPARAM wParam, LPARAM lPara
case 5: returnVal = SendMessage(s->hwnd, s->message, wParam, lParam); break;
default: continue;
}
- if (returnVal)
- break;
+ if (returnVal) {
+ LeaveCriticalSection(&p->csHook);
+ return returnVal;
+ }
}
- // check for no hooks and call the default hook if any
- if (p->subscriberCount == 0 && p->pfnHook != 0)
+ // call the default hook if any
+ if (p->pfnHook != 0)
returnVal = p->pfnHook(wParam, lParam);
LeaveCriticalSection(&p->csHook);
diff --git a/plugins/Variables/variables.cpp b/plugins/Variables/variables.cpp
index 7f8c97371b..d10e42a1ab 100644
--- a/plugins/Variables/variables.cpp
+++ b/plugins/Variables/variables.cpp
@@ -552,26 +552,22 @@ int setParseOptions(struct ParseOptions *po) {
return 0;
}
-int LoadVarModule() {
-
- HMODULE hUxTheme;
-
- if ((initTokenRegister() != 0) || (initContactModule() != 0)) {
-
+int LoadVarModule()
+{
+ if (initTokenRegister() != 0 || initContactModule() != 0)
return -1;
- }
+
setParseOptions(NULL);
hFormatStringService = CreateServiceFunction(MS_VARS_FORMATSTRING, formatStringService);
hFreeMemoryService = CreateServiceFunction(MS_VARS_FREEMEMORY, freeMemory);
hRegisterVariableService = CreateServiceFunction(MS_VARS_REGISTERTOKEN, registerToken);
// help dialog
hCurSplitNS = LoadCursor(NULL, IDC_SIZENS);
- hUxTheme = NULL;
+
if(IsWinVerXPPlus()) {
- hUxTheme = GetModuleHandle(_T("uxtheme.dll"));
- if (hUxTheme) {
+ HMODULE hUxTheme = GetModuleHandle(_T("uxtheme.dll"));
+ if (hUxTheme)
pfnEnableThemeDialogTexture = (BOOL (WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture");
- }
}
hShowHelpService = CreateServiceFunction(MS_VARS_SHOWHELP, showHelpService);
hShowHelpExService = CreateServiceFunction(MS_VARS_SHOWHELPEX, showHelpExService);
@@ -612,9 +608,7 @@ int LoadVarModule() {
log_debugA("Variables: Internal tokens registered");
if (db_getb(SETTING_PARSEATSTARTUP, 0)) {
- FORMATINFO fi;
-
- ZeroMemory(&fi, sizeof(fi));
+ FORMATINFO fi = { 0 };
fi.cbSize = sizeof(fi);
fi.tszFormat = db_gets(SETTING_STARTUPTEXT, NULL);
if (fi.tszFormat != NULL) {