summaryrefslogtreecommitdiff
path: root/plugins/YAPP/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/YAPP/src')
-rw-r--r--plugins/YAPP/src/popwin.cpp2
-rw-r--r--plugins/YAPP/src/services.cpp15
2 files changed, 12 insertions, 5 deletions
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp
index 01ba681cfe..44f2209b52 100644
--- a/plugins/YAPP/src/popwin.cpp
+++ b/plugins/YAPP/src/popwin.cpp
@@ -376,7 +376,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// avatar & time if with avatar
if (options.av_layout != PAV_NONE && (pwd->have_av || options.time_layout == PT_WITHAV)) {
- RECT avr;
+ RECT avr = { 0 };
avr.top = options.av_padding;
if (options.av_layout == PAV_LEFT) {
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index bcee759527..88f6a65cfe 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -214,6 +214,7 @@ INT_PTR PopupQuery(WPARAM wParam, LPARAM)
{
bool enabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) != 0;
if (!enabled) db_set_b(0, "Popup", "ModuleIsEnabled", 1);
+ UpdateMenu();
return !enabled;
}
break;
@@ -221,18 +222,17 @@ INT_PTR PopupQuery(WPARAM wParam, LPARAM)
{
bool enabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) != 0;
if (enabled) db_set_b(0, "Popup", "ModuleIsEnabled", 0);
+ UpdateMenu();
return enabled;
}
break;
case PUQS_GETSTATUS:
return db_get_b(0, "Popup", "ModuleIsEnabled", 1);
-
default:
+ UpdateMenu();
return 1;
}
- UpdateMenu();
- return 0;
}
static INT_PTR TogglePopups(WPARAM, LPARAM)
@@ -410,6 +410,11 @@ static INT_PTR CreateClassPopup(WPARAM wParam, LPARAM lParam)
return 0;
}
+INT_PTR Popup_DeletePopup(WPARAM, LPARAM lParam)
+{
+ return (INT_PTR)SendMessage((HWND)lParam, UM_DESTROYPOPUP, 0, 0);
+}
+
//////////////////////////////////////////////////////////////////////////////
void InitServices()
@@ -429,10 +434,12 @@ void InitServices()
CreateServiceFunction(MS_POPUP_QUERY, PopupQuery);
CreateServiceFunction(MS_POPUP_SHOWMESSAGE, ShowMessage);
- CreateServiceFunction(MS_POPUP_SHOWMESSAGE"W", ShowMessageW);
+ CreateServiceFunction(MS_POPUP_SHOWMESSAGEW, ShowMessageW);
CreateServiceFunction(MS_POPUP_SHOWHISTORY, Popup_ShowHistory);
CreateServiceFunction("Popup/EnableDisableMenuCommand", TogglePopups);
+
+ CreateServiceFunction(MS_POPUP_DESTROYPOPUP, Popup_DeletePopup);
}
void DeinitServices()