diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-01-25 20:07:10 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-01-25 20:07:10 +0000 |
commit | 7325c10a7921fb043253a339ab5b5c3c803bfb14 (patch) | |
tree | aee9caf5c14c7b8c36540cba14642a453c61919f /plugins/Scriver/src/msgs.cpp | |
parent | 58ac4567a402d383c3edb0749b9f2fb88b8422d6 (diff) |
- Unload Msftedit.dll after use
git-svn-id: http://svn.miranda-ng.org/main/trunk@11907 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/msgs.cpp')
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index e4a6022401..1bd21e47dd 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HCURSOR hCurSplitNS, hCurSplitWE, hCurHyperlinkHand, hDragCursor;
HANDLE hHookWinEvt, hHookWinPopup, hHookWinWrite;
HGENMENU hMsgMenuItem;
+HMODULE hMsftEdit;
extern HWND GetParentWindow(MCONTACT hContact, BOOL bChat);
@@ -207,7 +208,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) else if (lParam && (g_dat.flags2 & SMF2_SHOWTYPINGTRAY)) {
TCHAR szTip[256];
- mir_sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message"), (TCHAR*) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
+ mir_sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
if ( ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags2 & SMF2_SHOWTYPINGCLIST)) {
MIRANDASYSTRAYNOTIFY tn;
tn.szProto = NULL;
@@ -244,8 +245,8 @@ static int MessageSettingChanged(WPARAM hContact, LPARAM lParam) static int ContactDeleted(WPARAM wParam, LPARAM)
{
- HWND hwnd;
- if ((hwnd = WindowList_Find(g_dat.hMessageWindowList, wParam)))
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, wParam);
+ if (hwnd)
SendMessage(hwnd, WM_CLOSE, 0, 0);
return 0;
}
@@ -305,12 +306,12 @@ static INT_PTR GetWindowClass(WPARAM wParam, LPARAM lParam) static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
{
MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- MessageWindowData *mwd = (MessageWindowData*)lParam;
+ if (mwid == NULL || mwid->cbSize != sizeof(MessageWindowInputData) || mwid->hContact == NULL || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
+ return 1;
- if (mwid == NULL || mwd == NULL) return 1;
- if (mwid->cbSize != sizeof(MessageWindowInputData) || mwd->cbSize != sizeof(MessageWindowData)) return 1;
- if (mwid->hContact == NULL) return 1;
- if (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH) return 1;
+ MessageWindowData *mwd = (MessageWindowData*)lParam;
+ if (mwd == NULL || mwd->cbSize != sizeof(MessageWindowData))
+ return 1;
HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, mwid->hContact);
if (hwnd == NULL)
@@ -514,12 +515,14 @@ int OnUnloadModule(void) FreeLibrary(GetModuleHandleA("Msftedit.dll"));
RichUtil_Unload();
FreeGlobals();
+ FreeLibrary(hMsftEdit);
return 0;
}
int OnLoadModule(void)
{
- if (LoadLibraryA("Msftedit.dll") == NULL) {
+ hMsftEdit = LoadLibrary(_T("Msftedit.dll"));
+ if (hMsftEdit == NULL) {
if (IDYES != MessageBox(0,
TranslateT
("Miranda could not load the built-in message module, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."),
|