From cbe3cb21f5bca61a03bbd4ae811ee906e09b3f4f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 13 Jun 2015 16:55:17 +0000 Subject: - miranda32.exe now does nothing bug extends PATH to %miranda_root%\libs and loads mir_app.dll; - everything that was in miranda32.exe (including resources) moved to mir_app.dll; - exports from mir_app.dll now available for using directly, without perversions; - src/stdplug.h deleted; git-svn-id: http://svn.miranda-ng.org/main/trunk@14143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/hdr/modern_commonprototypes.h | 2 +- plugins/Clist_modern/src/init.cpp | 3 ++- plugins/Clist_modern/src/modern_clc.cpp | 12 ++++++------ plugins/Clist_modern/src/modern_clistevents.cpp | 2 +- plugins/Clist_modern/src/modern_clui.cpp | 2 +- plugins/Clist_modern/src/modern_skinbutton.cpp | 5 +---- plugins/Clist_modern/src/modern_viewmodebar.cpp | 2 +- 7 files changed, 13 insertions(+), 15 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index 512f145f69..63c5f5ef09 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -56,7 +56,7 @@ extern BYTE g_bCalledFromShowHide; extern HICON g_hListeningToIcon; extern HWND g_hCLUIOptionsWnd; extern BOOL g_bTransparentFlag; -extern HINSTANCE g_hInst; +extern HINSTANCE g_hInst, g_hMirApp; extern BOOL g_mutex_bChangingMode; extern UINT g_dwMainThreadID; extern HANDLE g_hAwayMsgThread, g_hGetTextAsyncThread, g_hSmoothAnimationThread; diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index 870ac56431..a676957105 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CHECKRES(sub) if (sub != S_OK) return S_FALSE; -HINSTANCE g_hInst = 0; +HINSTANCE g_hInst = 0, g_hMirApp = 0; CLIST_INTERFACE *pcli = NULL; CLIST_INTERFACE corecli = { 0 }; CLUIDATA g_CluiData = { 0 }; @@ -80,6 +80,7 @@ extern "C" __declspec(dllexport) int CListInitialise() mir_getTMI(&tmi); g_dwMainThreadID = GetCurrentThreadId(); + g_hMirApp = GetModuleHandleA("mir_app.dll"); CHECKRES(PreLoadContactListModule()); CHECKRES(SubclassClistInterface()); diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index a6cb44c833..2f3a6d4313 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1011,7 +1011,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR break; if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) { if (!contSour->isSubcontact) - hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta + hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA)); } @@ -1024,7 +1024,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR break; if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) { if (!contSour->isSubcontact) - hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta + hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else if (contSour->subcontacts == contDest) hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault else @@ -1039,7 +1039,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR break; if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->proto, META_PROTO)) { if (!contSour->isSubcontact) - hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta + hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta else if (contDest->subcontacts == contSour->subcontacts) break; else @@ -1048,11 +1048,11 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR break; case DROPTARGET_ONGROUP: - hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); + hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); break; case DROPTARGET_INSERTION: - hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROP)); + hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROP)); break; case DROPTARGET_OUTSIDE: @@ -1088,7 +1088,7 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR ClcContact *contSour; cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL); if (!contSour->isSubcontact) - hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); + hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER)); } break; } diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 6460bdab29..d2afb5b63c 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -351,7 +351,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) ske_DrawText(hDC, szName, -1, &rc, DT_VCENTER | DT_SINGLELINE); } else { - HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0); + HICON hIcon = (HICON)LoadImage(g_hMirApp, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0); TCHAR *ptszEvents = TranslateT("No events"); ske_DrawText(hDC, ptszEvents, (int)mir_tstrlen(ptszEvents), &rc, DT_VCENTER | DT_SINGLELINE); ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT); diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index b1ea419cb8..adb904fab5 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -896,7 +896,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) if (!tszFolderPath[0]) { TCHAR szRelativePath[MAX_PATH]; - GetModuleFileName(GetModuleHandle(NULL), szRelativePath, MAX_PATH); + GetModuleFileName(NULL, szRelativePath, MAX_PATH); TCHAR *str = _tcsrchr(szRelativePath, '\\'); if (str != NULL) *str = 0; diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index c2908ede3a..2e2d8ec652 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -488,14 +488,11 @@ HWND SetToolTip(HWND hwnd, TCHAR * tip) if (!tip) return 0; mir_cslock lck(csTips); if (!hwndToolTips) { - // hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL); - hwndToolTips = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - hwnd, NULL, GetModuleHandle(NULL), - NULL); + hwnd, NULL, g_hMirApp, NULL); SetWindowPos(hwndToolTips, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index f776ccf551..cd53b1e77b 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -649,7 +649,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP Skin_ReleaseIcon(hIcon); } - HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SMALLDOT), IMAGE_ICON, 16, 16, 0); + HICON hIcon = (HICON)LoadImage(g_hMirApp, MAKEINTRESOURCE(IDI_SMALLDOT), IMAGE_ICON, 16, 16, 0); nullImage = ImageList_AddIcon(himlViewModes, hIcon); DestroyIcon(hIcon); -- cgit v1.2.3