summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin10/lib/mir_core.libbin385426 -> 387088 bytes
-rw-r--r--bin10/lib/mir_core64.libbin388540 -> 390056 bytes
-rw-r--r--bin12/lib/mir_core.libbin385426 -> 387088 bytes
-rw-r--r--bin12/lib/mir_core64.libbin388540 -> 390056 bytes
-rw-r--r--include/delphi/m_helpers.inc36
-rw-r--r--include/delphi/m_utils.inc48
-rw-r--r--include/m_protoint.h19
-rw-r--r--include/m_utils.h73
-rw-r--r--plugins/Alarms/src/alarm_win.cpp2
-rw-r--r--plugins/Alarms/src/alarm_win.h2
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp2
-rw-r--r--plugins/AvatarHistory/src/stdafx.h2
-rw-r--r--plugins/BuddyPounce/src/main.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_tbbutton.cpp2
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp2
-rw-r--r--plugins/ContactsPlus/src/main.cpp24
-rw-r--r--plugins/ContactsPlus/src/receive.cpp4
-rw-r--r--plugins/ContactsPlus/src/receive.h2
-rw-r--r--plugins/ContactsPlus/src/send.cpp16
-rw-r--r--plugins/ContactsPlus/src/send.h4
-rw-r--r--plugins/ExternalAPI/m_yamn.h4
-rw-r--r--plugins/FavContacts/src/services.cpp2
-rw-r--r--plugins/FileAsMessage/src/main.cpp2
-rw-r--r--plugins/FileAsMessage/src/main.h2
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist.cpp3
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_dlg.cpp2
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_fct.cpp2
-rw-r--r--plugins/IEHistory/src/IEHistory.cpp4
-rw-r--r--plugins/IEHistory/src/stdafx.h2
-rwxr-xr-xplugins/Msg_Export/src/Glob.h2
-rwxr-xr-xplugins/Msg_Export/src/main.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/Common.h2
-rw-r--r--plugins/NewAwaySysMod/src/ContactList.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/MsgTree.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/ReadAwayMsg.cpp2
-rw-r--r--plugins/NewsAggregator/Src/Common.h3
-rw-r--r--plugins/NewsAggregator/Src/NewsAggregator.cpp2
-rw-r--r--plugins/Popup/src/srmm_menu.cpp2
-rw-r--r--plugins/Quotes/src/CurrencyConverter.cpp6
-rw-r--r--plugins/Quotes/src/ModuleInfo.cpp4
-rw-r--r--plugins/Quotes/src/ModuleInfo.h4
-rw-r--r--plugins/Quotes/src/QuoteInfoDlg.cpp6
-rw-r--r--plugins/Quotes/src/SettingsDlg.cpp6
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp2
-rw-r--r--plugins/Scriver/src/globals.h4
-rw-r--r--plugins/SeenPlugin/src/history.cpp2
-rw-r--r--plugins/SeenPlugin/src/main.cpp3
-rw-r--r--plugins/SeenPlugin/src/seen.h2
-rw-r--r--plugins/SimpleStatusMsg/src/awaymsg.cpp3
-rw-r--r--plugins/TabSRMM/src/globals.h2
-rw-r--r--plugins/TabSRMM/src/mim.h2
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp2
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp1
-rw-r--r--plugins/TabSRMM/src/utils.cpp2
-rw-r--r--plugins/TabSRMM/src/utils.h2
-rw-r--r--plugins/TrafficCounter/src/TrafficCounter.cpp2
-rw-r--r--plugins/TrafficCounter/src/misc.cpp2
-rw-r--r--plugins/UserInfoEx/src/dlg_propsheet.cpp30
-rw-r--r--plugins/Weather/src/weather.cpp3
-rw-r--r--plugins/Weather/src/weather.h7
-rw-r--r--plugins/Weather/src/weather_icons.cpp2
-rw-r--r--plugins/Weather/src/weather_mwin.cpp2
-rw-r--r--plugins/WebView/src/main.cpp2
-rw-r--r--plugins/WebView/src/webview.h3
-rw-r--r--plugins/WhenWasIt/src/WhenWasIt.cpp2
-rw-r--r--plugins/WhenWasIt/src/commonheaders.h2
-rw-r--r--plugins/XSoundNotify/src/Common.h2
-rw-r--r--plugins/XSoundNotify/src/xsn_main.cpp2
-rw-r--r--plugins/YAMN/src/main.cpp2
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp2
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp2
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp12
-rw-r--r--protocols/Steam/src/steam_xstatus.cpp2
-rw-r--r--protocols/Tox/src/tox_multimedia.cpp4
-rw-r--r--protocols/Tox/src/tox_proto.h2
-rw-r--r--src/core/stdaway/src/awaymsg.cpp2
-rw-r--r--src/core/stdmsg/src/globals.h2
-rw-r--r--src/core/stduihist/src/history.cpp2
-rw-r--r--src/core/stdurl/commonheaders.h1
-rw-r--r--src/core/stdurl/url.cpp2
-rw-r--r--src/core/stdurl/urldialogs.cpp2
-rw-r--r--src/core/stduserinfo/src/userinfo.cpp2
-rw-r--r--src/mir_app/src/clc.cpp2
-rw-r--r--src/mir_app/src/utils.cpp2
-rw-r--r--src/mir_app/src/windowlist.cpp111
-rw-r--r--src/mir_core/mir_core_10.vcxproj1
-rw-r--r--src/mir_core/mir_core_10.vcxproj.filters3
-rw-r--r--src/mir_core/mir_core_12.vcxproj1
-rw-r--r--src/mir_core/mir_core_12.vcxproj.filters3
-rw-r--r--src/mir_core/src/mir_core.def7
-rw-r--r--src/mir_core/src/mir_core64.def7
-rw-r--r--src/mir_core/src/windowlist.cpp104
92 files changed, 308 insertions, 370 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib
index 6b2d344649..967ae38a62 100644
--- a/bin10/lib/mir_core.lib
+++ b/bin10/lib/mir_core.lib
Binary files differ
diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib
index ac62d6a362..d29283f64b 100644
--- a/bin10/lib/mir_core64.lib
+++ b/bin10/lib/mir_core64.lib
Binary files differ
diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib
index 6b2d344649..967ae38a62 100644
--- a/bin12/lib/mir_core.lib
+++ b/bin12/lib/mir_core.lib
Binary files differ
diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib
index ac62d6a362..d29283f64b 100644
--- a/bin12/lib/mir_core64.lib
+++ b/bin12/lib/mir_core64.lib
Binary files differ
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc
index 550a766780..9fbd21c671 100644
--- a/include/delphi/m_helpers.inc
+++ b/include/delphi/m_helpers.inc
@@ -28,10 +28,6 @@ function Netlib_Send(hConn: THANDLE; const buf: PAnsiChar; len: int; flags: int)
function Netlib_Recv(hConn: THANDLE; const buf: PAnsiChar; len: int; flags: int): int_ptr;
procedure Netlib_Log(hNetLib: THANDLE; const sz: PAnsiChar);
-function WindowList_Add (hList:THANDLE; hWnd:HWND; hContact:TMCONTACT): int_ptr;
-function WindowList_Remove (hList:THANDLE; hWnd:HWND): int_ptr;
-function WindowList_Find (hList:THANDLE; hContact:TMCONTACT): int_ptr;
-function WindowList_Broadcast(hList:THANDLE; message: int; wParam: WPARAM; lParam: LPARAM): int_ptr;
function Utils_SaveWindowPosition (hWnd:HWND; hContact:TMCONTACT; const szModule, szNamePrefix: PAnsiChar): int_ptr;
function Utils_RestoreWindowPosition(hWnd:HWND; hContact:TMCONTACT; Flags: int; const szModule, szNamePrefix: PAnsiChar): int_ptr;
@@ -252,38 +248,6 @@ begin
end;
-function WindowList_Add(hList: THANDLE; hWnd: HWND; hContact: TMCONTACT): int_ptr;
-var
- wle: TWINDOWLISTENTRY;
-begin
- wle.hList := hList;
- wle.hWnd := hWnd;
- wle.hContact := hContact;
- Result := CallService(MS_UTILS_ADDTOWINDOWLIST, 0, lParam(@wle));
-end;
-
-function WindowList_Remove(hList: THANDLE; hWnd: HWND): int_ptr;
- {$IFDEF AllowInline}inline;{$ENDIF}
-begin
- Result := CallService(MS_UTILS_REMOVEFROMWINDOWLIST, hList, hWnd);
-end;
-
-function WindowList_Find(hList: THANDLE; hContact: TMCONTACT): int_ptr;
- {$IFDEF AllowInline}inline;{$ENDIF}
-begin
- Result := CallService(MS_UTILS_FINDWINDOWINLIST, hList, hContact);
-end;
-
-function WindowList_Broadcast(hList: THANDLE; message: int; wParam: WPARAM; lParam: LPARAM): int_ptr;
-var
- msg: TMSG;
-begin
- msg.message := message;
- msg.wParam := wParam;
- msg.lParam := lParam;
- Result := CallService(MS_UTILS_BROADCASTTOWINDOWLIST, hList, tLparam(@Msg));
-end;
-
function Utils_SaveWindowPosition(hWnd:HWND; hContact:TMCONTACT; const szModule, szNamePrefix: PAnsiChar): int_ptr;
var
swp: TSAVEWINDOWPOS;
diff --git a/include/delphi/m_utils.inc b/include/delphi/m_utils.inc
index 8308d0f815..d241a91aa3 100644
--- a/include/delphi/m_utils.inc
+++ b/include/delphi/m_utils.inc
@@ -159,59 +159,59 @@ const
}
MS_UTILS_GETCOUNTRYLIST:PAnsiChar = 'Utils/GetCountryList';
-
//******************************* Window lists *******************************
{
- wParam : 0
- lParam : 0
Affect : Allocate a window list
Returns: A handle to the new window list
}
- MS_UTILS_ALLOCWINDOWLIST:PAnsiChar = 'Utils/AllocWindowList';
+
+function WindowList_Create() : Thandle; stdcall;
+ external CoreDLL name 'WindowList_Create';
+
+procedure WindowList_Destroy(hList:Thandle); stdcall;
+ external CoreDLL name 'WindowList_Destroy';
{
- wParam : 0
- lParam : Pointer to an initalised TWINDOWLISTENTRY structure
Affect : Add a window to a given window list handle
Returns: 0 on success, [non zero] on failure
}
- MS_UTILS_ADDTOWINDOWLIST:PAnsiChar = 'Utils/AddToWindowList';
+
+function WindowList_Add(hList:Thandle; hwnd:HWND; hContact:TMCONTACT) : int; stdcall;
+ external CoreDLL name 'WindowList_Add';
{
- wParam : Handle to window list to remove from
- lParam : Window handle to remove
Affect : Remove a window from the specified window list
Returns: 0 on success, [non zero] on failure
}
- MS_UTILS_REMOVEFROMWINDOWLIST:PAnsiChar = 'Utils/RemoveFromWindowList';
+
+function WindowList_Remove(hList:Thandle; hwnd:HWND) : int; stdcall;
+ external CoreDLL name 'WindowList_Remove';
{
- wParam : Handle to the window list to look in
- lParam : Handle to a TMCONTACT to find in the window list
Affect : Find a window handle given the hContact
Returns: The found window handle or NULL(0) on failure
}
- MS_UTILS_FINDWINDOWINLIST:PAnsiChar = 'Utils/FindWindowInList';
+
+function WindowList_Find(hList:Thandle; hContact:TMCONTACT) : HWND; stdcall;
+ external CoreDLL name 'WindowList_Find';
{
- wParam : Handle to window list
- lParam : Pointer to TMSG (initalised with what to broadcast)
Affect : sends a message to all windows in a list using SendMessage
Returns: 0 on success, [non zero] on failure
- Notes : only TMSG.Message, .wParam, .lParam are used
}
- MS_UTILS_BROADCASTTOWINDOWLIST:PAnsiChar = 'Utils/BroadcastToWindowList';
+
+function WindowList_Broadcast(hList:Thandle; message:UINT; wParam:TWPARAM; lParam:TLPARAM) : int; stdcall;
+ external CoreDLL name 'WindowList_Broadcast';
{
- Inline helper: WindowList_BroadcastAsync
- wParam : Handle to window list
- lParam : Pointer to TMSG (initalised with what to broadcast)
- Affect : Sends a message to all windows in a list using PostMessage
- Returns: 0 on success, nonzero on failure, this service does not fail,
+ Affect : Sends a message to all windows in a list using PostMessage
+ Returns: 0 on success, nonzero on failure, this service does not fail,
even if PostMessage() fails for whatever reason
}
- MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC:PAnsiChar = 'Utils/BroadcastToWindowListAsync';
+
+function WindowList_BroadcastAsync(hList:Thandle; message:UINT; wParam:TWPARAM; lParam:TLPARAM) : int; stdcall;
+ external CoreDLL name 'WindowList_BroadcastAsync';
{
There aren't any services here, there's no need for them, the control class
@@ -221,6 +221,8 @@ const
These are defined by STATIC controls and STN_CLICKED is sent to standard
STATIC classes when they're clicked -- look at WINAPI docs for more info
}
+
+const
WNDCLASS_HYPERLINK = 'Hyperlink';
{
diff --git a/include/m_protoint.h b/include/m_protoint.h
index fd95329252..1e75d08e15 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_system_cpp.h>
#include <m_protomod.h>
#include <m_database.h>
+#include <m_utils.h>
typedef enum
{
@@ -45,15 +46,15 @@ typedef enum
struct MIR_CORE_EXPORT PROTO_INTERFACE : public MZeroedObject
{
- int m_iStatus, // current protocol status
- m_iDesiredStatus, // status to be set after logging in
- m_iXStatus, // extanded status
- m_iVersion; // version 2 or higher designate support of Unicode services
- TCHAR* m_tszUserName; // human readable protocol's name
- char* m_szModuleName; // internal protocol name, also its database module name
- HANDLE m_hProtoIcon; // icon to be displayed in the account manager
- HANDLE m_hNetlibUser; // network agent
- HANDLE m_hWindowList; // list of all windows which belong to this protocol's instance
+ int m_iStatus, // current protocol status
+ m_iDesiredStatus, // status to be set after logging in
+ m_iXStatus, // extanded status
+ m_iVersion; // version 2 or higher designate support of Unicode services
+ TCHAR* m_tszUserName; // human readable protocol's name
+ char* m_szModuleName; // internal protocol name, also its database module name
+ HANDLE m_hProtoIcon; // icon to be displayed in the account manager
+ HANDLE m_hNetlibUser; // network agent
+ MWindowList m_hWindowList; // list of all windows which belong to this protocol's instance
//////////////////////////////////////////////////////////////////////////////////////
// Helpers
diff --git a/include/m_utils.h b/include/m_utils.h
index 3f716cc069..4e779871a5 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -138,96 +138,55 @@ struct CountryListEntry {
};
#define MS_UTILS_GETCOUNTRYLIST "Utils/GetCountryList"
-/******************************* Window lists *******************************/
+/////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////// Window lists //////////////////////////////////////
+
+#if defined(MIR_CORE_EXPORTS)
+typedef struct TWindowList *MWindowList;
+#else
+DECLARE_HANDLE(MWindowList);
+#endif
/////////////////////////////////////////////////////////////////////////////////////////
// allocates a window list
-// wParam = lParam = 0 (unused)
// returns a handle to the new window list
-#define MS_UTILS_ALLOCWINDOWLIST "Utils/AllocWindowList"
-__forceinline HANDLE WindowList_Create(void)
-{ return (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
-}
+EXTERN_C MIR_CORE_DLL(MWindowList) WindowList_Create(void);
/////////////////////////////////////////////////////////////////////////////////////////
// destroys a window list
-// wParam = (HANDLE) window list handle
-// lParam = 0 (unused)
-// returns a handle to the new window list
-#define MS_UTILS_DESTROYWINDOWLIST "Utils/DestroyWindowList"
-__forceinline HANDLE WindowList_Destroy(HANDLE hList)
-{ return (HANDLE)CallService(MS_UTILS_DESTROYWINDOWLIST, (WPARAM)hList, 0);
-}
+
+EXTERN_C MIR_CORE_DLL(void) WindowList_Destroy(MWindowList hList);
/////////////////////////////////////////////////////////////////////////////////////////
// adds a window to the specified window list
-// wParam = 0
-// lParam = (LPARAM)(WINDOWLISTENTRY*)&wle
// returns 0 on success, nonzero on failure
-typedef struct {
- HANDLE hList;
- HWND hwnd;
- MCONTACT hContact;
-} WINDOWLISTENTRY;
-#define MS_UTILS_ADDTOWINDOWLIST "Utils/AddToWindowList"
-__forceinline INT_PTR WindowList_Add(HANDLE hList, HWND hwnd, MCONTACT hContact) {
- WINDOWLISTENTRY wle;
- wle.hList = hList; wle.hwnd = hwnd; wle.hContact = hContact;
- return CallService(MS_UTILS_ADDTOWINDOWLIST, 0, (LPARAM)&wle);
-}
+EXTERN_C MIR_CORE_DLL(int) WindowList_Add(MWindowList hList, HWND hwnd, MCONTACT hContact);
/////////////////////////////////////////////////////////////////////////////////////////
// removes a window from the specified window list
-// wParam = (WPARAM)(HANDLE)hList
-// lParam = (LPARAM)(HWND)hwnd
// returns 0 on success, nonzero on failure
-#define MS_UTILS_REMOVEFROMWINDOWLIST "Utils/RemoveFromWindowList"
-__forceinline INT_PTR WindowList_Remove(HANDLE hList, HWND hwnd) {
- return CallService(MS_UTILS_REMOVEFROMWINDOWLIST, (WPARAM)hList, (LPARAM)hwnd);
-}
+EXTERN_C MIR_CORE_DLL(int) WindowList_Remove(MWindowList hList, HWND hwnd);
/////////////////////////////////////////////////////////////////////////////////////////
// finds a window given the hContact
-// wParam = (WPARAM)(HANDLE)hList
-// lParam = (MCONTACT)hContact
// returns the window handle on success, or NULL on failure
-#define MS_UTILS_FINDWINDOWINLIST "Utils/FindWindowInList"
-__forceinline HWND WindowList_Find(HANDLE hList, MCONTACT hContact) {
- return (HWND)CallService(MS_UTILS_FINDWINDOWINLIST, (WPARAM)hList, hContact);
-}
+EXTERN_C MIR_CORE_DLL(HWND) WindowList_Find(MWindowList hList, MCONTACT hContact);
/////////////////////////////////////////////////////////////////////////////////////////
// sends a message to all windows in a list using SendMessage
-// wParam = (WPARAM)(HANDLE)hList
-// lParam = (LPARAM)(MSG*)&msg
// returns 0 on success, nonzero on failure
-// Only msg.message, msg.wParam and msg.lParam are used
-#define MS_UTILS_BROADCASTTOWINDOWLIST "Utils/BroadcastToWindowList"
-__forceinline INT_PTR WindowList_Broadcast(HANDLE hList, UINT message, WPARAM wParam, LPARAM lParam) {
- MSG msg;
- msg.message = message; msg.wParam = wParam; msg.lParam = lParam;
- return CallService(MS_UTILS_BROADCASTTOWINDOWLIST, (WPARAM)hList, (LPARAM)&msg);
-}
+EXTERN_C MIR_CORE_DLL(int) WindowList_Broadcast(MWindowList hList, UINT message, WPARAM wParam, LPARAM lParam);
/////////////////////////////////////////////////////////////////////////////////////////
// sends a message to all windows in a list using PostMessage
-// wParam = (WPARAM)(HANDLE)hList
-// lParam = (LPARAM)(MSG*)&msg
// returns 0 on success, nonzero on failure
-// Only msg.message, msg.wParam and msg.lParam are used
-#define MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC "Utils/BroadcastToWindowListAsync"
-
-__forceinline INT_PTR WindowList_BroadcastAsync(HANDLE hList, UINT message, WPARAM wParam, LPARAM lParam) {
- MSG msg;
- msg.message = message; msg.wParam = wParam; msg.lParam = lParam;
- return CallService(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC, (WPARAM)hList, (LPARAM)&msg);
-}
+EXTERN_C MIR_CORE_DLL(int) WindowList_BroadcastAsync(MWindowList hList, UINT message, WPARAM wParam, LPARAM lParam);
/***************************** Hyperlink windows ********************************/
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp
index 0eadf15e1d..1dc974e01f 100644
--- a/plugins/Alarms/src/alarm_win.cpp
+++ b/plugins/Alarms/src/alarm_win.cpp
@@ -4,7 +4,7 @@
#define ID_TIMER_SOUND 10101
#define SOUND_REPEAT_PERIOD 5000 // milliseconds
#define SPEACH_REPEAT_PERIOD 15000 // milliseconds
-HANDLE hAlarmWindowList = 0;
+MWindowList hAlarmWindowList = 0;
FontIDT title_font_id, window_font_id;
ColourIDT bk_colour_id;
diff --git a/plugins/Alarms/src/alarm_win.h b/plugins/Alarms/src/alarm_win.h
index 5a73de86dd..7bea4402f5 100644
--- a/plugins/Alarms/src/alarm_win.h
+++ b/plugins/Alarms/src/alarm_win.h
@@ -11,7 +11,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
#define WMU_SETOPT (WM_USER + 60)
-extern HANDLE hAlarmWindowList;
+extern MWindowList hAlarmWindowList;
void SetAlarmWinOptions();
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp
index a1701f74ec..ff105f96d1 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.cpp
+++ b/plugins/AvatarHistory/src/AvatarHistory.cpp
@@ -32,7 +32,7 @@ HANDLE hFolder = NULL;
TCHAR profilePath[MAX_PATH]; // database profile path (read at startup only)
TCHAR basedir[MAX_PATH];
int hLangpack = 0;
-HANDLE hAvatarWindowsList = NULL;
+MWindowList hAvatarWindowsList = NULL;
int OptInit(WPARAM wParam,LPARAM lParam);
diff --git a/plugins/AvatarHistory/src/stdafx.h b/plugins/AvatarHistory/src/stdafx.h
index 2c294ccda7..4bf6f2395f 100644
--- a/plugins/AvatarHistory/src/stdafx.h
+++ b/plugins/AvatarHistory/src/stdafx.h
@@ -33,7 +33,7 @@
extern HINSTANCE hInst;
extern HGENMENU hMenu;
extern DWORD mirVer;
-extern HANDLE hAvatarWindowsList;
+extern MWindowList hAvatarWindowsList;
extern Options opts;
extern HANDLE hFolder;
extern TCHAR basedir[];
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp
index 837167f42b..4243dd9f06 100644
--- a/plugins/BuddyPounce/src/main.cpp
+++ b/plugins/BuddyPounce/src/main.cpp
@@ -2,7 +2,7 @@
int hLangpack;
HINSTANCE hInst;
-HANDLE hWindowList;
+MWindowList hWindowList;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp
index d78ab4ba15..34418e3818 100644
--- a/plugins/Clist_modern/src/modern_tbbutton.cpp
+++ b/plugins/Clist_modern/src/modern_tbbutton.cpp
@@ -34,7 +34,7 @@ static mir_cs csTips;
static HWND hwndToolTips = NULL;
static BOOL bThemed = FALSE;
-static HANDLE hButtonWindowList = NULL;
+static MWindowList hButtonWindowList = NULL;
static int OnIconLibIconChanged(WPARAM, LPARAM)
{
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index 20ce9de27a..89d359b656 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -61,7 +61,7 @@ INT_PTR CloseAction(WPARAM, LPARAM)
return 0;
}
-static HANDLE hWindowListIGN = 0;
+static MWindowList hWindowListIGN = 0;
// dialog procedure for handling the contact ignore dialog (available from the contact menu
static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index 77a50dc048..12d7923f76 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -31,9 +31,9 @@ int hLangpack;
int g_Utf8EventsSupported = TRUE;
-HANDLE ghSendWindowList;
-HANDLE ghRecvWindowList;
-gAckList gaAckData;
+MWindowList g_hSendWindowList;
+MWindowList g_hRecvWindowList;
+gAckList g_aAckData;
HGENMENU hContactMenuItem;
@@ -155,20 +155,20 @@ static int HookContactSettingChanged(WPARAM hContact, LPARAM lParam)
if (strcmpnull(cws->szModule, "CList") && strcmpnull(cws->szModule, szProto))
return 0;
- WindowList_Broadcast(ghSendWindowList, DM_UPDATETITLE, 0, 0);
- WindowList_Broadcast(ghRecvWindowList, DM_UPDATETITLE, 0, 0);
+ WindowList_Broadcast(g_hSendWindowList, DM_UPDATETITLE, 0, 0);
+ WindowList_Broadcast(g_hRecvWindowList, DM_UPDATETITLE, 0, 0);
return 0;
}
static int HookContactDeleted(WPARAM wParam, LPARAM)
{ // if our contact gets deleted close his window
- HWND h = WindowList_Find(ghSendWindowList, wParam);
+ HWND h = WindowList_Find(g_hSendWindowList, wParam);
if (h)
SendMessage(h, WM_CLOSE, 0, 0);
// since we hack the window list - more windows for one contact, we need to close them all
- while (h = WindowList_Find(ghRecvWindowList, wParam))
+ while (h = WindowList_Find(g_hRecvWindowList, wParam))
SendMessage(h, WM_CLOSE, 0, 0);
return 0;
}
@@ -176,7 +176,7 @@ static int HookContactDeleted(WPARAM wParam, LPARAM)
static INT_PTR ServiceSendCommand(WPARAM wParam, LPARAM)
{
//find window for hContact
- HWND hWnd = WindowList_Find(ghSendWindowList, wParam);
+ HWND hWnd = WindowList_Find(g_hSendWindowList, wParam);
if (!hWnd)
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEND), NULL, SendDlgProc, wParam);
else {
@@ -204,8 +204,8 @@ extern "C" __declspec(dllexport) int Load(void)
InitCommonControls();
- ghSendWindowList = WindowList_Create();
- ghRecvWindowList = WindowList_Create();
+ g_hSendWindowList = WindowList_Create();
+ g_hRecvWindowList = WindowList_Create();
//init hooks
HookEvent(ME_SYSTEM_MODULESLOADED, HookModulesLoaded);
@@ -225,7 +225,7 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
- WindowList_Destroy(ghSendWindowList);
- WindowList_Destroy(ghRecvWindowList);
+ WindowList_Destroy(g_hSendWindowList);
+ WindowList_Destroy(g_hRecvWindowList);
return 0;
}
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp
index 10aa4e70c5..84331201a3 100644
--- a/plugins/ContactsPlus/src/receive.cpp
+++ b/plugins/ContactsPlus/src/receive.cpp
@@ -169,7 +169,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
TranslateDialogDefault(hwndDlg);
{
CLISTEVENT *pcle = (CLISTEVENT*)lParam;
- WindowList_Add(ghRecvWindowList, hwndDlg, pcle->hContact);
+ WindowList_Add(g_hRecvWindowList, hwndDlg, pcle->hContact);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS)));
EnableDlgItem(hwndDlg, IDOK, FALSE);
EnableDlgItem(hwndDlg, IDDETAILS, FALSE);
@@ -448,7 +448,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
break;
case WM_CLOSE: // user closed window, so destroy it
- WindowList_Remove(ghRecvWindowList, hwndDlg);
+ WindowList_Remove(g_hRecvWindowList, hwndDlg);
DestroyWindow(hwndDlg);
break;
diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h
index 73ee03cb1e..52db60a171 100644
--- a/plugins/ContactsPlus/src/receive.h
+++ b/plugins/ContactsPlus/src/receive.h
@@ -60,7 +60,7 @@ struct TRecvContactsData
HICON hIcons[4]; // icons for dialog
};
-extern HANDLE ghRecvWindowList;
+extern MWindowList g_hRecvWindowList;
INT_PTR CALLBACK RecvDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp
index ae074322ea..2e0217c9e0 100644
--- a/plugins/ContactsPlus/src/send.cpp
+++ b/plugins/ContactsPlus/src/send.cpp
@@ -121,7 +121,7 @@ int TSendContactsData::SendContactsPacket(HWND hwndDlg, MCONTACT *phContacts, in
return FALSE; // Failure
}
- TAckData *ackData = gaAckData.Add(hProcc, new TAckData(hContact));
+ TAckData *ackData = g_aAckData.Add(hProcc, new TAckData(hContact));
uacklist.Add(hProcc);
ackData->nContacts = nContacts;
ackData->aContacts = (MCONTACT*)mir_alloc(nContacts*sizeof(MCONTACT));
@@ -230,7 +230,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
TranslateDialogDefault(hwndDlg);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS)));
SetAllContactChecks(GetDlgItem(hwndDlg, IDC_LIST), lParam);
- WindowList_Add(ghSendWindowList, hwndDlg, lParam);
+ WindowList_Add(g_hSendWindowList, hwndDlg, lParam);
wndData = new TSendContactsData(lParam);
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)wndData);
// new dlg init
@@ -272,7 +272,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
wndData->UnhookProtoAck();
if (wndData->uacklist.Count) {
for (int i = 0; i < wndData->uacklist.Count; i++)
- delete gaAckData.Remove(wndData->uacklist.Items[i]); // remove our ackdata & release structure
+ delete g_aAckData.Remove(wndData->uacklist.Items[i]); // remove our ackdata & release structure
mir_free(wndData->uacklist.Items);
wndData->uacklist.Items = NULL;
@@ -292,7 +292,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
case MSGERROR_RETRY:// resend timeouted packets
for (int i = 0; i < wndData->uacklist.Count; i++) {
- TAckData *lla = gaAckData.Remove(wndData->uacklist.Items[i]);
+ TAckData *lla = g_aAckData.Remove(wndData->uacklist.Items[i]);
HANDLE hProcc = (HANDLE)CallContactService(wndData->hContact, PSS_CONTACTS, MAKEWPARAM(0, lla->nContacts), (LPARAM)lla->aContacts);
if (!hProcc) { // if fatal do not include
@@ -303,7 +303,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
else {
// update process code
wndData->uacklist.Items[i] = hProcc;
- gaAckData.Add(hProcc, lla);
+ g_aAckData.Add(hProcc, lla);
}
}// collect TAckData for our window, resend
break;
@@ -384,7 +384,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (ack->type != ACKTYPE_CONTACTS)
break;
- TAckData *ackData = gaAckData.Get(ack->hProcess);
+ TAckData *ackData = g_aAckData.Get(ack->hProcess);
if (ackData == NULL)
break; // on unknown hprocc go away
@@ -424,7 +424,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
pBlob += strlennull(pBlob) + 1;
}
db_event_add(ackData->hContact, &dbei);
- gaAckData.Remove(ack->hProcess); // do not release here, still needed
+ g_aAckData.Remove(ack->hProcess); // do not release here, still needed
wndData->uacklist.Remove(ack->hProcess); // packet confirmed
for (i = 0; i < ackData->nContacts; i++) {
mir_free(maSend[i].mcaUIN);
@@ -464,7 +464,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
case WM_DESTROY:
for (int i = 0; i < SIZEOF(wndData->hIcons); i++)
DestroyIcon(wndData->hIcons[i]);
- WindowList_Remove(ghSendWindowList, hwndDlg);
+ WindowList_Remove(g_hSendWindowList, hwndDlg);
delete wndData;
break;
}
diff --git a/plugins/ContactsPlus/src/send.h b/plugins/ContactsPlus/src/send.h
index a9240ddef1..eada2a7da7 100644
--- a/plugins/ContactsPlus/src/send.h
+++ b/plugins/ContactsPlus/src/send.h
@@ -101,8 +101,8 @@ struct gAckList {
~gAckList() { if (Count) { for (int i=0; i<Count; i++) delete Items[i]; mir_free(Items); }; }
};
-extern HANDLE ghSendWindowList;
-extern gAckList gaAckData;
+extern MWindowList g_hSendWindowList;
+extern gAckList g_aAckData;
INT_PTR CALLBACK SendDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/ExternalAPI/m_yamn.h b/plugins/ExternalAPI/m_yamn.h
index 43b8fccffc..2be7c32712 100644
--- a/plugins/ExternalAPI/m_yamn.h
+++ b/plugins/ExternalAPI/m_yamn.h
@@ -11,8 +11,8 @@ typedef struct CYAMNVariables
{
#define YAMN_VARIABLESVERSION 3
HINSTANCE hInst;
- HANDLE MessageWnds;
- HANDLE NewMailAccountWnd;
+ MWindowList MessageWnds;
+ MWindowList NewMailAccountWnd;
int Shutdown;
} YAMN_VARIABLES, *PYAMN_VARIABLES;
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp
index 7ee80afda2..94459df0ca 100644
--- a/plugins/FavContacts/src/services.cpp
+++ b/plugins/FavContacts/src/services.cpp
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
static MCONTACT hContactToActivate;
-static HANDLE hDialogsList;
+static MWindowList hDialogsList;
INT_PTR svcShowMenu(WPARAM, LPARAM)
{
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp
index f29f3fb3da..fa6e4ddb6e 100644
--- a/plugins/FileAsMessage/src/main.cpp
+++ b/plugins/FileAsMessage/src/main.cpp
@@ -15,7 +15,7 @@ PLUGININFOEX pluginInfo =
{ 0x34b5a402, 0x1b79, 0x4246, { 0xb0, 0x41, 0x43, 0xd0, 0xb5, 0x90, 0xae, 0x2c } }
};
-HANDLE hFileList;
+MWindowList hFileList;
HINSTANCE hInst;
int hLangpack;
diff --git a/plugins/FileAsMessage/src/main.h b/plugins/FileAsMessage/src/main.h
index e0e6c01114..ee3577a12d 100644
--- a/plugins/FileAsMessage/src/main.h
+++ b/plugins/FileAsMessage/src/main.h
@@ -41,7 +41,7 @@ extern const ulong INITCRC;
#define WM_FE_SKINCHANGE WM_USER+102
extern HINSTANCE hInst;
-extern HANDLE hFileList;
+extern MWindowList hFileList;
extern HANDLE hEventNewFile;
extern HICON hIcons[5];
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp
index 2f94d2ec47..8f6e6aa3f7 100644
--- a/plugins/HistoryLinkListPlus/src/linklist.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist.cpp
@@ -19,9 +19,8 @@
// Global variables
HINSTANCE hInst;
-
-HANDLE hWindowList;
+MWindowList hWindowList;
HCURSOR splitCursor;
int hLangpack;
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
index cb9f69c8f3..28e5520a86 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
@@ -19,7 +19,7 @@
#include "linklist.h"
extern HINSTANCE hInst;
-extern HANDLE hWindowList;
+extern MWindowList hWindowList;
extern HCURSOR splitCursor;
MYCOLOURSET colourSet;
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
index aa80b1c799..b2524bb251 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
@@ -19,7 +19,7 @@
#include "linklist.h"
extern HINSTANCE hInst;
-extern HANDLE hWindowList;
+extern MWindowList hWindowList;
/*
The hyperlink detection in this function is taken from the
diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp
index 01da6e43e0..58201979cb 100644
--- a/plugins/IEHistory/src/IEHistory.cpp
+++ b/plugins/IEHistory/src/IEHistory.cpp
@@ -25,7 +25,7 @@ int hLangpack;//Miranda NG langpack used by translate functions, filled by mir_g
char ModuleName[] = "IEHistory";
HICON hIcon;
HINSTANCE hInstance;
-HANDLE hOpenWindowsList = NULL;
+MWindowList hOpenWindowsList = NULL;
HMODULE hUxTheme = 0;
BOOL(WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD) = NULL;
@@ -70,7 +70,7 @@ extern "C" int __declspec(dllexport) Load(void)
/// all initialization here
hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_HISTORYICON));
- hOpenWindowsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hOpenWindowsList = WindowList_Create();
InitServices();
diff --git a/plugins/IEHistory/src/stdafx.h b/plugins/IEHistory/src/stdafx.h
index daaa9d2916..ad8cfce450 100644
--- a/plugins/IEHistory/src/stdafx.h
+++ b/plugins/IEHistory/src/stdafx.h
@@ -79,7 +79,7 @@ extern HICON hIcon; //history icon
extern int hLangpack;
extern char ModuleName[];
extern HINSTANCE hInstance; //dll instance
-extern HANDLE hOpenWindowsList;
+extern MWindowList hOpenWindowsList;
extern PLUGININFOEX pluginInfo;
diff --git a/plugins/Msg_Export/src/Glob.h b/plugins/Msg_Export/src/Glob.h
index e63481959f..1f59deeb5f 100755
--- a/plugins/Msg_Export/src/Glob.h
+++ b/plugins/Msg_Export/src/Glob.h
@@ -55,6 +55,6 @@ using namespace std;
extern HINSTANCE hInstance;
-extern HANDLE hInternalWindowList;
+extern MWindowList hInternalWindowList;
#endif \ No newline at end of file
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp
index e5172f703b..1eb1177f0c 100755
--- a/plugins/Msg_Export/src/main.cpp
+++ b/plugins/Msg_Export/src/main.cpp
@@ -23,7 +23,7 @@ int hLangpack = 0;
static HANDLE hOpenHistoryMenuItem = 0;
-HANDLE hInternalWindowList = NULL;
+MWindowList hInternalWindowList = NULL;
/////////////////////////////////////////////////////
// Remember to update the Version in the resource !!!
diff --git a/plugins/NewAwaySysMod/src/Common.h b/plugins/NewAwaySysMod/src/Common.h
index c8a99eef6d..36b036c619 100644
--- a/plugins/NewAwaySysMod/src/Common.h
+++ b/plugins/NewAwaySysMod/src/Common.h
@@ -294,7 +294,7 @@ TCString VariablesEscape(TCString Str);
INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
// ReadAwayMsg.cpp
-extern HANDLE g_hReadWndList;
+extern MWindowList g_hReadWndList;
INT_PTR GetContactStatMsg(WPARAM wParam, LPARAM lParam);
// AwayOpt.cpp
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp
index 4d998293d8..8d7784a42e 100644
--- a/plugins/NewAwaySysMod/src/ContactList.cpp
+++ b/plugins/NewAwaySysMod/src/ContactList.cpp
@@ -23,7 +23,7 @@
#define EXTRAICON_XSTEP (GetSystemMetrics(SM_CXSMICON) + 1)
-static HANDLE hCLWindowList;
+static MWindowList hCLWindowList;
static int CLContactDeleted(WPARAM wParam, LPARAM lParam)
{
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp
index 7cc7c12fc8..04163e7dd5 100644
--- a/plugins/NewAwaySysMod/src/MsgTree.cpp
+++ b/plugins/NewAwaySysMod/src/MsgTree.cpp
@@ -46,12 +46,12 @@ SettingsList[] = {
IDS_MESSAGEDLG_DEF_OTL, ID_STATUS_OUTTOLUNCH, IDR_MSGTREEMENU_DEF_OTL
};
-static HANDLE hMTWindowList;
+static MWindowList hMTWindowList;
static WNDPROC g_OrigEditProc;
void LoadMsgTreeModule()
{
- hMTWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hMTWindowList = WindowList_Create();
}
static LRESULT CALLBACK EditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
index f394c9bdda..1123ae5fab 100644
--- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
@@ -30,7 +30,7 @@ struct READAWAYMSGDATA
#define RAMDLGSIZESETTING "ReadAwayMsgDlg"
-HANDLE g_hReadWndList = NULL;
+MWindowList g_hReadWndList = NULL;
static int ReadAwayMsgDlgResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc)
{
diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h
index da0659d198..11b78ad76f 100644
--- a/plugins/NewsAggregator/Src/Common.h
+++ b/plugins/NewsAggregator/Src/Common.h
@@ -56,7 +56,8 @@ Boston, MA 02111-1307, USA.
extern HINSTANCE hInst;
extern HWND hAddFeedDlg;
-extern HANDLE hChangeFeedDlgList, hNetlibUser;
+extern MWindowList hChangeFeedDlgList;
+extern HANDLE hNetlibUser;
extern UINT_PTR timerId;
// check if Feeds is currently updating
extern bool ThreadRunning;
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp
index 13c08a8693..112b90b7ef 100644
--- a/plugins/NewsAggregator/Src/NewsAggregator.cpp
+++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp
@@ -24,7 +24,7 @@ HINSTANCE hInst = NULL;
int hLangpack;
HANDLE hPrebuildMenuHook = NULL;
HWND hAddFeedDlg;
-HANDLE hChangeFeedDlgList = NULL;
+MWindowList hChangeFeedDlgList = NULL;
XML_API xi = {0};
TCHAR tszRoot[MAX_PATH] = {0};
HANDLE hUpdateMutex;
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp
index c8b0c7289f..bc2769807d 100644
--- a/plugins/Popup/src/srmm_menu.cpp
+++ b/plugins/Popup/src/srmm_menu.cpp
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
on current active mode for user.
*************************************************************************************/
-static HANDLE hDialogsList = NULL;
+static MWindowList hDialogsList = NULL;
static void SrmmMenu_UpdateIcon(MCONTACT hContact)
{
diff --git a/plugins/Quotes/src/CurrencyConverter.cpp b/plugins/Quotes/src/CurrencyConverter.cpp
index 5e5de39f81..9a3d45cb50 100644
--- a/plugins/Quotes/src/CurrencyConverter.cpp
+++ b/plugins/Quotes/src/CurrencyConverter.cpp
@@ -96,7 +96,7 @@ namespace
{
case WM_INITDIALOG:
{
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, false);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, false);
assert(hWL);
WindowList_Add(hWL, hDlg, NULL);
@@ -155,7 +155,7 @@ namespace
return (TRUE);
case WM_CLOSE:
{
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, false);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, false);
assert(hWL);
WindowList_Remove(hWL, hDlg);
Utils_SaveWindowPosition(hDlg, NULL, QUOTES_PROTOCOL_NAME, WINDOW_PREFIX);
@@ -282,7 +282,7 @@ namespace
INT_PTR QuotesMenu_CurrencyConverter(WPARAM, LPARAM)
{
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, true);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX, true);
HWND hWnd = WindowList_Find(hWL, NULL);
if (NULL != hWnd)
{
diff --git a/plugins/Quotes/src/ModuleInfo.cpp b/plugins/Quotes/src/ModuleInfo.cpp
index 656d17ad64..65d2593482 100644
--- a/plugins/Quotes/src/ModuleInfo.cpp
+++ b/plugins/Quotes/src/ModuleInfo.cpp
@@ -22,9 +22,9 @@ CModuleInfo& CModuleInfo::GetInstance()
return mi;
}
-HANDLE CModuleInfo::GetWindowList(const std::string& rsKey, bool bAllocateIfNonExist /*= true*/)
+MWindowList CModuleInfo::GetWindowList(const std::string& rsKey, bool bAllocateIfNonExist /*= true*/)
{
- HANDLE hResult = NULL;
+ MWindowList hResult = NULL;
THandles::const_iterator i = m_ahWindowLists.find(rsKey);
if (i != m_ahWindowLists.end())
{
diff --git a/plugins/Quotes/src/ModuleInfo.h b/plugins/Quotes/src/ModuleInfo.h
index 6f4676bb1a..fdc67ccd6a 100644
--- a/plugins/Quotes/src/ModuleInfo.h
+++ b/plugins/Quotes/src/ModuleInfo.h
@@ -21,7 +21,7 @@ public:
static CModuleInfo& GetInstance();
void OnMirandaShutdown();
- HANDLE GetWindowList(const std::string& rsKey, bool bAllocateIfNonExist = true);
+ MWindowList GetWindowList(const std::string& rsKey, bool bAllocateIfNonExist = true);
bool GetExtendedStatusFlag()const;
static bool Verify();
@@ -35,7 +35,7 @@ public:
static void SetHTMLEngine(THTMLEnginePtr pEngine);
private:
- typedef std::map<std::string, HANDLE> THandles;
+ typedef std::map<std::string, MWindowList> THandles;
THandles m_ahWindowLists;
bool m_bExtendedStatusInfo;
};
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp
index e94245e3c3..64f5012243 100644
--- a/plugins/Quotes/src/QuoteInfoDlg.cpp
+++ b/plugins/Quotes/src/QuoteInfoDlg.cpp
@@ -206,7 +206,7 @@ namespace
case WM_INITDIALOG:
{
hContact = MCONTACT(lParam);
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, false);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, false);
assert(hWL);
WindowList_Add(hWL, hdlg, hContact);
@@ -225,7 +225,7 @@ namespace
{
SetWindowLongPtr(hdlg, GWLP_USERDATA, 0);
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, false);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, false);
assert(hWL);
WindowList_Remove(hWL, hdlg);
Utils_SaveWindowPosition(hdlg, hContact, QUOTES_MODULE_NAME, WINDOW_PREFIX_INFO);
@@ -253,7 +253,7 @@ int Quotes_OnContactDoubleClick(WPARAM wp, LPARAM/* lp*/)
MCONTACT hContact = MCONTACT(wp);
if (CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact))
{
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, true);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO, true);
assert(hWL);
HWND hWnd = WindowList_Find(hWL, hContact);
if (NULL != hWnd) {
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp
index 6e14d26137..268b9a1c1b 100644
--- a/plugins/Quotes/src/SettingsDlg.cpp
+++ b/plugins/Quotes/src/SettingsDlg.cpp
@@ -271,7 +271,7 @@ namespace
MCONTACT hContact = MCONTACT(lp);
TranslateDialogDefault(hWnd);
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS, false);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS, false);
assert(hWL);
WindowList_Add(hWL, hWnd, hContact);
@@ -493,7 +493,7 @@ namespace
CSettingWindowParam* pParam = get_param(hWnd);
SetWindowLongPtr(hWnd, GWLP_USERDATA, 0);
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS, false);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS, false);
assert(hWL);
WindowList_Remove(hWL, hWnd);
Utils_SaveWindowPosition(hWnd, pParam->m_hContact, QUOTES_MODULE_NAME, WINDOW_PREFIX_SETTINGS);
@@ -509,7 +509,7 @@ namespace
void ShowSettingsDlg(MCONTACT hContact)
{
- HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS, true);
+ MWindowList hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS, true);
assert(hWL);
HWND hWnd = WindowList_Find(hWL, hContact);
if (NULL != hWnd)
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index a0251e344c..dc8ac0b113 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -13,7 +13,7 @@ int hLangpack = 0;
CLIST_INTERFACE *pcli;
HANDLE hTopToolbarButtonShowList;
HANDLE hMsgWndEvent;
-HANDLE hWindowList;
+MWindowList hWindowList;
HGENMENU hMenuItemRemove;
const INT_PTR boo = 0;
diff --git a/plugins/Scriver/src/globals.h b/plugins/Scriver/src/globals.h
index c5a2d6e7a6..30c1ee6a88 100644
--- a/plugins/Scriver/src/globals.h
+++ b/plugins/Scriver/src/globals.h
@@ -82,9 +82,9 @@ struct GlobalMessageData
{
unsigned int flags;
unsigned int flags2;
- HANDLE hMessageWindowList;
+ MWindowList hMessageWindowList;
DWORD openFlags;
- HANDLE hParentWindowList;
+ MWindowList hParentWindowList;
ParentWindowData *lastParent;
ParentWindowData *lastChatParent;
DWORD limitNamesLength;
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp
index cf3280e56e..fa56ecbfcf 100644
--- a/plugins/SeenPlugin/src/history.cpp
+++ b/plugins/SeenPlugin/src/history.cpp
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "seen.h"
-static HANDLE hWindowList;
+static MWindowList hWindowList;
char* BuildSetting(int historyLast)
{
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp
index b5a50a98c1..7fee9de885 100644
--- a/plugins/SeenPlugin/src/main.cpp
+++ b/plugins/SeenPlugin/src/main.cpp
@@ -22,7 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HINSTANCE hInstance;
HANDLE ehmissed = NULL, ehuserinfo = NULL, ehmissed_proto = NULL;
-HANDLE g_hShutdownEvent, g_pUserInfo;
+HANDLE g_hShutdownEvent;
+MWindowList g_pUserInfo;
int hLangpack;
diff --git a/plugins/SeenPlugin/src/seen.h b/plugins/SeenPlugin/src/seen.h
index 8bfc453336..6f2273546b 100644
--- a/plugins/SeenPlugin/src/seen.h
+++ b/plugins/SeenPlugin/src/seen.h
@@ -119,7 +119,7 @@ extern HINSTANCE hInstance;
extern DWORD StatusColors15bits[];
extern BOOL includeIdle;
extern HANDLE ehmissed, ehuserinfo, ehmissed_proto;
-extern HANDLE g_pUserInfo;
+extern MWindowList g_pUserInfo;
extern HGENMENU hmenuitem;
extern DWORD dwmirver;
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp
index 76457e7267..b3e9a0334e 100644
--- a/plugins/SimpleStatusMsg/src/awaymsg.cpp
+++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp
@@ -28,8 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "commonheaders.h"
static HGENMENU hAwayMsgMenuItem, hCopyMsgMenuItem, hGoToURLMenuItem;
-static HANDLE hWindowList;
-static HANDLE hWindowList2;
+static MWindowList hWindowList, hWindowList2;
static char *StrNormNewlineA(char *szStr)
{
diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h
index 7893c21309..bd22ddca47 100644
--- a/plugins/TabSRMM/src/globals.h
+++ b/plugins/TabSRMM/src/globals.h
@@ -133,7 +133,7 @@ public:
BOOL m_autoSplit;
BOOL m_FlashOnMTN;
DWORD dwThreadID;
- HANDLE m_hMessageWindowList, hUserPrefsWindowList;
+ MWindowList m_hMessageWindowList, hUserPrefsWindowList;
HMENU m_MenuBar;
COLORREF m_ipBackgroundGradient;
COLORREF m_ipBackgroundGradientHigh;
diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h
index 99a2f80cd5..4fc142756b 100644
--- a/plugins/TabSRMM/src/mim.h
+++ b/plugins/TabSRMM/src/mim.h
@@ -193,7 +193,7 @@ public:
static int MessageEventAdded(WPARAM wParam, LPARAM lParam);
public:
- HANDLE m_hMessageWindowList;
+ MWindowList m_hMessageWindowList;
// various function pointers
static PDTTE m_pfnDrawThemeTextEx;
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index e931c1b9d0..49a7a70c33 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -4,7 +4,7 @@ HANDLE hTypingNotify;
static HGENMENU hDisableMenu = NULL;
-static HANDLE hPopupsList = NULL;
+static MWindowList hPopupsList = NULL;
static BYTE OnePopup;
static BYTE ShowMenu;
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index ced9ac7c04..a5a2c76604 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -136,7 +136,6 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
DWORD *pdwActionToTake = (DWORD *)lParam;
unsigned int iOldIEView = 0;
HWND hWnd = M.FindWindow(hContact);
- DWORD sCodePage = M.GetDword(hContact, "ANSIcodepage", 0);
BYTE bOldInfoPanel = M.GetByte(hContact, "infopanel", 0);
if (hWnd) {
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index f69a4c8c2b..d7be4d2221 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -52,7 +52,7 @@ static TRTFColorTable _rtf_ctable[] =
int Utils::rtf_ctable_size = 0;
TRTFColorTable* Utils::rtf_ctable = 0;
-HANDLE CWarning::hWindowList = 0;
+MWindowList CWarning::hWindowList = 0;
static TCHAR *w_bbcodes_begin[] = { _T("[b]"), _T("[i]"), _T("[u]"), _T("[s]"), _T("[color=") };
static TCHAR *w_bbcodes_end[] = { _T("[/b]"), _T("[/i]"), _T("[/u]"), _T("[/s]"), _T("[/color]") };
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h
index 3815595ffa..6db72b6c26 100644
--- a/plugins/TabSRMM/src/utils.h
+++ b/plugins/TabSRMM/src/utils.h
@@ -179,7 +179,7 @@ private:
static __int64 getMask(); // get bit mask for disabled message classes
private:
- static HANDLE hWindowList;
+ static MWindowList hWindowList;
};
#endif /* __UTILS_H */
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp
index 22caa0e3c2..c6ef0f73fb 100644
--- a/plugins/TrafficCounter/src/TrafficCounter.cpp
+++ b/plugins/TrafficCounter/src/TrafficCounter.cpp
@@ -392,7 +392,7 @@ int TrafficCounter_Draw(HWND hwnd, HDC hDC)
static void TC_AlphaText(HDC hDC, LPCTSTR lpString, RECT* lpRect, UINT format, BYTE ClistModernPresent)
{
- int nCount = mir_tstrlen( lpString );
+ int nCount = (int)mir_tstrlen( lpString );
if (ClistModernPresent)
AlphaText(hDC, lpString, nCount, lpRect, format, Traffic_FontColor);
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp
index 196ec13abb..fa304ad0de 100644
--- a/plugins/TrafficCounter/src/misc.cpp
+++ b/plugins/TrafficCounter/src/misc.cpp
@@ -159,7 +159,7 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size)
l += mir_tstrlen(szUnit) + 1;
Res = (TCHAR*)malloc(l * sizeof(TCHAR));
if (!Res) return 0;
- GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, Res, l);
+ GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, Res, (int)l);
mir_tstrcat(Res, szUnit);
if (Size && Buffer)
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp
index a8d286eeed..0828884142 100644
--- a/plugins/UserInfoEx/src/dlg_propsheet.cpp
+++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp
@@ -59,8 +59,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
***********************************************************************************************************/
static BYTE bInitIcons = INIT_ICONS_NONE;
-static HANDLE ghWindowList = NULL;
-static HANDLE ghDetailsInitEvent = NULL;
+static MWindowList g_hWindowList = NULL;
+static HANDLE g_hDetailsInitEvent = NULL;
static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -249,7 +249,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam)
myGlobals.WantAeroAdaption = db_get_b(NULL, MODNAME, SET_PROPSHEET_AEROADAPTION, TRUE);
// allow only one dialog per user
- if (HWND hWnd = WindowList_Find(ghWindowList, wParam)) {
+ if (HWND hWnd = WindowList_Find(g_hWindowList, wParam)) {
SetForegroundWindow(hWnd);
SetFocus(hWnd);
return 0;
@@ -301,7 +301,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam)
}
// add the pages
- NotifyEventHooks(ghDetailsInitEvent, (WPARAM)&psh, wParam);
+ NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, wParam);
if (!psh._pPages || !psh._numPages) {
MsgErr(NULL, LPGENT("No pages have been added. Canceling dialog creation!"));
return 1;
@@ -319,7 +319,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam)
if (psh._hContact) {
psh._pszProto = DB::Contact::Proto(psh._hContact);
if ((INT_PTR)psh._pszProto != CALLSERVICE_NOTFOUND)
- NotifyEventHooks(ghDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
+ NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
}
}
psh._hContact = wParam;
@@ -400,7 +400,7 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam)
**/
static int OnDeleteContact(WPARAM wParam, LPARAM lParam)
{
- HWND hWnd = WindowList_Find(ghWindowList, wParam);
+ HWND hWnd = WindowList_Find(g_hWindowList, wParam);
if (hWnd != NULL)
DestroyWindow(hWnd);
return 0;
@@ -414,7 +414,7 @@ static int OnDeleteContact(WPARAM wParam, LPARAM lParam)
**/
static int OnShutdown(WPARAM wParam, LPARAM lParam)
{
- WindowList_BroadcastAsync(ghWindowList, WM_DESTROY, 0, 0);
+ WindowList_BroadcastAsync(g_hWindowList, WM_DESTROY, 0, 0);
return 0;
}
@@ -576,7 +576,7 @@ void DlgContactInfoInitTreeIcons()
pszContactProto = DB::Contact::Proto(psh._hContact);
if ((INT_PTR)pszContactProto != CALLSERVICE_NOTFOUND && !mir_strcmp(pd[i]->szModuleName, pszContactProto)) {
// call a notification for the contact to retrieve all protocol specific tree items
- NotifyEventHooks(ghDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
+ NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
if (psh._pPages) {
psh.Free_pPages();
psh._dwFlags = PSTVF_INITICONS | PSF_PROTOPAGESONLY;
@@ -592,7 +592,7 @@ void DlgContactInfoInitTreeIcons()
if (!(bInitIcons & INIT_ICONS_OWNER)) {
psh._hContact = NULL;
psh._pszProto = NULL;
- NotifyEventHooks(ghDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
+ NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
if (psh._pPages) {
psh.Free_pPages();
}
@@ -610,8 +610,8 @@ void DlgContactInfoInitTreeIcons()
**/
void DlgContactInfoUnLoadModule()
{
- WindowList_Destroy(ghWindowList);
- DestroyHookableEvent(ghDetailsInitEvent);
+ WindowList_Destroy(g_hWindowList);
+ DestroyHookableEvent(g_hDetailsInitEvent);
}
/**
@@ -622,7 +622,7 @@ void DlgContactInfoUnLoadModule()
**/
void DlgContactInfoLoadModule()
{
- ghDetailsInitEvent = CreateHookableEvent(ME_USERINFO_INITIALISE);
+ g_hDetailsInitEvent = CreateHookableEvent(ME_USERINFO_INITIALISE);
CreateServiceFunction(MS_USERINFO_SHOWDIALOG, ShowDialog);
CreateServiceFunction("UserInfo/AddPage", AddPage);
@@ -630,7 +630,7 @@ void DlgContactInfoLoadModule()
HookEvent(ME_DB_CONTACT_DELETED, OnDeleteContact);
HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown);
HookEvent(ME_USERINFO_INITIALISE, InitDetails);
- ghWindowList = WindowList_Create();
+ g_hWindowList = WindowList_Create();
// check whether changing my details via UserInfoEx is basically possible
myGlobals.CanChangeDetails = FALSE;
@@ -821,7 +821,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
// show the first propsheetpage
//
// finally add the dialog to the window list
- WindowList_Add(ghWindowList, hDlg, pPs->hContact);
+ WindowList_Add(g_hWindowList, hDlg, pPs->hContact);
// show the dialog
pPs->dwFlags &= ~PSF_LOCKED;
@@ -1615,7 +1615,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
ResetUpdateInfo(pPs);
// avoid any further message processing for this dialog page
- WindowList_Remove(ghWindowList, hDlg);
+ WindowList_Remove(g_hWindowList, hDlg);
SetUserData(hDlg, NULL);
// unhook events and stop timers
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp
index eba9346537..02e61c82d2 100644
--- a/plugins/Weather/src/weather.cpp
+++ b/plugins/Weather/src/weather.cpp
@@ -37,8 +37,7 @@ HWND hPopupWindow;
HANDLE hHookWeatherUpdated;
HANDLE hHookWeatherError;
-HANDLE hDataWindowList;
-HANDLE hWindowList;
+MWindowList hDataWindowList, hWindowList;
HANDLE hUpdateMutex;
diff --git a/plugins/Weather/src/weather.h b/plugins/Weather/src/weather.h
index 77550391bc..182fb07cd9 100644
--- a/plugins/Weather/src/weather.h
+++ b/plugins/Weather/src/weather.h
@@ -363,11 +363,12 @@ extern MYOPTIONS opt;
extern unsigned status;
extern unsigned old_status;
-extern HANDLE hDataWindowList;
+extern MWindowList hDataWindowList;
+extern MWindowList hWindowList;
+
extern HANDLE hNetlibUser, hNetlibHttp;
extern HANDLE hHookWeatherUpdated;
extern HANDLE hHookWeatherError;
-extern HANDLE hWindowList;
extern HANDLE hTBButton;
extern UINT_PTR timerId;
extern HANDLE hUpdateMutex;
@@ -546,6 +547,6 @@ void LoadBriefInfoText(HWND hwndDlg, MCONTACT hContact);
INT_PTR CALLBACK DlgProcBrief(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
void InitIcons(void);
-HICON LoadIconEx(const char* name, BOOL big);
+HICON LoadIconEx(const char* name, bool big);
HANDLE GetIconHandle(const char* name);
void ReleaseIconEx(HICON hIcon);
diff --git a/plugins/Weather/src/weather_icons.cpp b/plugins/Weather/src/weather_icons.cpp
index 74a25ffbe8..e4b548b37c 100644
--- a/plugins/Weather/src/weather_icons.cpp
+++ b/plugins/Weather/src/weather_icons.cpp
@@ -42,7 +42,7 @@ void InitIcons(void)
Icon_Register(hInst, WEATHERPROTONAME, iconList, SIZEOF(iconList), WEATHERPROTONAME);
}
-HICON LoadIconEx(const char* name, BOOL big)
+HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", WEATHERPROTONAME, name);
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp
index 714df36626..7c91da6ffc 100644
--- a/plugins/Weather/src/weather_mwin.cpp
+++ b/plugins/Weather/src/weather_mwin.cpp
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MS_TOOLTIP_SHOWTIP "mToolTip/ShowTip"
#define MS_TOOLTIP_HIDETIP "mToolTip/HideTip"
-static HANDLE hMwinWindowList;
+static MWindowList hMwinWindowList;
static HANDLE hFontHook;
HGENMENU hMwinMenu;
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp
index 1e3ff4bd07..a9981b30fe 100644
--- a/plugins/WebView/src/main.cpp
+++ b/plugins/WebView/src/main.cpp
@@ -23,8 +23,8 @@
#include "stdafx.h"
#include "webview.h"
+MWindowList hWindowList;
HANDLE hNetlibUser;
-HANDLE hWindowList;
HANDLE hHookDisplayDataAlert, hHookAlertPopup, hHookAlertWPopup, hHookErrorPopup, hHookAlertOSD;
int hLangpack = 0;
diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h
index eea8f08c03..b78c165caf 100644
--- a/plugins/WebView/src/webview.h
+++ b/plugins/WebView/src/webview.h
@@ -144,7 +144,8 @@ extern HWND ContactHwnd;
extern HINSTANCE hInst;
extern HMENU hMenu;
extern int bpStatus;
-extern HANDLE hNetlibUser, hWindowList;
+extern HANDLE hNetlibUser;
+extern MWindowList hWindowList;
extern HANDLE hMenuItem1, hMenuItemCountdown;
extern char optionsname[80];
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp
index dd7984dd90..6560ce3bd2 100644
--- a/plugins/WhenWasIt/src/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/src/WhenWasIt.cpp
@@ -24,7 +24,7 @@ char ModuleName[] = "WhenWasIt";
HINSTANCE hInstance;
HWND hBirthdaysDlg = NULL;
HWND hUpcomingDlg = NULL;
-HANDLE hAddBirthdayWndsList = NULL;
+MWindowList hAddBirthdayWndsList = NULL;
int hLangpack;
HANDLE hmCheckBirthdays = NULL;
diff --git a/plugins/WhenWasIt/src/commonheaders.h b/plugins/WhenWasIt/src/commonheaders.h
index a0435abcc1..1bf7b34c5a 100644
--- a/plugins/WhenWasIt/src/commonheaders.h
+++ b/plugins/WhenWasIt/src/commonheaders.h
@@ -66,7 +66,7 @@ extern char ModuleName[];
extern HINSTANCE hInstance;
extern HWND hBirthdaysDlg;
extern HWND hUpcomingDlg;
-extern HANDLE hAddBirthdayWndsList;
+extern MWindowList hAddBirthdayWndsList;
struct CommonData{
DWORD foreground;
diff --git a/plugins/XSoundNotify/src/Common.h b/plugins/XSoundNotify/src/Common.h
index 4cbed8f0fb..2f31a6276e 100644
--- a/plugins/XSoundNotify/src/Common.h
+++ b/plugins/XSoundNotify/src/Common.h
@@ -39,7 +39,7 @@ struct XSN_Data
extern LIST<XSN_Data> XSN_Users;
extern HINSTANCE hInst;
-extern HANDLE hChangeSoundDlgList;
+extern MWindowList hChangeSoundDlgList;
extern BYTE isIgnoreSound, isOwnSound;
bool IsSuitableProto(PROTOACCOUNT *pa);
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp
index 3cfe906eec..7a857a1b59 100644
--- a/plugins/XSoundNotify/src/xsn_main.cpp
+++ b/plugins/XSoundNotify/src/xsn_main.cpp
@@ -13,7 +13,7 @@ HINSTANCE hInst;
int hLangpack;
LIST<XSN_Data> XSN_Users(10, NumericKeySortT);
HGENMENU hChangeSound = NULL;
-HANDLE hChangeSoundDlgList = NULL;
+MWindowList hChangeSoundDlgList = NULL;
BYTE isIgnoreSound = 0, isOwnSound = 0;
CHAT_MANAGER *pci;
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index d56c93f3eb..4a2a341cfc 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -220,7 +220,7 @@ static void LoadPlugins()
continue;
// we have a dot
- int len = mir_tstrlen(fd.cFileName); // find the length of the string
+ int len = (int)mir_tstrlen(fd.cFileName); // find the length of the string
TCHAR* end = fd.cFileName+len; // get a pointer to the NULL
int safe = (end-dot)-1; // figure out how many chars after the dot are "safe", not including NULL
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index b5c762af08..21fdf9b5d6 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MENUITEM_SERVER 2
#define MENUITEM_RESOURCES 10
-static HANDLE hDialogsList = NULL;
+static MWindowList hDialogsList = NULL;
static HANDLE hChooserMenu, hStatusMenuInit;
static int iChooserMenuPos = 30000;
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index 9c09e5a415..0ebaa064a3 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber_list.h"
-static HANDLE hUserInfoList = NULL;
+static MWindowList hUserInfoList = NULL;
struct UserInfoStringBuf
{
diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp
index 39fb287cb3..c804369dbb 100644
--- a/protocols/Steam/src/steam_dialogs.cpp
+++ b/protocols/Steam/src/steam_dialogs.cpp
@@ -11,8 +11,8 @@ void CSteamPasswordEditor::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, "main");
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, 16));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, 32));
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
SendMessage(m_password.GetHwnd(), EM_LIMITTEXT, 64, 0);
@@ -49,8 +49,8 @@ void CSteamGuardDialog::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, "main");
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, 16));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, 32));
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 5, 0);
@@ -96,8 +96,8 @@ void CSteamCaptchaDialog::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, "main");
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, 16));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, 32));
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 6, 0);
diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp
index d22cde9c88..74de926836 100644
--- a/protocols/Steam/src/steam_xstatus.cpp
+++ b/protocols/Steam/src/steam_xstatus.cpp
@@ -98,7 +98,7 @@ HICON CSteamProto::GetXStatusIcon(int status, UINT flags)
char iconName[100];
mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, "gaming");
- HICON icon = IcoLib_GetIcon(iconName, (flags & LR_BIGICON) ? 32 : 16);
+ HICON icon = IcoLib_GetIcon(iconName, (flags & LR_BIGICON) != 0);
return (flags & LR_SHARED) ? icon : CopyIcon(icon);
}
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp
index c9c9eb8246..e03e94b6d2 100644
--- a/protocols/Tox/src/tox_multimedia.cpp
+++ b/protocols/Tox/src/tox_multimedia.cpp
@@ -28,8 +28,8 @@ void CToxCallDlgBase::SetIcon(const char *name)
{
char iconName[100];
mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, name);
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, 16));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, 32));
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
}
void CToxCallDlgBase::SetTitle(const TCHAR *title)
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index f9ff422ee8..2afaae8347 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -251,7 +251,7 @@ private:
void OnGotFriendAvatarData(AvatarTransferParam *transfer);
// multimedia
- HANDLE hAudioDialogs;
+ MWindowList hAudioDialogs;
HWAVEOUT hOutDevice;
std::map<MCONTACT, int32_t> calls;
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp
index 6d476adcff..80f775ff8f 100644
--- a/src/core/stdaway/src/awaymsg.cpp
+++ b/src/core/stdaway/src/awaymsg.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int LoadAwayMessageSending(void);
static HGENMENU hAwayMsgMenuItem;
-static HANDLE hWindowList;
+static MWindowList hWindowList;
struct AwayMsgDlgData {
MCONTACT hContact;
diff --git a/src/core/stdmsg/src/globals.h b/src/core/stdmsg/src/globals.h
index 8d5ba0683b..ff0557fc79 100644
--- a/src/core/stdmsg/src/globals.h
+++ b/src/core/stdmsg/src/globals.h
@@ -49,7 +49,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct GlobalMessageData
{
unsigned int flags;
- HANDLE hMessageWindowList;
+ MWindowList hMessageWindowList;
DWORD openFlags;
DWORD msgTimeout;
DWORD nFlashMax;
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp
index 176a761ac4..8f38b2d02f 100644
--- a/src/core/stduihist/src/history.cpp
+++ b/src/core/stduihist/src/history.cpp
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcHistoryFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static HANDLE hWindowList = 0;
+static MWindowList hWindowList = 0;
static HGENMENU hContactMenu = 0;
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdurl/commonheaders.h b/src/core/stdurl/commonheaders.h
index 90c3c440d5..6651d1f240 100644
--- a/src/core/stdurl/commonheaders.h
+++ b/src/core/stdurl/commonheaders.h
@@ -71,3 +71,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../mir_app/src/resource.h"
extern HINSTANCE hInst;
+extern MWindowList hUrlWindowList;
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp
index f12c170831..5c1b3c50b3 100644
--- a/src/core/stdurl/url.cpp
+++ b/src/core/stdurl/url.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_url.h>
#include "url.h"
-HANDLE hUrlWindowList = NULL;
+MWindowList hUrlWindowList = NULL;
static HANDLE hEventContactSettingChange = NULL;
static HANDLE hContactDeleted = NULL;
static HGENMENU hSRUrlMenuItem = NULL;
diff --git a/src/core/stdurl/urldialogs.cpp b/src/core/stdurl/urldialogs.cpp
index d681aa2bde..f65bf202b9 100644
--- a/src/core/stdurl/urldialogs.cpp
+++ b/src/core/stdurl/urldialogs.cpp
@@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-extern HANDLE hUrlWindowList;
-
static void sttUpdateTitle(HWND hwndDlg, MCONTACT hContact)
{
TCHAR newtitle[256], oldtitle[256];
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp
index 9fc5cbe86a..db234f29cb 100644
--- a/src/core/stduserinfo/src/userinfo.cpp
+++ b/src/core/stduserinfo/src/userinfo.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int DetailsInit(WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static HANDLE hWindowList = NULL;
+static MWindowList hWindowList = NULL;
static HANDLE hDetailsInitEvent;
struct DetailsPageInit
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp
index 6863694d05..e677c7c6e3 100644
--- a/src/mir_app/src/clc.cpp
+++ b/src/mir_app/src/clc.cpp
@@ -34,7 +34,7 @@ void UninitCustomMenus(void);
void MTG_OnmodulesLoad(void);
static bool bModuleInitialized = false;
-static HANDLE hClcWindowList;
+static MWindowList hClcWindowList;
static HANDLE hShowInfoTipEvent;
HANDLE hHideInfoTipEvent;
static LIST<void> arEvents(10);
diff --git a/src/mir_app/src/utils.cpp b/src/mir_app/src/utils.cpp
index 9ac79dd185..cebebc6e5f 100644
--- a/src/mir_app/src/utils.cpp
+++ b/src/mir_app/src/utils.cpp
@@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR ResizeDialog(WPARAM wParam, LPARAM lParam);
int InitOpenUrl(void);
-int InitWindowList(void);
int InitPathUtils(void);
int InitHyperlink(void);
int InitColourPicker(void);
@@ -477,7 +476,6 @@ int LoadUtilsModule(void)
CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda);
InitOpenUrl();
- InitWindowList();
InitHyperlink();
InitPathUtils();
InitColourPicker();
diff --git a/src/mir_app/src/windowlist.cpp b/src/mir_app/src/windowlist.cpp
deleted file mode 100644
index cea13f4e6e..0000000000
--- a/src/mir_app/src/windowlist.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org),
-Copyright (c) 2000-12 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-struct TWindowListItem
-{
- TWindowListItem(MCONTACT _contact, HWND _wnd) :
- hContact(_contact),
- hWnd(_wnd)
- {}
-
- MCONTACT hContact;
- HWND hWnd;
-};
-
-typedef OBJLIST<TWindowListItem> TWindowList;
-
-static INT_PTR AllocWindowList(WPARAM, LPARAM)
-{
- return (INT_PTR)new TWindowList(10, NumericKeySortT);
-}
-
-static INT_PTR DestroyWindowList(WPARAM wParam, LPARAM)
-{
- delete (TWindowList*)wParam;
- return 0;
-}
-
-static INT_PTR AddToWindowList(WPARAM, LPARAM lParam)
-{
- WINDOWLISTENTRY *pEntry = (WINDOWLISTENTRY*)lParam;
- TWindowList *pList = (TWindowList*)pEntry->hList;
- if (pList != NULL)
- pList->insert(new TWindowListItem(pEntry->hContact, pEntry->hwnd));
- return 0;
-}
-
-static INT_PTR RemoveFromWindowList(WPARAM wParam, LPARAM lParam)
-{
- if (wParam == 0) return 1;
- TWindowList &pList = *(TWindowList*)wParam;
- for (int i = 0; i < pList.getCount(); i++) {
- if (pList[i].hWnd == (HWND)lParam) {
- pList.remove(i);
- return 0;
- }
- }
- return 1;
-}
-
-static INT_PTR FindInWindowList(WPARAM wParam, LPARAM lParam)
-{
- if (wParam == 0) return NULL;
- TWindowList &pList = *(TWindowList*)wParam;
- TWindowListItem *p = pList.find((TWindowListItem*)&lParam);
- return (p == NULL) ? NULL : (INT_PTR)p->hWnd;
-}
-
-static INT_PTR BroadcastToWindowList(WPARAM wParam, LPARAM lParam)
-{
- if (wParam == 0 || lParam == 0) return NULL;
- TWindowList &pList = *(TWindowList*)wParam;
- MSG *msg = (MSG*)lParam;
- for (int i = pList.getCount()-1; i >= 0; i--)
- SendMessage(pList[i].hWnd, msg->message, msg->wParam, msg->lParam);
- return 0;
-}
-
-static INT_PTR BroadcastToWindowListAsync(WPARAM wParam, LPARAM lParam)
-{
- if (wParam == 0 || lParam == 0) return NULL;
- TWindowList &pList = *(TWindowList*)wParam;
- MSG *msg = (MSG*)lParam;
- for (int i = pList.getCount()-1; i >= 0; i--)
- PostMessage(pList[i].hWnd, msg->message, msg->wParam, msg->lParam);
- return 0;
-}
-
-int InitWindowList(void)
-{
- CreateServiceFunction(MS_UTILS_ALLOCWINDOWLIST, AllocWindowList);
- CreateServiceFunction(MS_UTILS_DESTROYWINDOWLIST, DestroyWindowList);
- CreateServiceFunction(MS_UTILS_ADDTOWINDOWLIST, AddToWindowList);
- CreateServiceFunction(MS_UTILS_REMOVEFROMWINDOWLIST, RemoveFromWindowList);
- CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST, BroadcastToWindowList);
- CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC, BroadcastToWindowListAsync);
- CreateServiceFunction(MS_UTILS_FINDWINDOWINLIST, FindInWindowList);
- return 0;
-}
diff --git a/src/mir_core/mir_core_10.vcxproj b/src/mir_core/mir_core_10.vcxproj
index ce4eb74f8c..68946ed6c2 100644
--- a/src/mir_core/mir_core_10.vcxproj
+++ b/src/mir_core/mir_core_10.vcxproj
@@ -92,6 +92,7 @@
<ClCompile Include="src\ui_utils.cpp" />
<ClCompile Include="src\utf.cpp" />
<ClCompile Include="src\utils.cpp" />
+ <ClCompile Include="src\windowlist.cpp" />
<ClCompile Include="src\winver.cpp" />
</ItemGroup>
<ItemGroup>
diff --git a/src/mir_core/mir_core_10.vcxproj.filters b/src/mir_core/mir_core_10.vcxproj.filters
index 7160a06293..f65ee2856e 100644
--- a/src/mir_core/mir_core_10.vcxproj.filters
+++ b/src/mir_core/mir_core_10.vcxproj.filters
@@ -115,6 +115,9 @@
<ClCompile Include="src\bitmaps.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\windowlist.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\commonheaders.h">
diff --git a/src/mir_core/mir_core_12.vcxproj b/src/mir_core/mir_core_12.vcxproj
index a83072c7fd..ab2cb013e5 100644
--- a/src/mir_core/mir_core_12.vcxproj
+++ b/src/mir_core/mir_core_12.vcxproj
@@ -96,6 +96,7 @@
<ClCompile Include="src\ui_utils.cpp" />
<ClCompile Include="src\utf.cpp" />
<ClCompile Include="src\utils.cpp" />
+ <ClCompile Include="src\windowlist.cpp" />
<ClCompile Include="src\winver.cpp" />
</ItemGroup>
<ItemGroup>
diff --git a/src/mir_core/mir_core_12.vcxproj.filters b/src/mir_core/mir_core_12.vcxproj.filters
index ec0939a562..d320dd8ba4 100644
--- a/src/mir_core/mir_core_12.vcxproj.filters
+++ b/src/mir_core/mir_core_12.vcxproj.filters
@@ -115,6 +115,9 @@
<ClCompile Include="src\bitmaps.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\windowlist.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\m_core.h">
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index f2decbe158..6c1c107d7f 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1238,3 +1238,10 @@ Bitmap_GetFilter @1248
Bitmap_Load @1249
CreateProtoServiceFunction @1250
?SetSilent@CCtrlBase@@QAEXXZ @1251 NONAME
+WindowList_Add @1252
+WindowList_Broadcast @1253
+WindowList_BroadcastAsync @1254
+WindowList_Create @1255
+WindowList_Destroy @1256
+WindowList_Find @1257
+WindowList_Remove @1258
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 3a15379fcd..9fc7449fee 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1238,3 +1238,10 @@ Bitmap_GetFilter @1248
Bitmap_Load @1249
CreateProtoServiceFunction @1250
?SetSilent@CCtrlBase@@QEAAXXZ @1251 NONAME
+WindowList_Add @1252
+WindowList_Broadcast @1253
+WindowList_BroadcastAsync @1254
+WindowList_Create @1255
+WindowList_Destroy @1256
+WindowList_Find @1257
+WindowList_Remove @1258
diff --git a/src/mir_core/src/windowlist.cpp b/src/mir_core/src/windowlist.cpp
new file mode 100644
index 0000000000..425db3f2db
--- /dev/null
+++ b/src/mir_core/src/windowlist.cpp
@@ -0,0 +1,104 @@
+/*
+
+Miranda NG: the free IM client for Microsoft* Windows*
+
+Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "commonheaders.h"
+
+struct TWindowListItem
+{
+ TWindowListItem(MCONTACT _contact, HWND _wnd) :
+ hContact(_contact),
+ hWnd(_wnd)
+ {}
+
+ MCONTACT hContact;
+ HWND hWnd;
+};
+
+struct TWindowList : public OBJLIST<TWindowListItem>
+{
+ TWindowList() :
+ OBJLIST<TWindowListItem>(10, NumericKeySortT)
+ {}
+};
+
+MIR_CORE_DLL(MWindowList) WindowList_Create(void)
+{
+ return new TWindowList();
+}
+
+MIR_CORE_DLL(void) WindowList_Destroy(MWindowList hList)
+{
+ delete hList;
+}
+
+MIR_CORE_DLL(int) WindowList_Add(MWindowList hList, HWND hwnd, MCONTACT hContact)
+{
+ if (hList == NULL)
+ return 1;
+
+ hList->insert(new TWindowListItem(hContact, hwnd));
+ return 0;
+}
+
+MIR_CORE_DLL(int) WindowList_Remove(MWindowList hList, HWND hwnd)
+{
+ if (hList == NULL) return 1;
+
+ for (int i = 0; i < hList->getCount(); i++) {
+ if ((*hList)[i].hWnd == hwnd) {
+ hList->remove(i);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+MIR_CORE_DLL(HWND) WindowList_Find(MWindowList hList, MCONTACT hContact)
+{
+ if (hList == NULL)
+ return NULL;
+
+ TWindowListItem *p = hList->find((TWindowListItem*)&hContact);
+ return (p == NULL) ? NULL : p->hWnd;
+}
+
+MIR_CORE_DLL(int) WindowList_Broadcast(MWindowList hList, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ if (hList == NULL)
+ return NULL;
+
+ for (int i = hList->getCount()-1; i >= 0; i--)
+ SendMessage((*hList)[i].hWnd, message, wParam, lParam);
+ return 0;
+}
+
+MIR_CORE_DLL(int) WindowList_BroadcastAsync(MWindowList hList, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ if (hList == NULL)
+ return NULL;
+
+ for (int i = hList->getCount()-1; i >= 0; i--)
+ PostMessage((*hList)[i].hWnd, message, wParam, lParam);
+ return 0;
+}