summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Alarms/src/alarm_win.cpp3
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp3
-rw-r--r--plugins/BuddyPounce/src/main.cpp3
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonprototypes.h1
-rw-r--r--plugins/Clist_modern/src/init.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_tbbutton.cpp7
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp3
-rw-r--r--plugins/ContactsPlus/src/main.cpp8
-rw-r--r--plugins/Db3x_mmap/src/dbevents.cpp2
-rw-r--r--plugins/FavContacts/src/main.cpp11
-rw-r--r--plugins/FileAsMessage/src/main.cpp5
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist.cpp3
-rwxr-xr-xplugins/Msg_Export/src/main.cpp3
-rw-r--r--plugins/NewsAggregator/Src/NewsAggregator.cpp3
-rw-r--r--plugins/Popup/src/main.cpp1
-rw-r--r--plugins/Popup/src/srmm_menu.cpp7
-rw-r--r--plugins/Popup/src/srmm_menu.h1
-rw-r--r--plugins/Quotes/src/ModuleInfo.cpp4
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp3
-rw-r--r--plugins/Scriver/src/globals.cpp7
-rw-r--r--plugins/SeenPlugin/src/history.cpp7
-rw-r--r--plugins/SeenPlugin/src/main.cpp2
-rw-r--r--plugins/SimpleStatusMsg/src/awaymsg.cpp15
-rw-r--r--plugins/TabSRMM/src/msgs.cpp7
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp3
-rw-r--r--plugins/TabSRMM/src/utils.cpp2
-rw-r--r--plugins/UserInfoEx/src/dlg_propsheet.cpp3
-rw-r--r--plugins/Weather/src/weather.cpp7
-rw-r--r--plugins/Weather/src/weather_mwin.cpp97
-rw-r--r--plugins/WebView/src/main.cpp4
-rw-r--r--plugins/WhenWasIt/src/WhenWasIt.cpp3
-rw-r--r--plugins/XSoundNotify/src/xsn_main.cpp3
-rw-r--r--plugins/YAMN/src/main.cpp8
33 files changed, 145 insertions, 95 deletions
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp
index 67f8c38958..8d67041b60 100644
--- a/plugins/Alarms/src/alarm_win.cpp
+++ b/plugins/Alarms/src/alarm_win.cpp
@@ -403,7 +403,7 @@ int AlarmWinModulesLoaded(WPARAM wParam, LPARAM lParam)
void InitAlarmWin()
{
- hAlarmWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hAlarmWindowList = WindowList_Create();
HookEvent(ME_SYSTEM_MODULESLOADED, AlarmWinModulesLoaded);
}
@@ -411,6 +411,7 @@ void InitAlarmWin()
void DeinitAlarmWin()
{
WindowList_Broadcast(hAlarmWindowList, WM_COMMAND, IDC_SNOOZE, 0);
+ WindowList_Destroy(hAlarmWindowList);
if (hBackgroundBrush) DeleteObject(hBackgroundBrush);
if (hTitleFont) DeleteObject(hTitleFont);
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp
index 721c3a89f5..cc6b049e70 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.cpp
+++ b/plugins/AvatarHistory/src/AvatarHistory.cpp
@@ -357,7 +357,7 @@ extern "C" __declspec(dllexport) int Load(void)
SkinAddNewSoundExT("avatar_changed",LPGENT("Avatar History"),LPGENT("Contact changed avatar"));
SkinAddNewSoundExT("avatar_removed",LPGENT("Avatar History"),LPGENT("Contact removed avatar"));
- hAvatarWindowsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hAvatarWindowsList = WindowList_Create();
SetupIcoLib();
InitMenuItem();
@@ -366,5 +366,6 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(hAvatarWindowsList);
return 0;
}
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp
index 83f7965ad4..cbca095e37 100644
--- a/plugins/BuddyPounce/src/main.cpp
+++ b/plugins/BuddyPounce/src/main.cpp
@@ -242,7 +242,7 @@ extern "C" __declspec(dllexport) int Load(void)
HookEvent(ME_OPT_INITIALISE, BuddyPounceOptInit);
HookEvent(ME_PROTO_ACK, MsgAck);
CreateServiceFunction("BuddyPounce/MenuCommand", BuddyPounceMenuCommand);
- hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hWindowList = WindowList_Create();
/* service funcitons for other devs... */
CreateServiceFunction("BuddyPounce/AddSimplePounce", AddSimpleMessage); // add a simple pounce to a contact
@@ -255,5 +255,6 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(hWindowList);
return 0;
}
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
index 5f7b6cbf0e..7d8eb47536 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
@@ -267,6 +267,7 @@ HRESULT PreLoadContactListModule();
HRESULT ClcLoadModule();
HRESULT ToolbarLoadModule();
HRESULT ToolbarButtonLoadModule();
+void ToolbarButtonUnloadModule();
// INTERFACES
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index bf39b955a6..7736c45cf6 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -110,6 +110,7 @@ extern "C" __declspec(dllexport) int Unload(void)
if (IsWindow(pcli->hwndContactList)) DestroyWindow(pcli->hwndContactList);
pcli->hwndContactList = NULL;
+ ToolbarButtonUnloadModule();
BackgroundsUnloadModule();
SkinEngineUnloadModule();
XPThemesUnloadModule();
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp
index 9d55684139..d9f4fd9e47 100644
--- a/plugins/Clist_modern/src/modern_tbbutton.cpp
+++ b/plugins/Clist_modern/src/modern_tbbutton.cpp
@@ -478,8 +478,13 @@ int Buttons_OnSkinModeSettingsChanged(WPARAM wParam, LPARAM lParam)
HRESULT ToolbarButtonLoadModule()
{
- hButtonWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hButtonWindowList = WindowList_Create();
hIconChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
hBkgChangedHook = HookEvent(ME_BACKGROUNDCONFIG_CHANGED,Buttons_OnSkinModeSettingsChanged);
return S_OK;
}
+
+void ToolbarButtonUnloadModule()
+{
+ WindowList_Destroy(hButtonWindowList);
+} \ No newline at end of file
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index ff5e1df8e6..2e3c9a8f39 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -365,7 +365,7 @@ static INT_PTR SetContactIgnore(WPARAM wParam, LPARAM lParam)
HWND hWnd = 0;
if (hWindowListIGN == 0)
- hWindowListIGN = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hWindowListIGN = WindowList_Create();
hWnd = WindowList_Find(hWindowListIGN, (HANDLE)wParam);
if ( wParam ) {
@@ -411,4 +411,5 @@ int InitCustomMenus(void)
void UninitCustomMenus(void)
{
+ WindowList_Destroy(hWindowListIGN);
}
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index 4590e10d12..7b20a0ace1 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -149,9 +149,6 @@ static int HookModulesLoaded(WPARAM wParam, LPARAM lParam)
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, HookPreBuildContactMenu);
- ghSendWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
- ghRecvWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this
-
ProcessUnreadEvents();
return 0;
}
@@ -215,6 +212,9 @@ extern "C" __declspec(dllexport) int Load(void)
InitCommonControls();
+ ghSendWindowList = WindowList_Create();
+ ghRecvWindowList = WindowList_Create();
+
//init hooks
HookEvent(ME_SYSTEM_MODULESLOADED, HookModulesLoaded);
HookEvent(ME_DB_EVENT_ADDED, HookDBEventAdded);
@@ -233,5 +233,7 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(ghSendWindowList);
+ WindowList_Destroy(ghRecvWindowList);
return 0;
}
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp
index d45c37eaa8..d30458249c 100644
--- a/plugins/Db3x_mmap/src/dbevents.cpp
+++ b/plugins/Db3x_mmap/src/dbevents.cpp
@@ -262,7 +262,7 @@ STDMETHODIMP_(BOOL) CDb3Base::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei)
return 1;
memcpy(dbei->pBlob, pBlob, bytesToCopy);
- if (bytesToCopy > len)
+ if (bytesToCopy > (int)len)
memset(dbei->pBlob + len, 0, bytesToCopy - len);
mir_free(pBlob);
}
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index 9339b613ae..5bb306246c 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -74,6 +74,9 @@ TCHAR g_filter[1024] = {0};
Options g_Options = {0};
+static HANDLE hDialogsList = NULL;
+static HANDLE hContactToActivate = NULL;
+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
g_hInst = hinstDLL;
@@ -318,9 +321,12 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(hDialogsList);
+
if (g_hwndMenuHost) DestroyWindow(g_hwndMenuHost);
if (g_Options.hfntName) DeleteObject(g_Options.hfntName);
if (g_Options.hfntSecond) DeleteObject(g_Options.hfntSecond);
+
delete g_contactCache;
return 0;
}
@@ -884,9 +890,6 @@ INT_PTR svcShowMenuCentered(WPARAM wParam, LPARAM lParam)
return 0;
}
-static HANDLE hDialogsList = NULL;
-static HANDLE hContactToActivate = NULL;
-
INT_PTR svcOpenContact(WPARAM wParam, LPARAM lParam)
{
hContactToActivate = (HANDLE)wParam;
@@ -900,7 +903,7 @@ int ProcessSrmmEvent( WPARAM wParam, LPARAM lParam )
if (event->uType == MSG_WINDOW_EVT_OPEN) {
if ( !hDialogsList )
- hDialogsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hDialogsList = WindowList_Create();
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
BYTE fav = db_get_b(event->hContact, "FavContacts", "IsFavourite", 0);
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp
index 7574748758..247072897c 100644
--- a/plugins/FileAsMessage/src/main.cpp
+++ b/plugins/FileAsMessage/src/main.cpp
@@ -196,7 +196,7 @@ extern "C" __declspec(dllexport) int Load(void)
Icon_Register(hInst, "fileAsMessage", iconList, SIZEOF(iconList));
- hFileList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hFileList = WindowList_Create();
CreateServiceFunction(SERVICE_NAME PSR_MESSAGE, OnRecvMessage);
CreateServiceFunction(SERVICE_NAME "/FESendFile", OnSendFile);
@@ -221,8 +221,7 @@ extern "C" __declspec(dllexport) int Load(void)
//
extern "C" __declspec(dllexport) int Unload(void)
{
-// if(hFileList)
-// WindowList_Broadcast(hFileList, WM_CLOSE, 0,0);
+ WindowList_Destroy(hFileList);
if(hHookSkinIconsChanged != NULL)
UnhookEvent(hHookSkinIconsChanged);
UnhookEvent(hHookDbSettingChange);
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp
index 84a9b56bfc..c9f96d3a29 100644
--- a/plugins/HistoryLinkListPlus/src/linklist.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist.cpp
@@ -76,7 +76,7 @@ extern "C" __declspec(dllexport) int Load(void)
mi.pszService = "Linklist/MenuCommand";
Menu_AddContactMenuItem(&mi);
- hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hWindowList = WindowList_Create();
WNDCLASS wndclass = { 0 };
wndclass.style = CS_HREDRAW | CS_VREDRAW;
@@ -103,6 +103,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(hWindowList);
DestroyCursor(splitCursor);
return 0;
}
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp
index 1ecde886e5..898eb2c5c6 100755
--- a/plugins/Msg_Export/src/main.cpp
+++ b/plugins/Msg_Export/src/main.cpp
@@ -220,7 +220,7 @@ extern "C" __declspec(dllexport) int Load()
if ( !hServiceFunñ)
hServiceFunñ = CreateServiceFunction(MS_SHOW_EXPORT_HISTORY, ShowExportHistory);
- hInternalWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hInternalWindowList = WindowList_Create();
return 0;
}
@@ -239,6 +239,7 @@ extern "C" __declspec(dllexport) int Load()
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(hInternalWindowList);
Uninitilize();
bUseInternalViewer(false);
return 0;
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp
index cb6ca96129..e1bd14eba6 100644
--- a/plugins/NewsAggregator/Src/NewsAggregator.cpp
+++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp
@@ -65,7 +65,7 @@ extern "C" __declspec(dllexport) int Load(void)
HookEvent(ME_SYSTEM_PRESHUTDOWN, NewsAggrPreShutdown);
hUpdateMutex = CreateMutex(NULL, FALSE, NULL);
- hChangeFeedDlgList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
+ hChangeFeedDlgList = WindowList_Create();
// register weather protocol
PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
@@ -94,6 +94,7 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(hChangeFeedDlgList);
DestroyUpdateList();
CloseHandle(hUpdateMutex);
return 0;
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 50972b1b36..8523cdf518 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -446,6 +446,7 @@ MIRAPI int Unload(void)
UnloadPopupThread();
UnloadPopupWnd2();
PopupHistoryUnload();
+ SrmmMenu_Unload();
UnregisterClass (MAKEINTATOM(g_wndClass.cPopupWnd2),hInst);
UnregisterClassW(L"PopupEditBox",hInst);
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp
index cf4d75738c..ae757444a3 100644
--- a/plugins/Popup/src/srmm_menu.cpp
+++ b/plugins/Popup/src/srmm_menu.cpp
@@ -54,7 +54,7 @@ static int SrmmMenu_ProcessEvent(WPARAM, LPARAM lParam)
if (mwevent->uType == MSG_WINDOW_EVT_OPEN) {
if (!hDialogsList)
- hDialogsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hDialogsList = WindowList_Create();
WindowList_Add(hDialogsList, mwevent->hwndWindow, mwevent->hContact);
SrmmMenu_UpdateIcon(mwevent->hContact);
@@ -131,3 +131,8 @@ void SrmmMenu_Load()
HookEvent(ME_MSG_ICONPRESSED, SrmmMenu_ProcessIconClick);
HookEvent(ME_MSG_WINDOWEVENT, SrmmMenu_ProcessEvent);
}
+
+void SrmmMenu_Unload()
+{
+ WindowList_Destroy(hDialogsList);
+}
diff --git a/plugins/Popup/src/srmm_menu.h b/plugins/Popup/src/srmm_menu.h
index 67ea73cc12..c64d3b303c 100644
--- a/plugins/Popup/src/srmm_menu.h
+++ b/plugins/Popup/src/srmm_menu.h
@@ -25,5 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define __srmm_menu_h__
void SrmmMenu_Load();
+void SrmmMenu_Unload();
#endif // __srmm_menu_h__
diff --git a/plugins/Quotes/src/ModuleInfo.cpp b/plugins/Quotes/src/ModuleInfo.cpp
index 1d453d2b5c..27850fd8ef 100644
--- a/plugins/Quotes/src/ModuleInfo.cpp
+++ b/plugins/Quotes/src/ModuleInfo.cpp
@@ -32,11 +32,9 @@ HANDLE CModuleInfo::GetWindowList(const std::string& rsKey,bool bAllocateIfNonEx
}
else if(bAllocateIfNonExist)
{
- hResult = reinterpret_cast<HANDLE>(CallService(MS_UTILS_ALLOCWINDOWLIST,0,0));
+ hResult = WindowList_Create();
if(hResult)
- {
m_ahWindowLists.insert(std::make_pair(rsKey,hResult));
- }
}
return hResult;
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index 0f66c5587a..d1d129039f 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -532,7 +532,7 @@ extern "C" __declspec(dllexport) int Load(void)
mir_getLP( &pluginInfo );
CoInitialize(NULL);
- hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hWindowList = WindowList_Create();
Icon_Register(hInst, msLastUC_ShowListName, &icon, 1);
@@ -552,6 +552,7 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
+ WindowList_Destroy(hWindowList);
CoUninitialize();
return 0;
}
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index a090f90916..dcb1ec887f 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -232,8 +232,8 @@ void InitGlobals()
HDC hdc = GetDC(NULL);
ZeroMemory(&g_dat, sizeof(struct GlobalMessageData));
- g_dat.hMessageWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
- g_dat.hParentWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ g_dat.hMessageWindowList = WindowList_Create();
+ g_dat.hParentWindowList = WindowList_Create();
HookEvent(ME_PROTO_ACK, ackevent);
ReloadGlobals();
@@ -273,6 +273,9 @@ void FreeGlobals()
if (g_dat.hMenuANSIEncoding)
DestroyMenu(g_dat.hMenuANSIEncoding);
mir_free(g_dat.tabIconListUsage);
+
+ WindowList_Destroy(g_dat.hMessageWindowList);
+ WindowList_Destroy(g_dat.hParentWindowList);
ZeroMemory(&g_dat, sizeof(g_dat));
}
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp
index b431531830..bb269830a7 100644
--- a/plugins/SeenPlugin/src/history.cpp
+++ b/plugins/SeenPlugin/src/history.cpp
@@ -298,5 +298,10 @@ void ShowHistory(HANDLE hContact, BYTE isAlert)
void InitHistoryDialog(void)
{
- hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
+ hWindowList = WindowList_Create();
}
+
+void UninitHistoryDialog(void)
+{
+ WindowList_Destroy(hWindowList);
+} \ No newline at end of file
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp
index d12a3922a1..0fc5128622 100644
--- a/plugins/SeenPlugin/src/main.cpp
+++ b/plugins/SeenPlugin/src/main.cpp
@@ -50,6 +50,7 @@ BOOL includeIdle;
LIST<logthread_info> arContacts(16, HandleKeySortT);
CRITICAL_SECTION csContacts;
+void UninitHistoryDialog(void);
int MainInit(WPARAM,LPARAM)
{
@@ -113,6 +114,7 @@ extern "C" __declspec(dllexport) int Unload(void)
DeleteCriticalSection(&csContacts);
CloseHandle(g_hShutdownEvent);
+ UninitHistoryDialog();
return 0;
}
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp
index d4efe1478c..991384b69a 100644
--- a/plugins/SimpleStatusMsg/src/awaymsg.cpp
+++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp
@@ -405,16 +405,21 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam)
int AwayMsgPreShutdown(void)
{
- if (hWindowList) WindowList_BroadcastAsync(hWindowList, WM_CLOSE, 0, 0);
- if (hWindowList2) WindowList_BroadcastAsync(hWindowList2, WM_CLOSE, 0, 0);
-
+ if (hWindowList) {
+ WindowList_Broadcast(hWindowList, WM_CLOSE, 0, 0);
+ WindowList_Destroy(hWindowList);
+ }
+ if (hWindowList2) {
+ WindowList_Broadcast(hWindowList2, WM_CLOSE, 0, 0);
+ WindowList_Destroy(hWindowList2);
+ }
return 0;
}
int LoadAwayMsgModule(void)
{
- hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
- hWindowList2 = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hWindowList = WindowList_Create();
+ hWindowList2 = WindowList_Create();
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR;
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index bd7d9f9bf1..d7c069a011 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -417,6 +417,9 @@ static INT_PTR TypingMessageCommand(WPARAM wParam, LPARAM lParam)
int SplitmsgShutdown(void)
{
+ WindowList_Destroy(M.m_hMessageWindowList);
+ WindowList_Destroy(PluginConfig.hUserPrefsWindowList);
+
DestroyCursor(PluginConfig.hCurSplitNS);
DestroyCursor(PluginConfig.hCurHyperlinkHand);
DestroyCursor(PluginConfig.hCurSplitWE);
@@ -563,8 +566,8 @@ int LoadSendRecvMessageModule(void)
Win7Taskbar->updateMetrics();
ZeroMemory(&nen_options, sizeof(nen_options));
- M.m_hMessageWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
- PluginConfig.hUserPrefsWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ M.m_hMessageWindowList = WindowList_Create();
+ PluginConfig.hUserPrefsWindowList = WindowList_Create();
sendQueue = new SendQueue;
Skin = new CSkin;
sendLater = new CSendLater;
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index 8d0793e9ca..a5ee6aa901 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -520,7 +520,7 @@ int TN_OptionsInitialize(WPARAM wParam, LPARAM lParam)
int TN_ModuleInit()
{
- hPopupsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hPopupsList = WindowList_Create();
OnePopup = M.GetByte(Module, SET_ONEPOPUP, DEF_ONEPOPUP);
ShowMenu = M.GetByte(Module, SET_SHOWDISABLEMENU, DEF_SHOWDISABLEMENU);
@@ -567,6 +567,7 @@ int TN_ModuleInit()
int TN_ModuleDeInit()
{
+ WindowList_Destroy(hPopupsList);
db_set_b(0, Module, SET_DISABLED, (BYTE) (Disabled | StartDisabled | StopDisabled));
return 0;
}
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 0a5f314f70..bade430b5a 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -1221,7 +1221,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt)
wchar_t* _s = 0;
if (0 == hWindowList)
- hWindowList = reinterpret_cast<HANDLE>(::CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0));
+ hWindowList = WindowList_Create();
/*
* don't open new warnings when shutdown was initiated (modal ones will otherwise
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp
index b206b7561f..978da21f4f 100644
--- a/plugins/UserInfoEx/src/dlg_propsheet.cpp
+++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp
@@ -619,6 +619,7 @@ void DlgContactInfoInitTreeIcons()
**/
void DlgContactInfoUnLoadModule()
{
+ WindowList_Destroy(ghWindowList);
DestroyHookableEvent(ghDetailsInitEvent);
}
@@ -638,7 +639,7 @@ void DlgContactInfoLoadModule()
HookEvent(ME_DB_CONTACT_DELETED, OnDeleteContact);
HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown);
HookEvent(ME_USERINFO_INITIALISE, InitDetails);
- ghWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ ghWindowList = WindowList_Create();
// check whether changing my details via UserInfoEx is basically possible
{
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp
index e477f1d14e..f93dded751 100644
--- a/plugins/Weather/src/weather.cpp
+++ b/plugins/Weather/src/weather.cpp
@@ -136,8 +136,8 @@ int WeatherInit(WPARAM wParam,LPARAM lParam)
HookEvent(ME_TTB_MODULELOADED, OnToolbarLoaded);
- hDataWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
- hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
+ hDataWindowList = WindowList_Create();
+ hWindowList = WindowList_Create();
return 0;
}
@@ -173,6 +173,9 @@ extern "C" int __declspec(dllexport) Unload(void)
DestroyOptions();
DestroyWIList(); // unload all ini data from memory
+ WindowList_Destroy(hDataWindowList);
+ WindowList_Destroy(hWindowList);
+
CloseHandle(hUpdateMutex);
return 0;
}
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp
index 0d4ba8317a..6ccbfb19f0 100644
--- a/plugins/Weather/src/weather_mwin.cpp
+++ b/plugins/Weather/src/weather_mwin.cpp
@@ -325,56 +325,52 @@ void InitMwin(void)
if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
return;
- hMwinWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
-
- {
- WNDCLASS wndclass;
- wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
- wndclass.lpfnWndProc = wndProc;
- wndclass.cbClsExtra = 0;
- wndclass.cbWndExtra = 0;
- wndclass.hInstance = hInst;
- wndclass.hIcon = NULL;
- wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
- wndclass.hbrBackground = 0; //(HBRUSH)(COLOR_3DFACE+1);
- wndclass.lpszMenuName = NULL;
- wndclass.lpszClassName = _T("WeatherFrame");
- RegisterClass(&wndclass);
- }
-
- {
- ColourIDT colourid = {0};
- colourid.cbSize = sizeof(ColourIDT);
- strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME);
- strcpy(colourid.setting, "ColorMwinFrame");
- _tcscpy(colourid.name, LPGENT("Frame Background"));
- _tcscpy(colourid.group, _T(WEATHERPROTONAME));
- colourid.defcolour = GetSysColor(COLOR_3DFACE);
- ColourRegisterT(&colourid);
-
- FontIDT fontid = {0};
- fontid.cbSize = sizeof(FontIDT);
- fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
- strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME);
- _tcscpy(fontid.group, _T(WEATHERPROTONAME));
- _tcscpy(fontid.name, LPGENT("Frame Font"));
- strcpy(fontid.prefix, "fnt0");
-
- HDC hdc = GetDC(NULL);
- fontid.deffontsettings.size = -13;
- ReleaseDC(0, hdc);
-
- fontid.deffontsettings.charset = DEFAULT_CHARSET;
- _tcscpy(fontid.deffontsettings.szFace, _T("Verdana"));
- _tcscpy(fontid.backgroundGroup, _T(WEATHERPROTONAME));
- _tcscpy(fontid.backgroundName, LPGENT("Frame Background"));
- FontRegisterT(&fontid);
-
- fontid.deffontsettings.style = DBFONTF_BOLD;
- _tcscpy(fontid.name, LPGENT("Frame Title Font"));
- strcpy(fontid.prefix, "fnt1");
- FontRegisterT(&fontid);
- }
+ hMwinWindowList = WindowList_Create();
+
+ WNDCLASS wndclass;
+ wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
+ wndclass.lpfnWndProc = wndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = hInst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
+ wndclass.hbrBackground = 0; //(HBRUSH)(COLOR_3DFACE+1);
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = _T("WeatherFrame");
+ RegisterClass(&wndclass);
+
+ ColourIDT colourid = {0};
+ colourid.cbSize = sizeof(ColourIDT);
+ strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME);
+ strcpy(colourid.setting, "ColorMwinFrame");
+ _tcscpy(colourid.name, LPGENT("Frame Background"));
+ _tcscpy(colourid.group, _T(WEATHERPROTONAME));
+ colourid.defcolour = GetSysColor(COLOR_3DFACE);
+ ColourRegisterT(&colourid);
+
+ FontIDT fontid = {0};
+ fontid.cbSize = sizeof(FontIDT);
+ fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
+ strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME);
+ _tcscpy(fontid.group, _T(WEATHERPROTONAME));
+ _tcscpy(fontid.name, LPGENT("Frame Font"));
+ strcpy(fontid.prefix, "fnt0");
+
+ HDC hdc = GetDC(NULL);
+ fontid.deffontsettings.size = -13;
+ ReleaseDC(0, hdc);
+
+ fontid.deffontsettings.charset = DEFAULT_CHARSET;
+ _tcscpy(fontid.deffontsettings.szFace, _T("Verdana"));
+ _tcscpy(fontid.backgroundGroup, _T(WEATHERPROTONAME));
+ _tcscpy(fontid.backgroundName, LPGENT("Frame Background"));
+ FontRegisterT(&fontid);
+
+ fontid.deffontsettings.style = DBFONTF_BOLD;
+ _tcscpy(fontid.name, LPGENT("Frame Title Font"));
+ strcpy(fontid.prefix, "fnt1");
+ FontRegisterT(&fontid);
for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0))
@@ -391,5 +387,6 @@ void DestroyMwin(void)
CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0);
}
UnregisterClass( _T("WeatherFrame"), hInst);
+ WindowList_Destroy(hMwinWindowList);
UnhookEvent(hFontHook);
}
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp
index bacec0184a..a627aec43b 100644
--- a/plugins/WebView/src/main.cpp
+++ b/plugins/WebView/src/main.cpp
@@ -144,6 +144,7 @@ extern "C" int __declspec(dllexport) Unload(void)
DeleteObject(h_font);
if (hMenu)
DestroyMenu(hMenu);
+ WindowList_Destroy(hWindowList);
return 0;
}
@@ -153,7 +154,6 @@ extern "C" int __declspec(dllexport) Load()
mir_getLP(&pluginInfoEx);
mir_getCLI();
-
HookEvent(ME_CLIST_DOUBLECLICKED, Doubleclick);
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
@@ -313,7 +313,7 @@ extern "C" int __declspec(dllexport) Load()
mi.ptszName = LPGENT("Stop data processing");
Menu_AddContactMenuItem(&mi);
- hWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hWindowList = WindowList_Create();
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, DBSettingChanged);
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp
index 022b5cf589..496becd813 100644
--- a/plugins/WhenWasIt/src/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/src/WhenWasIt.cpp
@@ -67,7 +67,7 @@ extern "C" int __declspec(dllexport) Load(void)
Log("%s", "Hooking events ...");
HookEvents();
- hAddBirthdayWndsList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hAddBirthdayWndsList = WindowList_Create();
Log("%s", "Leaving function " __FUNCTION__);
@@ -85,6 +85,7 @@ extern "C" int __declspec(dllexport) Unload()
SendMessage(hUpcomingDlg, WM_CLOSE, 0, 0);
WindowList_Broadcast(hAddBirthdayWndsList, WM_CLOSE, 0, 0);
+ WindowList_Destroy(hAddBirthdayWndsList);
Log("%s", "Killing timers ...");
KillTimers();
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp
index 71178febd6..6f63acaa3b 100644
--- a/plugins/XSoundNotify/src/xsn_main.cpp
+++ b/plugins/XSoundNotify/src/xsn_main.cpp
@@ -175,7 +175,7 @@ extern "C" int __declspec(dllexport) Load()
CreateServiceFunction("XSoundNotify/ContactMenuCommand", ShowDialog);
- hChangeSoundDlgList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hChangeSoundDlgList = WindowList_Create();
HookEvent(ME_PROTO_ACK, ProtoAck);
HookEvent(ME_OPT_INITIALISE, OptInit);
@@ -189,5 +189,6 @@ extern "C" int __declspec(dllexport) Load()
extern "C" int __declspec(dllexport) Unload(void)
{
+ WindowList_Destroy(hChangeSoundDlgList);
return 0;
}
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index 1f26449162..c26653813b 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -313,8 +313,8 @@ extern "C" int __declspec(dllexport) Load(void)
optDateTime = db_get_b(NULL, YAMN_DBMODULE, YAMN_DBTIMEOPTIONS, optDateTime);
// Create new window queues for broadcast messages
- YAMNVar.MessageWnds = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
- YAMNVar.NewMailAccountWnd = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ YAMNVar.MessageWnds = WindowList_Create();
+ YAMNVar.NewMailAccountWnd = WindowList_Create();
YAMNVar.Shutdown = FALSE;
hCurSplitNS = LoadCursor(NULL, IDC_SIZENS);
@@ -371,6 +371,10 @@ extern "C" int __declspec(dllexport) Unload(void)
#ifdef _DEBUG
UnInitDebug();
#endif
+
+ WindowList_Destroy(YAMNVar.MessageWnds);
+ WindowList_Destroy(YAMNVar.NewMailAccountWnd);
+
DestroyCursor(hCurSplitNS);
DestroyCursor(hCurSplitWE);