From 33953cc6a0fab6a91af293c6838f8a46dd7922da Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 14:42:51 +0000 Subject: HCONTACT, part 3 git-svn-id: http://svn.miranda-ng.org/main/trunk@8081 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdauth/authdialogs.cpp | 14 +++++++------- src/core/stdfile/filerecvdlg.cpp | 6 +++--- src/core/stdmsg/src/msgdialog.cpp | 4 ++-- src/core/stdurl/urldialogs.cpp | 6 ++---- src/modules/addcontact/addcontact.cpp | 20 ++++++++++---------- src/modules/clist/clc.cpp | 26 +++++++++++++------------- src/modules/clist/clcidents.cpp | 24 ++++++++++++------------ src/modules/clist/clcitems.cpp | 6 +++--- src/modules/clist/clcmsgs.cpp | 30 +++++++++++++++--------------- src/modules/clist/clcutils.cpp | 2 +- src/modules/clist/clistevents.cpp | 2 +- src/modules/clist/clistsettings.cpp | 2 +- src/modules/clist/clui.cpp | 6 ++---- src/modules/findadd/searchresults.cpp | 4 +--- 14 files changed, 73 insertions(+), 79 deletions(-) (limited to 'src') diff --git a/src/core/stdauth/authdialogs.cpp b/src/core/stdauth/authdialogs.cpp index 7c367b78d1..d66941dd31 100644 --- a/src/core/stdauth/authdialogs.cpp +++ b/src/core/stdauth/authdialogs.cpp @@ -96,7 +96,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DETAILS), GWLP_USERDATA, (LONG_PTR)hContact); - if (hContact == INVALID_HANDLE_VALUE || !db_get_b(hContact, "CList", "NotOnList", 0)) + if (hContact == (HCONTACT)INVALID_HANDLE_VALUE || !db_get_b(hContact, "CList", "NotOnList", 0)) ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE); } return TRUE; @@ -106,14 +106,14 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case IDC_ADD: { ADDCONTACTSTRUCT acs = {0}; - acs.handle = hDbEvent; + acs.hDbEvent = hDbEvent; acs.handleType = HANDLE_EVENT; acs.szProto = ""; CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs); HCONTACT hContact = (HCONTACT)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DETAILS), GWLP_USERDATA); - if ((hContact == INVALID_HANDLE_VALUE) || !db_get_b(hContact, "CList", "NotOnList", 0)) - ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE); + if ((hContact == (HCONTACT)INVALID_HANDLE_VALUE) || !db_get_b(hContact, "CList", "NotOnList", 0)) + ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE); break; } case IDC_DETAILS: @@ -126,7 +126,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case IDOK: { ADDCONTACTSTRUCT acs = {0}; - acs.handle = hDbEvent; + acs.hDbEvent = hDbEvent; acs.handleType = HANDLE_EVENT; acs.szProto = ""; CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs); @@ -214,7 +214,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemText(hwndDlg, IDC_HEADERBAR, hdr); SetDlgItemText(hwndDlg, IDC_REASON, reasonT); - if (hContact == INVALID_HANDLE_VALUE || !db_get_b(hContact, "CList", "NotOnList", 0)) + if (hContact == (HCONTACT)INVALID_HANDLE_VALUE || !db_get_b(hContact, "CList", "NotOnList", 0)) ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE); SendDlgItemMessage(hwndDlg, IDC_DENYREASON, EM_LIMITTEXT, 255, 0); @@ -250,7 +250,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (IsDlgButtonChecked(hwndDlg, IDC_ADDCHECK)) { ADDCONTACTSTRUCT acs = {0}; - acs.handle = hDbEvent; + acs.hDbEvent = hDbEvent; acs.handleType = HANDLE_EVENT; acs.szProto = ""; CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs); diff --git a/src/core/stdfile/filerecvdlg.cpp b/src/core/stdfile/filerecvdlg.cpp index ca00c0f642..b98aa94ea6 100644 --- a/src/core/stdfile/filerecvdlg.cpp +++ b/src/core/stdfile/filerecvdlg.cpp @@ -395,9 +395,9 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break; case IDC_ADD: - { ADDCONTACTSTRUCT acs = {0}; - - acs.handle = dat->hContact; + { + ADDCONTACTSTRUCT acs = {0}; + acs.hContact = dat->hContact; acs.handleType = HANDLE_CONTACT; acs.szProto = ""; CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs); diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 47b867c439..1861bf13af 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1308,7 +1308,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break; case HM_DBEVENTADDED: - if ((HANDLE)wParam == dat->hContact) { + if ((HCONTACT)wParam == dat->hContact) { HANDLE hDbEvent = (HANDLE)lParam; if (dat->hDbEventFirst == NULL) dat->hDbEventFirst = hDbEvent; @@ -1531,7 +1531,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_ADD: { ADDCONTACTSTRUCT acs = { 0 }; - acs.handle = dat->hContact; + acs.hContact = dat->hContact; acs.handleType = HANDLE_CONTACT; acs.szProto = 0; CallService(MS_ADDCONTACT_SHOW, (WPARAM) hwndDlg, (LPARAM) & acs); diff --git a/src/core/stdurl/urldialogs.cpp b/src/core/stdurl/urldialogs.cpp index a82ef7510c..9a654fa9ff 100644 --- a/src/core/stdurl/urldialogs.cpp +++ b/src/core/stdurl/urldialogs.cpp @@ -212,10 +212,8 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_ADD: { ADDCONTACTSTRUCT acs = {0}; - - acs.handle = dat->hContact; + acs.hContact = dat->hContact; acs.handleType = HANDLE_CONTACT; - acs.szProto = 0; CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs); } if ( !db_get_b(dat->hContact, "CList", "NotOnList", 0)) { @@ -608,7 +606,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_ADD: ADDCONTACTSTRUCT acs = {0}; - acs.handle = dat->hContact; + acs.hContact = dat->hContact; acs.handleType = HANDLE_CONTACT; acs.szProto = 0; CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs); diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index c44183faba..2659705072 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -42,25 +42,25 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = sizeof(DWORD); dbei.pBlob = (PBYTE)&dwUin; - db_event_get(acs->handle, &dbei); + db_event_get(acs->hDbEvent, &dbei); _ltoa(dwUin, szUin, 10); acs->szProto = dbei.szModule; } { TCHAR *szName = NULL, *tmpStr = NULL; if (acs->handleType == HANDLE_CONTACT) - szName = cli.pfnGetContactDisplayName((HCONTACT)acs->handle, GCDNF_TCHAR); + szName = cli.pfnGetContactDisplayName(acs->hContact, GCDNF_TCHAR); else { int isSet = 0; if (acs->handleType == HANDLE_EVENT) { DBEVENTINFO dbei = { sizeof(dbei) }; - dbei.cbBlob = db_event_getBlobSize(acs->handle); + dbei.cbBlob = db_event_getBlobSize(acs->hDbEvent); dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob); - db_event_get(acs->handle, &dbei); + db_event_get(acs->hDbEvent, &dbei); HCONTACT hcontact = *(HCONTACT*)(dbei.pBlob + sizeof(DWORD)); mir_free(dbei.pBlob); - if (hcontact != INVALID_HANDLE_VALUE) { + if (hcontact != (HCONTACT)INVALID_HANDLE_VALUE) { szName = cli.pfnGetContactDisplayName(hcontact, 0); isSet = 1; } @@ -81,9 +81,9 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp } } - if (acs->handleType == HANDLE_CONTACT && acs->handle) + if (acs->handleType == HANDLE_CONTACT && acs->hContact) if (acs->szProto == NULL || (acs->szProto != NULL && *acs->szProto == 0)) - acs->szProto = GetContactProto((HCONTACT)acs->handle); + acs->szProto = GetContactProto(acs->hContact); { TCHAR *grpName; @@ -152,8 +152,8 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp case HANDLE_EVENT: { DBEVENTINFO dbei = { sizeof(dbei) }; - db_event_get(acs->handle, &dbei); - hContact = (HCONTACT)CallProtoServiceInt(NULL, dbei.szModule, PS_ADDTOLISTBYEVENT, 0, (LPARAM)acs->handle); + db_event_get(acs->hDbEvent, &dbei); + hContact = (HCONTACT)CallProtoServiceInt(NULL, dbei.szModule, PS_ADDTOLISTBYEVENT, 0, (LPARAM)acs->hDbEvent); } break; @@ -162,7 +162,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp break; case HANDLE_CONTACT: - hContact = (HCONTACT)acs->handle; + hContact = acs->hContact; break; } diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index c07c11441c..f087f87039 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -397,7 +397,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, TCHAR szFullName[512]; int i, nameLen, eq; //check name of group and ignore message if just being expanded/collapsed - if (cli.pfnFindItem(hwnd, dat, (HCONTACT)(groupId | HCONTACT_ISGROUP), &contact, &group, NULL)) { + if (cli.pfnFindItem(hwnd, dat, (HANDLE)(groupId | HCONTACT_ISGROUP), &contact, &group, NULL)) { lstrcpy(szFullName, contact->szText); while (group->parent) { for (i=0; i < group->parent->cl.count; i++) @@ -459,7 +459,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN) break; if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0) { - if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, NULL, NULL, NULL)) + if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, NULL, NULL, NULL)) break; cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1); cli.pfnNotifyNewContact(hwnd, (HCONTACT)wParam); @@ -475,7 +475,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, { WORD iExtraImage[EXTRA_ICON_COUNT]; BYTE flags = 0; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) memset(iExtraImage, 0xFF, sizeof(iExtraImage)); else { memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage)); @@ -485,7 +485,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HCONTACT)wParam, "CList", "Hidden", 0)) { NMCLISTCONTROL nm; cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1); - if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) { + if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) { memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage)); if (flags & CONTACTF_CHECKED) contact->flags |= CONTACTF_CHECKED; @@ -522,13 +522,13 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, contact = NULL; group = NULL; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) { + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) { if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) { if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1) hSelItem = (HCONTACT)cli.pfnContactToHItem(selcontact); cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, (style & CLS_CONTACTLIST) == 0, 0); recalcScrollBar = 1; - cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL); + cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL); if (contact) { contact->iImage = (WORD) lParam; cli.pfnNotifyNewContact(hwnd, (HCONTACT)wParam); @@ -556,7 +556,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, } if (hSelItem) { ClcGroup *selgroup; - if (cli.pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL)) + if (cli.pfnFindItem(hwnd, dat, (HANDLE)hSelItem, &selcontact, &selgroup, NULL)) dat->selection = cli.pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact)); else dat->selection = -1; @@ -566,7 +566,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_NAMECHANGED: - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) break; lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText)); @@ -575,7 +575,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_PROTOCHANGED: - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) break; contact->proto = GetContactProto((HCONTACT)wParam); @@ -585,7 +585,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_NOTONLISTCHANGED: - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) break; if (contact->type == CLCIT_CONTACT) { @@ -603,7 +603,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_APPARENTMODECHANGED: - if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) { + if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) { char *szProto = GetContactProto((HCONTACT)wParam); if (szProto == NULL) break; @@ -625,7 +625,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_IDLECHANGED: - if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) { + if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) { char *szProto = GetContactProto((HCONTACT)wParam); if (szProto == NULL) break; @@ -890,7 +890,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, it.rcItem.bottom = it.rcItem.top + cli.pfnGetRowHeight(dat, hit); OffsetRect(&it.rcItem, ptClientOffset.x, ptClientOffset.y); it.isGroup = contact->type == CLCIT_GROUP; - it.hItem = contact->type == CLCIT_GROUP ? (HANDLE) contact->groupId : contact->hContact; + it.hItem = (contact->type == CLCIT_GROUP) ? (HANDLE)contact->groupId : (HANDLE)contact->hContact; it.cbSize = sizeof(it); dat->hInfoTipItem = cli.pfnContactToHItem(contact); NotifyEventHooks(hShowInfoTipEvent, 0, (LPARAM) & it); diff --git a/src/modules/clist/clcidents.cpp b/src/modules/clist/clcidents.cpp index 5ec0b48600..7165d61b48 100644 --- a/src/modules/clist/clcidents.cpp +++ b/src/modules/clist/clcidents.cpp @@ -96,12 +96,12 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contac } if (nowVisible) index++; - if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP - && ((unsigned) hItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || (IsHContactContact(hItem) - && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT - && group->cl.items[group->scanIndex]->hContact == hItem) || (IsHContactInfo(hItem) - && group->cl.items[group->scanIndex]->type == CLCIT_INFO - && group->cl.items[group->scanIndex]->hContact == (HANDLE) ((UINT_PTR)hItem & ~HCONTACT_ISINFO))) + if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && + ((unsigned) hItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || (IsHContactContact(hItem) && + group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && + group->cl.items[group->scanIndex]->hContact == (HCONTACT)hItem) || (IsHContactInfo(hItem) && + group->cl.items[group->scanIndex]->type == CLCIT_INFO && + group->cl.items[group->scanIndex]->hContact == (HCONTACT)((UINT_PTR)hItem & ~HCONTACT_ISINFO))) { if (isVisible) { if (!nowVisible) @@ -180,11 +180,11 @@ HANDLE fnContactToHItem(ClcContact *contact) { switch (contact->type) { case CLCIT_CONTACT: - return contact->hContact; + return (HANDLE)contact->hContact; case CLCIT_GROUP: - return (HCONTACT)(contact->groupId | HCONTACT_ISGROUP); + return (HANDLE)(contact->groupId | HCONTACT_ISGROUP); case CLCIT_INFO: - return (HCONTACT)((UINT_PTR)contact->hContact | HCONTACT_ISINFO); + return (HANDLE)((UINT_PTR)contact->hContact | HCONTACT_ISINFO); } return NULL; } @@ -193,15 +193,15 @@ HANDLE fnContactToItemHandle(ClcContact *contact, DWORD *nmFlags) { switch (contact->type) { case CLCIT_CONTACT: - return contact->hContact; + return (HANDLE)contact->hContact; case CLCIT_GROUP: if (nmFlags) *nmFlags |= CLNF_ISGROUP; - return (HCONTACT)contact->groupId; + return (HANDLE)contact->groupId; case CLCIT_INFO: if (nmFlags) *nmFlags |= CLNF_ISINFO; - return (HCONTACT)((UINT_PTR)contact->hContact | HCONTACT_ISINFO); + return (HANDLE)((UINT_PTR)contact->hContact | HCONTACT_ISINFO); } return NULL; } diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 0a66b5933e..690de3c4cb 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -316,7 +316,7 @@ void fnDeleteItemFromTree(HWND hwnd, HCONTACT hItem) struct ClcData *dat = (struct ClcData *) GetWindowLongPtr(hwnd, 0); dat->needsResort = 1; - if (!cli.pfnFindItem(hwnd, dat, hItem, &contact, &group, NULL)) { + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)hItem, &contact, &group, NULL)) { DBVARIANT dbv; int i, nameOffset; if (!IsHContactContact(hItem)) @@ -569,7 +569,7 @@ void fnSortCLC(HWND hwnd, struct ClcData *dat, int useInsertionSort) group->scanIndex++; } if (hSelItem) - if (cli.pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL)) + if (cli.pfnFindItem(hwnd, dat, (HANDLE)hSelItem, &selcontact, &selgroup, NULL)) dat->selection = cli.pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact)); cli.pfnRecalcScrollBar(hwnd, dat); @@ -685,7 +685,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) if (saveInfo[i].parentId == -1) group = &dat->list; else { - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)(saveInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)(saveInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) continue; group = contact->group; } diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp index f1cc63ed18..9ce6f5c3a9 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -59,7 +59,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR if (cii->hParentGroup == NULL) group = &dat->list; else { - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)((UINT_PTR)cii->hParentGroup | HCONTACT_ISGROUP), &groupContact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)((UINT_PTR)cii->hParentGroup | HCONTACT_ISGROUP), &groupContact, NULL, NULL)) return NULL; group = groupContact->group; } @@ -97,7 +97,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR { ClcContact *contact; ClcGroup *group, *tgroup; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) break; for (tgroup = group; tgroup; tgroup = tgroup->parent) cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1); @@ -108,7 +108,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_EXPAND: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) break; if (contact->type != CLCIT_GROUP) break; @@ -117,12 +117,12 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR } case CLM_FINDCONTACT: - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, NULL, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, NULL, NULL, NULL)) return NULL; return wParam; case CLM_FINDGROUP: - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)(wParam | HCONTACT_ISGROUP), NULL, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)(wParam | HCONTACT_ISGROUP), NULL, NULL, NULL)) return NULL; return wParam | HCONTACT_ISGROUP; @@ -132,7 +132,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETCHECKMARK: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) return 0; return (contact->flags & CONTACTF_CHECKED) != 0; } @@ -146,7 +146,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETEXPAND: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) return CLE_INVALID; if (contact->type != CLCIT_GROUP) return CLE_INVALID; @@ -164,7 +164,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETEXTRAIMAGE: if (LOWORD(lParam) < dat->extraColumnsCount) { ClcContact *contact; - if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) return contact->iExtraImage[LOWORD(lParam)]; } return EMPTY_EXTRA_ICON; @@ -190,7 +190,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETITEMTEXT: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) return 0; lstrcpy((TCHAR*) lParam, contact->szText); return lstrlen(contact->szText); @@ -199,7 +199,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETITEMTYPE: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) return CLCIT_INVALID; return contact->type; } @@ -217,7 +217,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR ClcContact *contact; ClcGroup *group; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)lParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)lParam, &contact, &group, NULL)) return NULL; int i = List_IndexOf((SortedList*)&group->cl, contact); @@ -320,7 +320,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR { ClcContact *contact; ClcGroup *group, *tgroup; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) break; for (tgroup = group; tgroup; tgroup = tgroup->parent) cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1); @@ -353,7 +353,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETCHECKMARK: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) return 0; if (lParam) contact->flags |= CONTACTF_CHECKED; @@ -375,7 +375,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETEXTRAIMAGE: if ( LOWORD(lParam) < dat->extraColumnsCount) { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) return 0; contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam); @@ -433,7 +433,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETITEMTEXT: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) break; lstrcpyn(contact->szText, (TCHAR*)lParam, SIZEOF(contact->szText)); cli.pfnSortCLC(hwnd, dat, 1); diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index 49946868c7..d5cb14fdbf 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -640,7 +640,7 @@ void fnNotifyNewContact(HWND hwnd, HCONTACT hContact) nm.hdr.hwndFrom = hwnd; nm.hdr.idFrom = GetDlgCtrlID(hwnd); nm.flags = 0; - nm.hItem = hContact; + nm.hItem = (HANDLE)hContact; SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM) & nm); } diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index 2347021133..4acefdf247 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -259,7 +259,7 @@ int fnRemoveEvent(HCONTACT hContact, HANDLE dbEvent) CLISTEVENT* fnGetEvent(HCONTACT hContact, int idx) { - if (hContact == INVALID_HANDLE_VALUE) { + if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) { if (idx >= cli.events.count) return NULL; return &cli.events.items[idx]->cle; diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index bf11aa6e95..7e23fb67bc 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.cpp @@ -104,7 +104,7 @@ ClcCacheEntry* fnGetCacheEntry(HCONTACT hContact) void fnInvalidateDisplayNameCacheEntry(HCONTACT hContact) { - if (hContact == INVALID_HANDLE_VALUE) { + if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) { FreeDisplayNameCache(); InitDisplayNameCache(); SendMessage(cli.hwndContactTree, CLM_AUTOREBUILD, 0, 0); diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index ce1996d89e..4683169736 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -222,12 +222,10 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) static INT_PTR MenuItem_AddContactToList(WPARAM wParam, LPARAM) { ADDCONTACTSTRUCT acs = { 0 }; - - acs.handle = (HANDLE)wParam; + acs.hContact = (HCONTACT)wParam; acs.handleType = HANDLE_CONTACT; acs.szProto = ""; - - CallService(MS_ADDCONTACT_SHOW, (WPARAM) NULL, (LPARAM) & acs); + CallService(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs); return 0; } diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index d3f32ea6d5..726ce32bcd 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -368,9 +368,7 @@ void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y) switch(commandId) { case IDC_ADD: { - ADDCONTACTSTRUCT acs; - - acs.handle = NULL; + ADDCONTACTSTRUCT acs = { 0 }; acs.handleType = HANDLE_SEARCHRESULT; acs.szProto = lsr->szProto; acs.psr = &lsr->psr; -- cgit v1.2.3