From 0f8566dd046d34ea0ff6b747f7383ffb17f6761e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 14 Jun 2015 21:33:38 +0000 Subject: WindowList_* functions are not services anymore; unneeded helpers removed git-svn-id: http://svn.miranda-ng.org/main/trunk@14168 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Alarms/src/alarm_win.cpp | 2 +- plugins/Alarms/src/alarm_win.h | 2 +- plugins/AvatarHistory/src/AvatarHistory.cpp | 2 +- plugins/AvatarHistory/src/stdafx.h | 2 +- plugins/BuddyPounce/src/main.cpp | 2 +- plugins/Clist_modern/src/modern_tbbutton.cpp | 2 +- plugins/Clist_nicer/src/clistmenus.cpp | 2 +- plugins/ContactsPlus/src/main.cpp | 24 +++++++++---------- plugins/ContactsPlus/src/receive.cpp | 4 ++-- plugins/ContactsPlus/src/receive.h | 2 +- plugins/ContactsPlus/src/send.cpp | 16 ++++++------- plugins/ContactsPlus/src/send.h | 4 ++-- plugins/ExternalAPI/m_yamn.h | 4 ++-- plugins/FavContacts/src/services.cpp | 2 +- plugins/FileAsMessage/src/main.cpp | 2 +- plugins/FileAsMessage/src/main.h | 2 +- plugins/HistoryLinkListPlus/src/linklist.cpp | 3 +-- plugins/HistoryLinkListPlus/src/linklist_dlg.cpp | 2 +- plugins/HistoryLinkListPlus/src/linklist_fct.cpp | 2 +- plugins/IEHistory/src/IEHistory.cpp | 4 ++-- plugins/IEHistory/src/stdafx.h | 2 +- plugins/Msg_Export/src/Glob.h | 2 +- plugins/Msg_Export/src/main.cpp | 2 +- plugins/NewAwaySysMod/src/Common.h | 2 +- plugins/NewAwaySysMod/src/ContactList.cpp | 2 +- plugins/NewAwaySysMod/src/MsgTree.cpp | 4 ++-- plugins/NewAwaySysMod/src/ReadAwayMsg.cpp | 2 +- plugins/NewsAggregator/Src/Common.h | 3 ++- plugins/NewsAggregator/Src/NewsAggregator.cpp | 2 +- plugins/Popup/src/srmm_menu.cpp | 2 +- plugins/Quotes/src/CurrencyConverter.cpp | 6 ++--- plugins/Quotes/src/ModuleInfo.cpp | 4 ++-- plugins/Quotes/src/ModuleInfo.h | 4 ++-- plugins/Quotes/src/QuoteInfoDlg.cpp | 6 ++--- plugins/Quotes/src/SettingsDlg.cpp | 6 ++--- plugins/RecentContacts/src/RecentContacts.cpp | 2 +- plugins/Scriver/src/globals.h | 4 ++-- plugins/SeenPlugin/src/history.cpp | 2 +- plugins/SeenPlugin/src/main.cpp | 3 ++- plugins/SeenPlugin/src/seen.h | 2 +- plugins/SimpleStatusMsg/src/awaymsg.cpp | 3 +-- plugins/TabSRMM/src/globals.h | 2 +- plugins/TabSRMM/src/mim.h | 2 +- plugins/TabSRMM/src/typingnotify.cpp | 2 +- plugins/TabSRMM/src/userprefs.cpp | 1 - plugins/TabSRMM/src/utils.cpp | 2 +- plugins/TabSRMM/src/utils.h | 2 +- plugins/TrafficCounter/src/TrafficCounter.cpp | 2 +- plugins/TrafficCounter/src/misc.cpp | 2 +- plugins/UserInfoEx/src/dlg_propsheet.cpp | 30 ++++++++++++------------ plugins/Weather/src/weather.cpp | 3 +-- plugins/Weather/src/weather.h | 7 +++--- plugins/Weather/src/weather_icons.cpp | 2 +- plugins/Weather/src/weather_mwin.cpp | 2 +- plugins/WebView/src/main.cpp | 2 +- plugins/WebView/src/webview.h | 3 ++- plugins/WhenWasIt/src/WhenWasIt.cpp | 2 +- plugins/WhenWasIt/src/commonheaders.h | 2 +- plugins/XSoundNotify/src/Common.h | 2 +- plugins/XSoundNotify/src/xsn_main.cpp | 2 +- plugins/YAMN/src/main.cpp | 2 +- 61 files changed, 112 insertions(+), 112 deletions(-) (limited to 'plugins') 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 THandles; + typedef std::map 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 . #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_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_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 -- cgit v1.2.3