From 0769aa40dd28fd616de393c6f14b85f762e515c2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 11 Feb 2014 19:30:58 +0000 Subject: shameful death of another 'HANDLE' git-svn-id: http://svn.miranda-ng.org/main/trunk@8103 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_clistint.inc | 17 +++++---- include/m_clistint.h | 8 ++--- plugins/Clist_modern/src/hdr/modern_clc.h | 2 +- .../Clist_modern/src/hdr/modern_commonprototypes.h | 2 +- plugins/Clist_modern/src/modern_clc.cpp | 10 +++--- plugins/Clist_modern/src/modern_clcidents.cpp | 19 +++++----- plugins/Clist_modern/src/modern_clcitems.cpp | 4 +-- plugins/Clist_modern/src/modern_clcmsgs.cpp | 6 ++-- plugins/Clist_mw/src/clc.cpp | 8 ++--- plugins/Clist_mw/src/clc.h | 2 +- plugins/Clist_mw/src/clcidents.cpp | 16 ++++----- plugins/Clist_mw/src/clcitems.cpp | 6 ++-- plugins/Clist_nicer/src/clc.cpp | 6 ++-- src/modules/clist/clc.cpp | 24 ++++++------- src/modules/clist/clc.h | 2 +- src/modules/clist/clcidents.cpp | 41 ++++++++++++---------- src/modules/clist/clcitems.cpp | 6 ++-- src/modules/clist/clcmsgs.cpp | 32 ++++++++--------- 18 files changed, 105 insertions(+), 106 deletions(-) diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index 61d4d48e4c..dd50b18885 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -1,20 +1,20 @@ { Miranda IM: the free IM client for Microsoft* Windows* - + Copyright 2000-2008 Miranda ICQ/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. @@ -197,7 +197,7 @@ type needsResort :int; filterSearch :int; end; - + PtrayIconInfo_t = ^trayIconInfo_t; trayIconInfo_t = record id : int; @@ -328,9 +328,8 @@ type (* clcidents.c *) pfnGetRowsPriorTo : function (var group:ClcGroup; var subgroup:ClcGroup; contactIndex:int):int; cdecl; - pfnFindItem : function (hwnd:HWND; var dat:ClcData; hItem:THANDLE; - var contact:PClcContact; var subgroup:PClcGroup; - var isVisible:int):int; cdecl; + pfnFindItem : function (hwnd:HWND; var dat:ClcData; dwItem:DWORD; + var contact:PClcContact; var subgroup:PClcGroup; var isVisible:int):int; cdecl; pfnGetRowByIndex : function (var dat:ClcData; testindex:int; var contact:PClcContact; var subgroup:PClcGroup):int; cdecl; pfnContactToHItem : function (var contact:ClcContact):THANDLE;cdecl; @@ -431,7 +430,7 @@ type pfnContactListWndProc:function(hwnd:HWND; msg:uint; wParam:WPARAM; lParam:LPARAM):int; stdcall; pfnCluiProtocolStatusChanged : procedure (status:int; szProto:PAnsiChar); cdecl; - pfnDrawMenuItem : procedure (_para1:PDRAWITEMSTRUCT; _para2:HICON; + pfnDrawMenuItem : procedure (_para1:PDRAWITEMSTRUCT; _para2:HICON; _para3:HICON); cdecl; pfnLoadCluiGlobalOpts : procedure ; cdecl; pfnInvalidateRect : function (hwnd:HWND; var lpRect:TRECT; bErase:BOOL):BOOL; cdecl; diff --git a/include/m_clistint.h b/include/m_clistint.h index f959efef13..307d7fd0f2 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -33,9 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define HCONTACT_ISGROUP 0x80000000 #define HCONTACT_ISINFO 0xFFFF0000 -#define IsHContactGroup(h) (((UINT_PTR)(h)^HCONTACT_ISGROUP)<(HCONTACT_ISGROUP^HCONTACT_ISINFO)) -#define IsHContactInfo(h) (((UINT_PTR)(h)&HCONTACT_ISINFO) == HCONTACT_ISINFO) -#define IsHContactContact(h) (((UINT_PTR)(h)&HCONTACT_ISGROUP) == 0) +#define IsHContactGroup(h) (((DWORD)(h)^HCONTACT_ISGROUP)<(HCONTACT_ISGROUP^HCONTACT_ISINFO)) +#define IsHContactInfo(h) (((DWORD)(h)&HCONTACT_ISINFO) == HCONTACT_ISINFO) +#define IsHContactContact(h) (((DWORD)(h)&HCONTACT_ISGROUP) == 0) #ifndef EXTRA_ICON_COUNT #define EXTRA_ICON_COUNT 10 @@ -275,7 +275,7 @@ typedef struct /* clcidents.c */ int (*pfnGetRowsPriorTo)(ClcGroup *group, ClcGroup *subgroup, int contactIndex); - int (*pfnFindItem)(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible); + int (*pfnFindItem)(HWND hwnd, struct ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible); int (*pfnGetRowByIndex)(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup); HANDLE (*pfnContactToHItem)(ClcContact *contact); HANDLE (*pfnContactToItemHandle)(ClcContact *contact, DWORD *nmFlags); diff --git a/plugins/Clist_modern/src/hdr/modern_clc.h b/plugins/Clist_modern/src/hdr/modern_clc.h index c9cc59fd75..e84b1f1779 100644 --- a/plugins/Clist_modern/src/hdr/modern_clc.h +++ b/plugins/Clist_modern/src/hdr/modern_clc.h @@ -396,7 +396,7 @@ void ClcOptionsChanged(void); //clcidents.c int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex); -int FindItem(HWND hwnd, ClcData *dat, MCONTACT hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts); +int FindItem(HWND hwnd, ClcData *dat, DWORD hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts); int cliGetRowByIndex(ClcData *dat,int testindex,ClcContact **contact,ClcGroup **subgroup); HANDLE ContactToHItem(ClcContact *contact); HANDLE ContactToItemHandle(ClcContact *contact,DWORD *nmFlags); diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index 4d2c7d4cb7..65b08b6443 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -297,7 +297,7 @@ LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wPara int cliShowHide(WPARAM wParam, LPARAM lParam); BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase ); int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2); -int cliFindItem(HWND hwnd, ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible); +int cliFindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible); int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount); int cliTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam); void cliCluiProtocolStatusChanged(int status,const char * proto); diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 74817ffe3f..94553b3c8a 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1470,7 +1470,7 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM w BYTE flags = 0; ClcContact *contact; - if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) memset(iExtraImage, 0xFF, sizeof(iExtraImage)); else { memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage)); @@ -1480,7 +1480,7 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b(wParam, "CList", "Hidden", 0)) { NMCLISTCONTROL nm; pcli->pfnAddContactToTree(hwnd, dat, wParam, 1, 1); - if (pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) { + if (pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) { memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage)); if (flags & CONTACTF_CHECKED) contact->flags |= CONTACTF_CHECKED; @@ -1528,14 +1528,14 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP // XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown - if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) { + if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL)) { if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) { if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1) hSelItem = (MCONTACT)pcli->pfnContactToHItem(selcontact); pcli->pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0); recalcScrollBar = 1; needRepaint = TRUE; - pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL); + pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL); if (contact) { contact->iImage = lParam; contact->image_is_special = image_is_special; @@ -1577,7 +1577,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP if (hSelItem) { ClcGroup *selgroup; - if (pcli->pfnFindItem(hwnd, dat, (HANDLE)hSelItem, &selcontact, &selgroup, NULL)) + if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL)) dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf(( SortedList* )&selgroup->cl, selcontact)); else dat->selection = -1; diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index 93c5c3a9eb..e59870b5f3 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -104,12 +104,12 @@ int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex) return -1; } -int cliFindItem(HWND hwnd, ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible) +int cliFindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible) { - return FindItem(hwnd, dat, (MCONTACT)hItem, contact, subgroup, isVisible, FALSE); + return FindItem(hwnd, dat, dwItem, contact, subgroup, isVisible, FALSE); } -int FindItem(HWND hwnd, ClcData *dat, MCONTACT hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts) +int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts) { int index = 0, i; int nowVisible = 1; @@ -138,9 +138,9 @@ int FindItem(HWND hwnd, ClcData *dat, MCONTACT hItem, ClcContact **contact, ClcG continue; } if (nowVisible) index++; - if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && ((UINT_PTR)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 == (MCONTACT)((UINT_PTR)hItem&~HCONTACT_ISINFO))) + if ((IsHContactGroup(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || + (IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == dwItem) || + (IsHContactInfo(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (dwItem & ~HCONTACT_ISINFO))) { if (isVisible) { if (!nowVisible) *isVisible = 0; @@ -161,14 +161,11 @@ int FindItem(HWND hwnd, ClcData *dat, MCONTACT hItem, ClcContact **contact, ClcG return 1; } - if (!isIgnoreSubcontacts && - IsHContactContact(hItem) && - group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && - group->cl.items[group->scanIndex]->SubAllocated > 0) + if (!isIgnoreSubcontacts && IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->SubAllocated > 0) { for (i=0; i < group->cl.items[group->scanIndex]->SubAllocated; i++) { - if (group->cl.items[group->scanIndex]->subcontacts[i].hContact == hItem) + if (group->cl.items[group->scanIndex]->subcontacts[i].hContact == dwItem) { #ifdef _DEBUG if (IsBadWritePtr(&group->cl.items[group->scanIndex]->subcontacts[i], sizeof(ClcContact))) diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 782ac49787..66c970a140 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -314,7 +314,7 @@ int RestoreSelection(ClcData *dat, MCONTACT hSelected) ClcContact *selcontact = NULL; ClcGroup *selgroup = NULL; - if (!hSelected || !pcli->pfnFindItem(dat->hWnd, dat, (HANDLE)hSelected, &selcontact, &selgroup, NULL)) { + if (!hSelected || !pcli->pfnFindItem(dat->hWnd, dat, hSelected, &selcontact, &selgroup, NULL)) { dat->selection = -1; return dat->selection; } @@ -579,7 +579,7 @@ void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat) if (savedInfo[i].parentId == -1) group = &dat->list; else { - if (!pcli->pfnFindItem(hwnd, dat, HANDLE(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, savedInfo[i].parentId | HCONTACT_ISGROUP, &contact, NULL, NULL)) continue; group = contact->group; } diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index 910776628d..5a65694d73 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -108,7 +108,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara { int i; if (wParam != CLGN_ROOT) { - if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)lParam, &contact, &group, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL)) return NULL; i = List_IndexOf((SortedList*)&group->cl,contact); if (i < 0) return 0; @@ -183,7 +183,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara ClcGroup *tgroup; int index = -1; int mainindex = -1; - if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL)) break; for (tgroup = group; tgroup; tgroup = tgroup->parent) pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1); @@ -217,7 +217,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara if (LOWORD(lParam) >= dat->extraColumnsCount) return 0; - if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) return 0; contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam); diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index a4459348af..e0fe218ebb 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -162,14 +162,14 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L ClcContact *contact; ClcGroup *group; - if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) { + if (!FindItem(hwnd, dat, wParam, &contact, &group, NULL)) { if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) { if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1) hSelItem = (MCONTACT)pcli->pfnContactToHItem(selcontact); AddContactToTree(hwnd, dat, wParam, 0, 0); needsResort = 1; recalcScrollBar = 1; - FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL); + FindItem(hwnd, dat, wParam, &contact, NULL, NULL); if (contact) { contact->iImage = (WORD)lParam; pcli->pfnNotifyNewContact(hwnd, wParam); @@ -201,7 +201,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L } } if (hSelItem) { ClcGroup *selgroup; - if ( FindItem(hwnd, dat, (HANDLE)hSelItem,&selcontact,&selgroup,NULL)) + if ( FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL)) dat->selection = GetRowsPriorTo(&dat->list,selgroup,List_IndexOf((SortedList*)&selgroup->cl, selcontact)); else dat->selection = -1; @@ -220,7 +220,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L ClcContact *contact; ClcGroup *group; - if (FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL) && contact != NULL) { + if (FindItem(hwnd, dat, wParam, &contact, &group, NULL) && contact != NULL) { contact->flags &= ~CONTACTF_STATUSMSG; if (!db_get_ts(wParam, "CList", "StatusMsg", &dbv)) { int j; diff --git a/plugins/Clist_mw/src/clc.h b/plugins/Clist_mw/src/clc.h index 841fb25576..efc13fd87d 100644 --- a/plugins/Clist_mw/src/clc.h +++ b/plugins/Clist_mw/src/clc.h @@ -81,7 +81,7 @@ struct ClcData : public ClcDataBase //clcidents.c int GetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex); -int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible); +int FindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible); int GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,ClcGroup **subgroup); void ClearRowByIndexCache(); diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp index 967e13abd3..c74a2d8bfb 100644 --- a/plugins/Clist_mw/src/clcidents.cpp +++ b/plugins/Clist_mw/src/clcidents.cpp @@ -143,7 +143,7 @@ void SetClcContactCacheItem(struct ClcData *dat, MCONTACT hContact, void *contac } } -int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible) +int FindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible) { int index = 0, i; int nowVisible = 1; @@ -151,15 +151,15 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **c group->scanIndex = 0; - if (isVisible == NULL && hItem != NULL && subgroup == NULL && !IsHContactGroup(hItem) && !IsHContactInfo(hItem)) { + if (isVisible == NULL && dwItem != NULL && subgroup == NULL && !IsHContactGroup(dwItem) && !IsHContactInfo(dwItem)) { //try use cache - ClcCacheEntry *cacheEntry = GetCLCFullCacheEntry(dat, (MCONTACT)hItem); + ClcCacheEntry *cacheEntry = GetCLCFullCacheEntry(dat, dwItem); if (cacheEntry != NULL) { if (cacheEntry->ClcContact == NULL) { int *isv = {0}; void *z = {0}; int ret; - ret = FindItem(hwnd,dat,hItem,(struct ClcContact ** )&z,(struct ClcGroup** )&isv,NULL); + ret = FindItem(hwnd,dat,dwItem,(struct ClcContact ** )&z,(struct ClcGroup** )&isv,NULL); if (ret == 0) {return 0;} cacheEntry->ClcContact = (void *)z; } @@ -193,9 +193,9 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **c continue; } if (nowVisible) index++; - if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && ((UINT_PTR)hItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || - (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && (HANDLE)group->cl.items[group->scanIndex]->hContact == hItem) || - (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && (HANDLE)group->cl.items[group->scanIndex]->hContact == (HANDLE)((UINT_PTR)hItem & ~HCONTACT_ISINFO))) + if ((IsHContactGroup(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || + (IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == dwItem) || + (IsHContactInfo(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (dwItem & ~HCONTACT_ISINFO))) { if (isVisible) { if ( !nowVisible) *isVisible = 0; @@ -216,7 +216,7 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **c if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->SubAllocated>0) for (i = 1; i<=group->cl.items[group->scanIndex]->SubAllocated; i++) - if (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->subcontacts[i-1].hContact == (MCONTACT)hItem) { + if (IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->subcontacts[i-1].hContact == dwItem) { if (contact) *contact = &group->cl.items[group->scanIndex]->subcontacts[i-1]; if (subgroup) *subgroup = group; return 1; diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index 93359b6deb..5bccc89885 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -184,7 +184,7 @@ static struct ClcContact* AddContactToGroup(struct ClcData *dat,ClcGroup *group, void AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTotalCount, int checkHideOffline) { - if ( FindItem(hwnd,dat,(HANDLE)hContact,NULL,NULL,NULL) == 1) + if (FindItem(hwnd, dat, hContact, NULL, NULL, NULL) == 1) return; ClcCacheEntry *cacheEntry = GetContactFullCacheEntry(hContact); @@ -283,7 +283,7 @@ void DeleteItemFromTree(HWND hwnd, MCONTACT hItem) ClearRowByIndexCache(); dat->needsResort = 1; - if ( !FindItem(hwnd,dat,(HANDLE)hItem,&contact,&group,NULL)) { + if (!FindItem(hwnd, dat, hItem, &contact, &group, NULL)) { DBVARIANT dbv; int i,nameOffset; if ( !IsHContactContact(hItem)) return; @@ -653,7 +653,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat) for (i = 0;ilist; else { - if (!FindItem(hwnd, dat, (HANDLE)(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) + if (!FindItem(hwnd, dat, savedInfo[i].parentId | HCONTACT_ISGROUP, &contact, NULL, NULL)) continue; group = contact->group; } diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 283f86f11b..9f3f15c3bf 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -364,7 +364,7 @@ LBL_Def: } if (hSelItem) { ClcGroup *selgroup; - if (pcli->pfnFindItem(hwnd, dat, (HANDLE)hSelItem, &selcontact, &selgroup, NULL)) + if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL)) dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)& selgroup->cl, selcontact)); else dat->selection = -1; @@ -378,7 +378,7 @@ LBL_Def: goto LBL_Def; case INTM_METACHANGED: - if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) break; if (contact->bIsMeta && cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) { @@ -388,7 +388,7 @@ LBL_Def: if (contact->pExtra) { TExtraCache *pSub = cfg::getCache(contact->hSubContact, contact->metaProto); ClcContact *subContact; - if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)contact->hSubContact, &subContact, NULL, NULL)) + if (!pcli->pfnFindItem(hwnd, dat, contact->hSubContact, &subContact, NULL, NULL)) break; contact->pExtra->proto_status_item = GetProtocolStatusItem(contact->metaProto); diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index 1064255630..48f0deb219 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, (HANDLE)(groupId | HCONTACT_ISGROUP), &contact, &group, NULL)) { + if (cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, NULL, NULL, NULL)) + if (cli.pfnFindItem(hwnd, dat, wParam, NULL, NULL, NULL)) break; cli.pfnAddContactToTree(hwnd, dat, wParam, 1, 1); cli.pfnNotifyNewContact(hwnd, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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(wParam, "CList", "Hidden", 0)) { NMCLISTCONTROL nm; cli.pfnAddContactToTree(hwnd, dat, wParam, 1, 1); - if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) { + if (cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, &group, NULL)) { + if (!cli.pfnFindItem(hwnd, dat, 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 = (MCONTACT)cli.pfnContactToHItem(selcontact); cli.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0); recalcScrollBar = 1; - cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL); + cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL); if (contact) { contact->iImage = (WORD) lParam; cli.pfnNotifyNewContact(hwnd, wParam); @@ -556,7 +556,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, } if (hSelItem) { ClcGroup *selgroup; - if (cli.pfnFindItem(hwnd, dat, (HANDLE)hSelItem, &selcontact, &selgroup, NULL)) + if (cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) break; lstrcpyn(contact->szText, cli.pfnGetContactDisplayName(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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) break; contact->proto = GetContactProto(wParam); @@ -585,7 +585,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_NOTONLISTCHANGED: - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) { + if (cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) { char *szProto = GetContactProto(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, (HANDLE)wParam, &contact, NULL, NULL)) { + if (cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) { char *szProto = GetContactProto(wParam); if (szProto == NULL) break; diff --git a/src/modules/clist/clc.h b/src/modules/clist/clc.h index 0c1a714fae..179ba84c46 100644 --- a/src/modules/clist/clc.h +++ b/src/modules/clist/clc.h @@ -45,7 +45,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, /* clcidents.c */ int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex); -int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible); +int fnFindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible); int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup); HANDLE fnContactToHItem(ClcContact *contact); HANDLE fnContactToItemHandle(ClcContact *contact, DWORD *nmFlags); diff --git a/src/modules/clist/clcidents.cpp b/src/modules/clist/clcidents.cpp index 40584a910d..d4ea6804f9 100644 --- a/src/modules/clist/clcidents.cpp +++ b/src/modules/clist/clcidents.cpp @@ -58,11 +58,13 @@ int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex) if (group == subgroup && contactIndex == group->scanIndex) return count; count++; - if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { - if (group->cl.items[group->scanIndex]->group == subgroup && contactIndex == -1) + + ClcContact *cc = group->cl.items[group->scanIndex]; + if (cc->type == CLCIT_GROUP) { + if (cc->group == subgroup && contactIndex == -1) return count - 1; - if (group->cl.items[group->scanIndex]->group->expanded) { - group = group->cl.items[group->scanIndex]->group; + if (cc->group->expanded) { + group = cc->group; group->scanIndex = 0; continue; } @@ -72,7 +74,7 @@ int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex) return -1; } -int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible) +int fnFindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible) { int index = 0; int nowVisible = 1; @@ -91,17 +93,16 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contac nowVisible = 0; break; } - group->scanIndex++; - continue; + group->scanIndex++; + continue; } 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 == (MCONTACT)hItem) || (IsHContactInfo(hItem) && - group->cl.items[group->scanIndex]->type == CLCIT_INFO && - group->cl.items[group->scanIndex]->hContact == (MCONTACT)((UINT_PTR)hItem & ~HCONTACT_ISINFO))) + + ClcContact *cc = group->cl.items[group->scanIndex]; + if ((IsHContactGroup(dwItem) && cc->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == cc->groupId) || + (IsHContactContact(dwItem) && cc->type == CLCIT_CONTACT && cc->hContact == dwItem) || + (IsHContactInfo(dwItem) && cc->type == CLCIT_INFO && cc->hContact == (dwItem & ~HCONTACT_ISINFO))) { if (isVisible) { if (!nowVisible) @@ -121,13 +122,13 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contac } } if (contact) - *contact = group->cl.items[group->scanIndex]; + *contact = cc; if (subgroup) *subgroup = group; return 1; } - if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { - group = group->cl.items[group->scanIndex]->group; + if (cc->type == CLCIT_GROUP) { + group = cc->group; group->scanIndex = 0; nowVisible &= group->expanded; continue; @@ -158,16 +159,18 @@ int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, Cl group->scanIndex++; continue; } + + ClcContact *cc = group->cl.items[group->scanIndex]; if (testindex == index) { if (contact) - *contact = group->cl.items[group->scanIndex]; + *contact = cc; if (subgroup) *subgroup = group; return index; } index++; - if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) { - group = group->cl.items[group->scanIndex]->group; + if (cc->type == CLCIT_GROUP && cc->group->expanded) { + group = cc->group; group->scanIndex = 0; continue; } diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 9e0352f2b7..a1c52bb02f 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -316,7 +316,7 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem) struct ClcData *dat = (struct ClcData *) GetWindowLongPtr(hwnd, 0); dat->needsResort = 1; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)hItem, &contact, &group, NULL)) { + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)hSelItem, &selcontact, &selgroup, NULL)) + if (cli.pfnFindItem(hwnd, dat, 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, (HANDLE)(saveInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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 3b4e038170..40ebec9b12 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -53,13 +53,13 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR int i; ClcContact *groupContact; ClcGroup *group; - CLCINFOITEM *cii = (CLCINFOITEM *) lParam; + CLCINFOITEM *cii = (CLCINFOITEM *)lParam; if (cii == NULL || cii->cbSize != sizeof(CLCINFOITEM)) return NULL; if (cii->hParentGroup == NULL) group = &dat->list; else { - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)((UINT_PTR)cii->hParentGroup | HCONTACT_ISGROUP), &groupContact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, int(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, (HANDLE)wParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, NULL, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, wParam, NULL, NULL, NULL)) return NULL; return wParam; case CLM_FINDGROUP: - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)(wParam | HCONTACT_ISGROUP), NULL, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)lParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, 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, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) break; lstrcpyn(contact->szText, (TCHAR*)lParam, SIZEOF(contact->szText)); cli.pfnSortCLC(hwnd, dat, 1); -- cgit v1.2.3