From 748efe9bb088ba5226f28e357725b006d280b00f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 16 May 2018 14:01:56 +0300 Subject: clist_blind => CMPlugin --- plugins/Clist_blind/src/clcopts.cpp | 2 +- plugins/Clist_blind/src/clistopts.cpp | 2 +- plugins/Clist_blind/src/cluiopts.cpp | 4 ++-- plugins/Clist_blind/src/init.cpp | 16 +++------------- plugins/Clist_blind/src/stdafx.h | 10 +++++++--- 5 files changed, 14 insertions(+), 20 deletions(-) (limited to 'plugins/Clist_blind/src') diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index bab6a296b1..1cf731ec71 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -255,7 +255,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam int ClcOptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_hInst; + odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("Contact list"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC); odp.szTitle.a = LPGEN("List"); diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index 450ab84e49..48434dad55 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -182,7 +182,7 @@ int CListOptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; odp.position = -1000000000; - odp.hInstance = g_hInst; + odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST); odp.szTitle.a = LPGEN("Contact list"); odp.pfnDlgProc = DlgProcGenOpts; diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index 674da9750a..77be347ef1 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -283,7 +283,7 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L DestroyWindow(pcli->hwndStatus); flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0; flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0; - pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_hInst, nullptr); + pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr); } if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) ShowWindow(pcli->hwndStatus, SW_SHOW); @@ -308,7 +308,7 @@ static UINT expertOnlyControls[] = int CluiOptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_hInst; + odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI); odp.szTitle.a = LPGEN("Window"); odp.szGroup.a = LPGEN("Contact list"); diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 4adbb48c05..811c6abbec 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" +CMPlugin g_plugin; int hLangpack; -HINSTANCE g_hInst = nullptr; CLIST_INTERFACE *pcli = nullptr, coreCli; HIMAGELIST himlCListClc = nullptr; @@ -50,16 +50,6 @@ int ClcOptInit(WPARAM wParam, LPARAM lParam); int CluiOptInit(WPARAM wParam, LPARAM lParam); int CListOptInit(WPARAM wParam, LPARAM lParam); -///////////////////////////////////////////////////////////////////////////////////////// -// dll stub - -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD, LPVOID) -{ - g_hInst = hInstDLL; - DisableThreadLibraryCalls(g_hInst); - return TRUE; -} - ///////////////////////////////////////////////////////////////////////////////////////// // returns the plugin information @@ -134,7 +124,7 @@ extern "C" int __declspec(dllexport) CListInitialise() coreCli = *pcli; - pcli->hInst = g_hInst; + pcli->hInst = g_plugin.getInst(); pcli->pfnPaintClc = PaintClc; pcli->pfnContactListWndProc = ContactListWndProc; pcli->pfnContactListControlWndProc = ContactListControlWndProc; @@ -342,7 +332,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L dat->hwnd_list = CreateWindow(L"LISTBOX", L"", (WS_VISIBLE | WS_CHILD | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY | LBS_WANTKEYBOARDINPUT | WS_VSCROLL), - 0, 0, 0, 0, hwnd, nullptr, g_hInst, nullptr); + 0, 0, 0, 0, hwnd, nullptr, g_plugin.getInst(), nullptr); dat->need_rebuild = FALSE; GetClientRect(hwnd, &r); diff --git a/plugins/Clist_blind/src/stdafx.h b/plugins/Clist_blind/src/stdafx.h index c60d913fc9..e6d70346c9 100644 --- a/plugins/Clist_blind/src/stdafx.h +++ b/plugins/Clist_blind/src/stdafx.h @@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#define __NO_CMPLUGIN_NEEDED - #include #include #include @@ -41,6 +39,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h" #include "version.h" +struct CMPlugin : public PLUGIN +{ + CMPlugin() : + PLUGIN("CList") + {} +}; + struct ClcContact : public ClcContactBase {}; struct ClcData : public ClcDataBase @@ -50,7 +55,6 @@ struct ClcData : public ClcDataBase }; // shared vars -extern HINSTANCE g_hInst; extern CLIST_INTERFACE coreCli; extern int g_bSortByStatus, g_bSortByProto; -- cgit v1.2.3