From 0603b6d7050a237f899d29f5557e3682447dd811 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 2 Oct 2015 19:03:04 +0000 Subject: popup hiding moved in plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@15498 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YAPP/src/popwin.cpp | 2 +- plugins/YAPP/src/services.cpp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'plugins/YAPP/src') 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() -- cgit v1.2.3