From 11e70d8c4e224d80015fffe0378c53abee5fd824 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 17 May 2018 19:41:35 +0300 Subject: Popup, PManagerEx, QuickContacts, RemovePersonalSettings, Restart, SeenPlugin, SendSS, ShlExt, SimpleAR, SimpleStatusMsg, SkypeStatusChange, SmileyAdd, SMS => CMPlugin --- plugins/Popup/src/common.h | 2 +- plugins/Popup/src/config.cpp | 23 ---------------------- plugins/Popup/src/config.h | 7 ------- plugins/Popup/src/history.cpp | 2 +- plugins/Popup/src/icons.cpp | 6 +++--- plugins/Popup/src/main.cpp | 40 +++++++++++++++++++++++--------------- plugins/Popup/src/opt_adv.cpp | 2 +- plugins/Popup/src/opt_gen.cpp | 2 +- plugins/Popup/src/opt_skins.cpp | 8 ++++---- plugins/Popup/src/opttree.cpp | 2 +- plugins/Popup/src/popup_thread.cpp | 8 ++++---- plugins/Popup/src/popup_wnd2.cpp | 18 ++++++++--------- plugins/Popup/src/skin.cpp | 12 ++---------- plugins/Popup/src/skin.h | 1 - plugins/Popup/src/stdafx.h | 20 ++++++++++++------- 15 files changed, 64 insertions(+), 89 deletions(-) (limited to 'plugins/Popup/src') diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index e09dc23f61..64269700b9 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -94,7 +94,7 @@ inline void AddTooltipTranslated(HWND hwndToolTip, HWND hwnd, int id, RECT rc, c ti.uFlags = TTF_SUBCLASS; ti.hwnd = hwnd; ti.uId = id; - ti.hinst = hInst; + ti.hinst = g_plugin.getInst(); ti.lpszText = TranslateW(wtext); ti.rect = rc; SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti); diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index eafca08668..dc5e5dfdae 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" // ===== General Plugin ===== -HINSTANCE hInst; - HANDLE hSemaphore; BOOL closing = FALSE; MTEXT_INTERFACE MText = { 0 }; @@ -38,27 +36,6 @@ HBITMAP hbmNoAvatar; // ===== Options ===== POPUPOPTIONS PopupOptions; -// SKINELEMENT *skin; -// SKINELEMENT *w_skin; -// SKINELEMENT *n_skin; - - -// ===== Plugin information ===== - -PLUGININFOEX pluginInfoEx = -{ - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESCRIPTION, - __AUTHOR, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, - // {26A9125D-7863-4E01-AF0E-D14EF95C5054} - { 0x26a9125d, 0x7863, 0x4e01, { 0xaf, 0xe, 0xd1, 0x4e, 0xf9, 0x5c, 0x50, 0x54 } } -}; - HRESULT(WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind); diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h index ae2d599e42..2819fd52f3 100644 --- a/plugins/Popup/src/config.h +++ b/plugins/Popup/src/config.h @@ -125,7 +125,6 @@ extern GLOBAL_WND_CLASSES g_wndClass; void LoadOptions(); //===== General Plugin ===== -extern HINSTANCE hInst; extern HANDLE hEventNotify; extern HANDLE hSemaphore; extern BOOL closing; @@ -144,12 +143,6 @@ extern HBITMAP hbmNoAvatar; //===== Options ===== extern POPUPOPTIONS PopupOptions; extern bool OptionLoaded; -//extern SKINELEMENT *skin; -//extern SKINELEMENT *w_skin; -//extern SKINELEMENT *n_skin; - -//===== Plugin informations struct ===== -extern PLUGININFOEX pluginInfoEx; //===== Transparency & APIs which are not supported by every OS ===== #ifndef DWLP_MSGRESULT diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp index 5be7176009..5c191b2d7c 100644 --- a/plugins/Popup/src/history.cpp +++ b/plugins/Popup/src/history.cpp @@ -109,7 +109,7 @@ void PopupHistoryShow() SetActiveWindow(hwndHistory); } else { - hwndHistory = CreateDialog(hInst, MAKEINTRESOURCE(IDD_HISTORY), nullptr, HistoryDlgProc); + hwndHistory = CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_HISTORY), nullptr, HistoryDlgProc); SetWindowText(hwndHistory, TranslateT("Popup History")); } } diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp index b1b5a985fc..525d5bbef8 100644 --- a/plugins/Popup/src/icons.cpp +++ b/plugins/Popup/src/icons.cpp @@ -62,9 +62,9 @@ static IconItem iconList[] = void InitIcons() { - Icon_Register(hInst, SECT_POPUP, iconList, 8, MODULNAME); - Icon_Register(hInst, SECT_POPUP SECT_POPUP_OPT, iconList + 8, 9, MODULNAME); - Icon_Register(hInst, SECT_POPUP SECT_POPUP_ACT, iconList + 17, 9, MODULNAME); + Icon_Register(g_plugin.getInst(), SECT_POPUP, iconList, 8, MODULNAME); + Icon_Register(g_plugin.getInst(), SECT_POPUP SECT_POPUP_OPT, iconList + 8, 9, MODULNAME); + Icon_Register(g_plugin.getInst(), SECT_POPUP SECT_POPUP_ACT, iconList + 17, 9, MODULNAME); } HICON LoadIconEx(int iconId, bool big) diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index aaff53315c..d470ee9d8f 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -38,6 +38,7 @@ static int OkToExit(WPARAM, LPARAM); bool OptionLoaded = false; int hLangpack = 0; CLIST_INTERFACE *pcli; +CMPlugin g_plugin; //===== Global variables ================================================================ HMODULE hUserDll = nullptr; @@ -63,7 +64,7 @@ static int OptionsInitialize(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; odp.position = 100000000; - odp.hInstance = hInst; + odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS; odp.szTitle.a = MODULNAME_PLU; @@ -278,18 +279,25 @@ static int ModulesLoaded(WPARAM, LPARAM) return 0; } -//=== DllMain =========================================================================== -// DLL entry point, Required to store the instance handle -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - hInst = hinstDLL; - return TRUE; -} - //===== MirandaPluginInfo =============================================================== // Called by Miranda to get the information associated to this plugin. // It only returns the PLUGININFOEX structure, without any test on the version // @param mirandaVersion - The version of the application calling this function + +PLUGININFOEX pluginInfoEx = +{ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + // {26A9125D-7863-4E01-AF0E-D14EF95C5054} + { 0x26a9125d, 0x7863, 0x4e01, { 0xaf, 0xe, 0xd1, 0x4e, 0xf9, 0x5c, 0x50, 0x54 } } +}; + MIRAPI PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; @@ -349,7 +357,7 @@ MIRAPI int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, OkToExit); HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown); - hbmNoAvatar = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_NOAVATAR)); + hbmNoAvatar = LoadBitmap(g_plugin.getInst(), MAKEINTRESOURCE(IDB_NOAVATAR)); if (!OptionLoaded) LoadOptions(); @@ -425,12 +433,12 @@ MIRAPI int Unload(void) PopupHistoryUnload(); SrmmMenu_Unload(); - UnregisterClass(MAKEINTATOM(g_wndClass.cPopupWnd2), hInst); - UnregisterClass(L"PopupEditBox", hInst); - UnregisterClass(MAKEINTATOM(g_wndClass.cPopupMenuHostWnd), hInst); - UnregisterClass(MAKEINTATOM(g_wndClass.cPopupThreadManagerWnd), hInst); - UnregisterClass(MAKEINTATOM(g_wndClass.cPopupPreviewBoxWndclass), hInst); - UnregisterClass(MAKEINTATOM(g_wndClass.cPopupPlusDlgBox), hInst); + UnregisterClass(MAKEINTATOM(g_wndClass.cPopupWnd2), g_plugin.getInst()); + UnregisterClass(L"PopupEditBox", g_plugin.getInst()); + UnregisterClass(MAKEINTATOM(g_wndClass.cPopupMenuHostWnd), g_plugin.getInst()); + UnregisterClass(MAKEINTATOM(g_wndClass.cPopupThreadManagerWnd), g_plugin.getInst()); + UnregisterClass(MAKEINTATOM(g_wndClass.cPopupPreviewBoxWndclass), g_plugin.getInst()); + UnregisterClass(MAKEINTATOM(g_wndClass.cPopupPlusDlgBox), g_plugin.getInst()); UnloadGDIPlus(); diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index 3ff5656108..ff66767b68 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -97,7 +97,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM CW_USEDEFAULT, // Height HWND_DESKTOP, // Parent nullptr, // menu handle - hInst, // Instance + g_plugin.getInst(), // Instance (LPVOID)nullptr); ShowWindow(hwndBox, SW_HIDE); } diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 3747ff1ada..0b7cdeadca 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -308,7 +308,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_CUSTOMPOS: { RECT rcButton, rcBox; - HWND hwndBox = CreateDialog(hInst, MAKEINTRESOURCE(IDD_POSITION), nullptr, PositionBoxDlgProc); + HWND hwndBox = CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POSITION), nullptr, PositionBoxDlgProc); GetWindowRect((HWND)lParam, &rcButton); GetWindowRect(hwndBox, &rcBox); MoveWindow(hwndBox, diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index dc78a7bab8..5dd0146177 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -37,13 +37,13 @@ void RegisterOptPrevBox() wcl.style = CS_DROPSHADOW; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; - wcl.hInstance = hInst; + wcl.hInstance = g_plugin.getInst(); wcl.hIcon = nullptr; wcl.hCursor = LoadCursor(nullptr, IDC_ARROW); wcl.hbrBackground = nullptr; // (HBRUSH)GetStockObject(LTGRAY_BRUSH); wcl.lpszMenuName = nullptr; wcl.lpszClassName = BOXPREVIEW_WNDCLASS; - wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); + wcl.hIconSm = (HICON)LoadImage(g_plugin.getInst(), MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); g_wndClass.cPopupPreviewBoxWndclass = RegisterClassEx(&wcl); err = GetLastError(); if (!g_wndClass.cPopupPreviewBoxWndclass) { @@ -54,8 +54,8 @@ void RegisterOptPrevBox() // register custom class for dialog box with drop-shadow attribute // "#32770" stays for class name of default system dialog box - GetClassInfoEx(hInst, L"#32770", &wcl); - wcl.hInstance = hInst; + GetClassInfoEx(g_plugin.getInst(), L"#32770", &wcl); + wcl.hInstance = g_plugin.getInst(); wcl.lpszClassName = L"PopupPlusDlgBox"; wcl.style |= CS_DROPSHADOW; g_wndClass.cPopupPlusDlgBox = RegisterClassEx(&wcl); diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp index 68a7a9ef7a..9a6c61fd59 100644 --- a/plugins/Popup/src/opttree.cpp +++ b/plugins/Popup/src/opttree.cpp @@ -161,7 +161,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res TreeView_DeleteAllItems(hwndTree); hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, 1); - ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR | LR_SHARED)); + ImageList_ReplaceIcon(hImgLst, -1, (HICON)LoadImage(g_plugin.getInst(), MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR | LR_SHARED)); ImageList_ReplaceIcon(hImgLst, -1, (HICON)Skin_LoadIcon(SKINICON_OTHER_TICK)); ImageList_ReplaceIcon(hImgLst, -1, (HICON)Skin_LoadIcon(SKINICON_OTHER_NOTICK)); ImageList_ReplaceIcon(hImgLst, -1, (HICON)Skin_LoadIcon(SKINICON_OTHER_TICK)); diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 508bece260..0363613fa0 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -222,13 +222,13 @@ static unsigned __stdcall PopupThread(void *) wcl.style = 0; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; - wcl.hInstance = hInst; + wcl.hInstance = g_plugin.getInst(); wcl.hIcon = nullptr; wcl.hCursor = LoadCursor(nullptr, IDC_ARROW); wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); wcl.lpszMenuName = nullptr; wcl.lpszClassName = L"PopupThreadManagerWnd"; - wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); + wcl.hIconSm = (HICON)LoadImage(g_plugin.getInst(), MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); g_wndClass.cPopupThreadManagerWnd = RegisterClassExW(&wcl); err = GetLastError(); if (!g_wndClass.cPopupThreadManagerWnd) { @@ -237,7 +237,7 @@ static unsigned __stdcall PopupThread(void *) MSGERROR(msg); } - gHwndManager = CreateWindow(L"PopupThreadManagerWnd", nullptr, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, hInst, nullptr); + gHwndManager = CreateWindow(L"PopupThreadManagerWnd", nullptr, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_plugin.getInst(), nullptr); SetWindowPos(gHwndManager, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_HIDEWINDOW); MSG msg; @@ -247,7 +247,7 @@ static unsigned __stdcall PopupThread(void *) } DestroyWindow(gHwndManager); gHwndManager = nullptr; - UnregisterClassW(wcl.lpszClassName, hInst); + UnregisterClassW(wcl.lpszClassName, g_plugin.getInst()); return 0; } diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 63dab2976a..0f56959886 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -51,11 +51,11 @@ bool LoadPopupWnd2() WNDCLASSEX wcl = { 0 }; wcl.cbSize = sizeof(wcl); wcl.lpfnWndProc = PopupWnd2::WindowProc; - wcl.hInstance = hInst; + wcl.hInstance = g_plugin.getInst(); wcl.hCursor = LoadCursor(nullptr, IDC_ARROW); wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); wcl.lpszClassName = POPUP_WNDCLASS; - wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); + wcl.hIconSm = (HICON)LoadImage(g_plugin.getInst(), MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); g_wndClass.cPopupWnd2 = RegisterClassEx(&wcl); DWORD err = GetLastError(); if (!g_wndClass.cPopupWnd2) { @@ -69,7 +69,7 @@ bool LoadPopupWnd2() wclw.cbSize = sizeof(wclw); if (!GetClassInfoEx(nullptr, L"EDIT", &wclw)) MSGERROR(TranslateT("Failed to GetClassInfoExW from EDIT class.")); - wclw.hInstance = hInst; + wclw.hInstance = g_plugin.getInst(); wclw.lpszClassName = L"PopupEditBox"; wclw.style |= CS_DROPSHADOW; g_wndClass.cPopupEditBox = RegisterClassEx(&wclw); @@ -89,13 +89,13 @@ bool LoadPopupWnd2() wcl.style = 0; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; - wcl.hInstance = hInst; + wcl.hInstance = g_plugin.getInst(); wcl.hIcon = nullptr; wcl.hCursor = LoadCursor(nullptr, IDC_ARROW); wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); wcl.lpszMenuName = nullptr; wcl.lpszClassName = L"PopupMenuHostWnd"; - wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); + wcl.hIconSm = (HICON)LoadImage(g_plugin.getInst(), MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); g_wndClass.cPopupMenuHostWnd = RegisterClassEx(&wcl); err = GetLastError(); if (!g_wndClass.cPopupMenuHostWnd) { @@ -105,7 +105,7 @@ bool LoadPopupWnd2() MSGERROR(msg); } - ghwndMenuHost = CreateWindow(L"PopupMenuHostWnd", nullptr, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, hInst, nullptr); + ghwndMenuHost = CreateWindow(L"PopupMenuHostWnd", nullptr, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_plugin.getInst(), nullptr); SetWindowPos(ghwndMenuHost, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_HIDEWINDOW); INITCOMMONCONTROLSEX iccex; @@ -175,7 +175,7 @@ void PopupWnd2::create() CW_USEDEFAULT, // Height HWND_DESKTOP, // Parent nullptr, // menu handle - hInst, // Instance + g_plugin.getInst(), // Instance (LPVOID)this); // Shadows @@ -191,7 +191,7 @@ void PopupWnd2::create() m_hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - m_hwnd, nullptr, hInst, nullptr); + m_hwnd, nullptr, g_plugin.getInst(), nullptr); SetWindowPos(m_hwndToolTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); m_bWindowCreated = true; @@ -921,7 +921,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara g_wndClass.cPopupEditBox ? L"PopupEditBox" : L"EDIT", nullptr, WS_BORDER | WS_POPUP | WS_VISIBLE | ES_AUTOVSCROLL | ES_LEFT | ES_MULTILINE | ES_NOHIDESEL | ES_WANTRETURN, - rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, nullptr, nullptr, hInst, nullptr); + rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, nullptr, nullptr, g_plugin.getInst(), nullptr); ReplyEditData *dat = (ReplyEditData *)mir_alloc(sizeof(ReplyEditData)); dat->oldWndProc = (WNDPROC)GetWindowLongPtr(hwndEditBox, (LONG_PTR)GWLP_WNDPROC); diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index bd912cf115..bef54628c8 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -843,8 +843,6 @@ void PopupSkin::loadSkin(std::wistream &f) if (!mir_wstrcmp(buf, L"popup-version")) { f >> m_popup_version; m_popup_version = PLUGIN_MAKE_VERSION((m_popup_version / 1000000) % 100, (m_popup_version / 10000) % 100, (m_popup_version / 100) % 100, (m_popup_version / 1) % 100); - if (!isCompatible()) - break; } else if (!mir_wstrcmp(buf, L"padding-right")) { f >> m_right_gap; @@ -897,8 +895,8 @@ void PopupSkin::loadSkin(LPCTSTR fn) void PopupSkin::loadSkin(LPCTSTR lpName, LPCTSTR lpType) { - HRSRC hRes = FindResource(hInst, lpName, lpType); - HRSRC hResLoad = (HRSRC)LoadResource(hInst, hRes); + HRSRC hRes = FindResource(g_plugin.getInst(), lpName, lpType); + HRSRC hResLoad = (HRSRC)LoadResource(g_plugin.getInst(), hRes); char *lpResLock = (char *)LockResource(hResLoad); std::wistringstream stream((wchar_t*)_A2T(lpResLock)); loadSkin(stream); @@ -1154,12 +1152,6 @@ const PopupSkin *Skins::getSkin(LPCTSTR name) any->skin = new PopupSkin(any->name); any->skin->load(any->dir); - - if (!any->skin->isCompatible()) - MessageBox(nullptr, - TranslateT("The skin you are trying to load is designed\r\nfor newer version of Popup plus. And will not\r\ndisplay properly.\r\n\r\nPlease choose another skin."), - MODULNAME_LONG, MB_ICONSTOP | MB_OK); - return any->skin; } diff --git a/plugins/Popup/src/skin.h b/plugins/Popup/src/skin.h index 7b410151db..b2c23cf37b 100644 --- a/plugins/Popup/src/skin.h +++ b/plugins/Popup/src/skin.h @@ -140,7 +140,6 @@ public: int useInternalClock() const { return m_internalClock; } int getLegacyRegionOpacity() const { return m_legacy_region_opacity; } int getShadowRegionOpacity() const { return m_shadow_region_opacity; } - bool isCompatible() const { return (DWORD)m_popup_version <= (DWORD)pluginInfoEx.version; } const LPTSTR getName() const { return m_name; } diff --git a/plugins/Popup/src/stdafx.h b/plugins/Popup/src/stdafx.h index 0902fa6e77..ea91428de0 100644 --- a/plugins/Popup/src/stdafx.h +++ b/plugins/Popup/src/stdafx.h @@ -60,7 +60,6 @@ https://miranda-ng.org/distr/ #include #include -#define __NO_CMPLUGIN_NEEDED #include #include #include @@ -97,6 +96,19 @@ https://miranda-ng.org/distr/ #include #include +#define PU_MODULCLASS "PopupCLASS" // temp DB modul for this plugin +#define MODULNAME "Popup" +#define MODULNAME_LONG L"Popup Plus" +#define MODULNAME_PLU "Popups" +#define MODULNAME_PLUW L"Popups" + +struct CMPlugin : public PLUGIN +{ + CMPlugin() : + PLUGIN(MODULNAME) + {} +}; + #include "resource.h" #include "defs.h" #include "version.h" @@ -128,12 +140,6 @@ https://miranda-ng.org/distr/ #include "avatars_gif.h" #include "popup_gdiplus.h" -#define PU_MODULCLASS "PopupCLASS" // temp DB modul for this plugin -#define MODULNAME "Popup" -#define MODULNAME_LONG L"Popup Plus" -#define MODULNAME_PLU "Popups" -#define MODULNAME_PLUW L"Popups" - INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM); #endif //HEADERS_H -- cgit v1.2.3