From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ContactsPlus/src/main.cpp | 14 ++++++------- plugins/ContactsPlus/src/receive.cpp | 10 ++++----- plugins/ContactsPlus/src/receive.h | 4 ++-- plugins/ContactsPlus/src/send.cpp | 40 ++++++++++++++++++------------------ plugins/ContactsPlus/src/send.h | 16 +++++++-------- plugins/ContactsPlus/src/utils.cpp | 12 +++++------ plugins/ContactsPlus/src/utils.h | 12 +++++------ 7 files changed, 54 insertions(+), 54 deletions(-) (limited to 'plugins/ContactsPlus/src') diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 5d42d3db9c..87da26fa8e 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -59,7 +59,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) static int HookDBEventAdded(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; HANDLE hDbEvent = (HANDLE)lParam; //process the event DBEVENTINFO dbe = { sizeof(dbe) }; @@ -92,7 +92,7 @@ static int HookDBEventAdded(WPARAM wParam, LPARAM lParam) static void ProcessUnreadEvents(void) { - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; @@ -117,7 +117,7 @@ static bool CheckContactsServiceSupport(const char* szProto) static int HookPreBuildContactMenu(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; char *szProto = GetContactProto(hContact); int bVisible = FALSE; @@ -156,7 +156,7 @@ static int HookModulesLoaded(WPARAM wParam, LPARAM lParam) static int HookContactSettingChanged(WPARAM wParam, LPARAM lParam) { DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; - char *szProto = GetContactProto((HCONTACT)wParam); + char *szProto = GetContactProto((MCONTACT)wParam); if (strcmpnull(cws->szModule, "CList") && strcmpnull(cws->szModule, szProto)) return 0; @@ -167,13 +167,13 @@ static int HookContactSettingChanged(WPARAM wParam, LPARAM lParam) static int HookContactDeleted(WPARAM wParam, LPARAM lParam) { // if our contact gets deleted close his window - HWND h = WindowList_Find(ghSendWindowList, (HCONTACT)wParam); + HWND h = WindowList_Find(ghSendWindowList, (MCONTACT)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, (HCONTACT)wParam)) + while (h = WindowList_Find(ghRecvWindowList, (MCONTACT)wParam)) SendMessage(h, WM_CLOSE, 0, 0); return 0; } @@ -181,7 +181,7 @@ static int HookContactDeleted(WPARAM wParam, LPARAM lParam) static INT_PTR ServiceSendCommand(WPARAM wParam, LPARAM lParam) { //find window for hContact - HWND hWnd = WindowList_Find(ghSendWindowList, (HCONTACT)wParam); + HWND hWnd = WindowList_Find(ghSendWindowList, (MCONTACT)wParam); if (!hWnd) CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEND), NULL, SendDlgProc, wParam); else { diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 02c219edba..6b79314c20 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -25,7 +25,7 @@ /* TRecvContactsData */ -TRecvContactsData::TRecvContactsData(HCONTACT contact) +TRecvContactsData::TRecvContactsData(MCONTACT contact) { mhContact = contact; hHook = NULL; @@ -136,7 +136,7 @@ static void RebuildGroupCombo(HWND hwndDlg) } } -static HCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wndData, int iItem) +static MCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wndData, int iItem) { TCHAR *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0); char *szProto = GetContactProto(wndData->mhContact); @@ -144,7 +144,7 @@ static HCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *w replaceStrT(wndData->haUin, caUIN); for (int j = 0; j < wndData->cbReceived; j++) if (!lstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) - return (HCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(PALF_TEMPORARY, j), (LPARAM)wndData->mhDbEvent); + return (MCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(PALF_TEMPORARY, j), (LPARAM)wndData->mhDbEvent); return NULL; } @@ -162,7 +162,7 @@ void RecvListView_AddColumn(HWND hList, int nWidth, TCHAR *szTitle, int nItem) INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { TRecvContactsData *wndData = (TRecvContactsData*)GetWindowLongPtr(hwndDlg, DWLP_USER); - HCONTACT hContact; + MCONTACT hContact; switch (msg) { case WM_INITDIALOG: @@ -317,7 +317,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara for (int j = 0; j < wndData->cbReceived; j++) // determine item index in packet if (!lstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) { char *szProto =GetContactProto(wndData->mhContact); - hContact = (HCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(0, j), (LPARAM)wndData->mhDbEvent); + hContact = (MCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(0, j), (LPARAM)wndData->mhDbEvent); if (hContact && caGroup) { // use newest group API if available if (ServiceExists(MS_CLIST_CONTACTCHANGEGROUP)) diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h index 1ad8eed542..3f67906930 100644 --- a/plugins/ContactsPlus/src/receive.h +++ b/plugins/ContactsPlus/src/receive.h @@ -43,11 +43,11 @@ struct TReceivedItem { struct TRecvContactsData { - TRecvContactsData(HCONTACT contact); + TRecvContactsData(MCONTACT contact); ~TRecvContactsData(); HANDLE mhDbEvent; // handle to recv DB event - HCONTACT mhContact; // from whom we received this + MCONTACT mhContact; // from whom we received this HIMAGELIST mhListIcon;// icons for listview HMENU mhPopup; // popup menu for listview HANDLE hHook; // hook to event diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index d0a2c511a3..a988481b6b 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -60,7 +60,7 @@ void TSendProcessList::Remove(HANDLE hProcc) /* TSendContactsData */ -TSendContactsData::TSendContactsData(HCONTACT contact) : uacklist() +TSendContactsData::TSendContactsData(MCONTACT contact) : uacklist() { hContact = contact; hHook = NULL; @@ -107,14 +107,14 @@ void TSendContactsData::ClearContacts() nContacts = 0; } -void TSendContactsData::AddContact(HCONTACT hContact) +void TSendContactsData::AddContact(MCONTACT hContact) { - aContacts = (HCONTACT*)mir_realloc(aContacts, (nContacts + 1)*sizeof(HCONTACT)); + aContacts = (MCONTACT*)mir_realloc(aContacts, (nContacts + 1)*sizeof(MCONTACT)); aContacts[nContacts] = hContact; nContacts++; } -int TSendContactsData::SendContactsPacket(HWND hwndDlg, HCONTACT *phContacts, int nContacts) +int TSendContactsData::SendContactsPacket(HWND hwndDlg, MCONTACT *phContacts, int nContacts) { HANDLE hProcc = (HANDLE)CallContactService(hContact, PSS_CONTACTS, MAKEWPARAM(0, nContacts), (LPARAM)phContacts); if (!hProcc) { @@ -126,8 +126,8 @@ int TSendContactsData::SendContactsPacket(HWND hwndDlg, HCONTACT *phContacts, in TAckData *ackData = gaAckData.Add(hProcc, new TAckData(hContact)); uacklist.Add(hProcc); ackData->nContacts = nContacts; - ackData->aContacts = (HCONTACT*)mir_alloc(nContacts*sizeof(HCONTACT)); - memmove(ackData->aContacts, phContacts, nContacts*sizeof(HCONTACT)); // copy the array of hContact for ack array + ackData->aContacts = (MCONTACT*)mir_alloc(nContacts*sizeof(MCONTACT)); + memmove(ackData->aContacts, phContacts, nContacts*sizeof(MCONTACT)); // copy the array of hContact for ack array EnableDlgItem(hwndDlg, IDOK, FALSE); EnableDlgItem(hwndDlg, IDC_LIST, FALSE); return TRUE; // Success @@ -179,12 +179,12 @@ static void ResetListOptions(HWND hwndList) } } -static HCONTACT FindNextClistContact(HWND hList, HCONTACT hContact, HCONTACT *phItem) +static MCONTACT FindNextClistContact(HWND hList, MCONTACT hContact, MCONTACT *phItem) { - HCONTACT hNextContact = db_find_next(hContact); - HCONTACT hNextItem = NULL; + MCONTACT hNextContact = db_find_next(hContact); + MCONTACT hNextItem = NULL; - while (hNextContact && !(hNextItem = (HCONTACT)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hNextContact, 0))) + while (hNextContact && !(hNextItem = (MCONTACT)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hNextContact, 0))) hNextContact = db_find_next(hNextContact); if (phItem) @@ -194,10 +194,10 @@ static HCONTACT FindNextClistContact(HWND hList, HCONTACT hContact, HCONTACT *ph } -static HCONTACT FindFirstClistContact(HWND hList, HCONTACT *phItem) +static MCONTACT FindFirstClistContact(HWND hList, MCONTACT *phItem) { - HCONTACT hContact = db_find_first(); - HCONTACT hItem = (HCONTACT)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hContact, 0); + MCONTACT hContact = db_find_first(); + MCONTACT hItem = (MCONTACT)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hContact && !hItem) return FindNextClistContact(hList, hContact, phItem); @@ -211,7 +211,7 @@ static HCONTACT FindFirstClistContact(HWND hList, HCONTACT *phItem) bool binListEvent = FALSE; -static void SetAllContactChecks(HWND hwndList, HCONTACT hReceiver) // doubtful name +static void SetAllContactChecks(HWND hwndList, MCONTACT hReceiver) // doubtful name { if (binListEvent) return; @@ -226,7 +226,7 @@ static void SetAllContactChecks(HWND hwndList, HCONTACT hReceiver) // doubtful n else SendMessage(hwndList, CLM_SETHIDEEMPTYGROUPS, (WPARAM)FALSE, 0); - HCONTACT hItem, hContact = FindFirstClistContact(hwndList, &hItem); + MCONTACT hItem, hContact = FindFirstClistContact(hwndList, &hItem); while (hContact) { char* szProto2 = GetContactProto(hContact); @@ -251,9 +251,9 @@ 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))); ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST)); - SetAllContactChecks(GetDlgItem(hwndDlg, IDC_LIST), (HCONTACT)lParam); - WindowList_Add(ghSendWindowList, hwndDlg, (HCONTACT)lParam); - wndData = new TSendContactsData((HCONTACT)lParam); + SetAllContactChecks(GetDlgItem(hwndDlg, IDC_LIST), (MCONTACT)lParam); + WindowList_Add(ghSendWindowList, hwndDlg, (MCONTACT)lParam); + wndData = new TSendContactsData((MCONTACT)lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG)wndData); // new dlg init wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, MAKEINTRESOURCEA(IDI_ADDCONTACT), LPGEN("Add Contact Permanently to List")); @@ -342,7 +342,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara switch (LOWORD(wParam)) { case IDOK: if (IsWindowEnabled(GetDlgItem(hwndDlg, IDOK))) { - HCONTACT hContact, hItem; + MCONTACT hContact, hItem; wndData->ClearContacts(); // do not include contacts twice HWND hList = GetDlgItem(hwndDlg, IDC_LIST); @@ -370,7 +370,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara { // select all contacts HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST); - HCONTACT hItem, hContact = FindFirstClistContact(hwndList, &hItem); + MCONTACT hItem, hContact = FindFirstClistContact(hwndList, &hItem); while (hContact) { SendMessage(hwndList, CLM_SETCHECKMARK, (WPARAM)hItem, 1); hContact = FindNextClistContact(hwndList, hContact, &hItem); diff --git a/plugins/ContactsPlus/src/send.h b/plugins/ContactsPlus/src/send.h index 8a8c1250ed..9b6f7b61a2 100644 --- a/plugins/ContactsPlus/src/send.h +++ b/plugins/ContactsPlus/src/send.h @@ -53,27 +53,27 @@ struct TSendContactsData { // hope uack is released automaticly, static propert HANDLE hHook; // hook to event void HookProtoAck(HWND hwndDlg); void UnhookProtoAck(); - HCONTACT *aContacts; // contacts to be sent + MCONTACT *aContacts; // contacts to be sent int nContacts; // now many UIDs shall we send? void ClearContacts(); - void AddContact(HCONTACT hContact); - HCONTACT hContact; // to whom shall we send? + void AddContact(MCONTACT hContact); + MCONTACT hContact; // to whom shall we send? TSendProcessList uacklist;// ackdata - necessary for errorbox HWND hError; // handle of error box, if any void ShowErrorDlg(HWND hwndDlg, char* szMsg, bool bAllowRetry); - int SendContactsPacket(HWND hwndDlg, HCONTACT *phContacts, int nContacts); + int SendContactsPacket(HWND hwndDlg, MCONTACT *phContacts, int nContacts); int SendContacts(HWND hwndDlg); HICON hIcons[4]; // icons for dialog - TSendContactsData(HCONTACT contact); + TSendContactsData(MCONTACT contact); ~TSendContactsData(); }; struct TAckData { - HCONTACT hContact; // to whom was it sent - HCONTACT* aContacts; // obj + MCONTACT hContact; // to whom was it sent + MCONTACT* aContacts; // obj int nContacts; // how many - TAckData(HCONTACT contact) { hContact = contact; aContacts = NULL; nContacts = 0;}; + TAckData(MCONTACT contact) { hContact = contact; aContacts = NULL; nContacts = 0;}; ~TAckData() { mir_free(aContacts); } }; diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index 523c6ad055..546468bd20 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -55,7 +55,7 @@ char* __fastcall null_strdup(const char *string) return NULL; } -TCHAR* GetContactUID(HCONTACT hContact) +TCHAR* GetContactUID(MCONTACT hContact) { char *szProto = GetContactProto(hContact); char *uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); @@ -87,7 +87,7 @@ TCHAR* GetContactUID(HCONTACT hContact) return NULL; } -void DialogAddContactExecute(HWND hwndDlg, HCONTACT hNewContact) +void DialogAddContactExecute(HWND hwndDlg, MCONTACT hNewContact) { ADDCONTACTSTRUCT acs = { 0 }; acs.hContact = hNewContact; @@ -96,7 +96,7 @@ void DialogAddContactExecute(HWND hwndDlg, HCONTACT hNewContact) } -void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HCONTACT hContact) +void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact) { LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam; @@ -112,7 +112,7 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HCONTACT hContact) } -void UpdateDialogTitle(HWND hwndDlg, HCONTACT hContact, TCHAR *pszTitleStart) +void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart) { TCHAR newtitle[512]; lstrcpyn(newtitle, TranslateTS(pszTitleStart), SIZEOF(newtitle)); @@ -138,7 +138,7 @@ void UpdateDialogTitle(HWND hwndDlg, HCONTACT hContact, TCHAR *pszTitleStart) } -void UpdateDialogAddButton(HWND hwndDlg, HCONTACT hContact) +void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact) { int bVisible = db_get_b(hContact, "CList", "NotOnList", 0); ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), bVisible ? SW_SHOW : SW_HIDE); @@ -157,7 +157,7 @@ HICON InitMButton(HWND hDlg, int idButton, LPCSTR szIcon, char *szTip) } -HICON LoadContactProtoIcon(HCONTACT hContact) +HICON LoadContactProtoIcon(MCONTACT hContact) { char *szProto = GetContactProto(hContact); if (szProto) diff --git a/plugins/ContactsPlus/src/utils.h b/plugins/ContactsPlus/src/utils.h index d62bee86ae..f0337c3dab 100644 --- a/plugins/ContactsPlus/src/utils.h +++ b/plugins/ContactsPlus/src/utils.h @@ -32,17 +32,17 @@ int __fastcall strcmpnull(const char *str1, const char *str2); void __fastcall strcpynull(char *str1, const char *str2); char* __fastcall null_strdup(const char *string); -TCHAR* GetContactUID(HCONTACT hContact); +TCHAR* GetContactUID(MCONTACT hContact); -void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HCONTACT hContact); -void UpdateDialogTitle(HWND hwndDlg, HCONTACT hContact, TCHAR *pszTitleStart); -void UpdateDialogAddButton(HWND hwndDlg, HCONTACT hContact); +void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact); +void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart); +void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact); HICON InitMButton(HWND hDlg, int idButton, LPCSTR szIcon, char* szTip); -void DialogAddContactExecute(HWND hwndDlg, HCONTACT hNewContact); +void DialogAddContactExecute(HWND hwndDlg, MCONTACT hNewContact); -HICON LoadContactProtoIcon(HCONTACT hContact); +HICON LoadContactProtoIcon(MCONTACT hContact); void EnableDlgItem(HWND hwndDlg, UINT control, int state); -- cgit v1.2.3