diff options
-rw-r--r-- | src/modules/clist/clcitems.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clcmsgs.cpp | 16 | ||||
-rw-r--r-- | src/modules/clist/clcutils.cpp | 2 | ||||
-rw-r--r-- | src/modules/ignore/ignore.cpp | 15 | ||||
-rw-r--r-- | src/modules/visibility/visibility.cpp | 18 |
5 files changed, 26 insertions, 27 deletions
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index c39f5cf5a6..ce8b744a88 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -158,7 +158,7 @@ int fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText) if (group->cl.items[i]->type != CLCIT_INFO)
break;
i = cli.pfnAddItemToGroup(group, i);
- iInfoItemUniqueHandle = (iInfoItemUniqueHandle + 1) & 0xFFFF;
+ iInfoItemUniqueHandle = LOWORD(iInfoItemUniqueHandle+1);
if (iInfoItemUniqueHandle == 0)
++iInfoItemUniqueHandle;
group->cl.items[i]->type = CLCIT_INFO;
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp index b35c7b0d64..c27564729c 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -160,16 +160,12 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR return dat->extraColumnsCount;
case CLM_GETEXTRAIMAGE:
- {
- if (LOWORD(lParam) >= dat->extraColumnsCount)
- return 0xFFFF;
-
- ClcContact *contact;
- if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
- return 0xFFFF;
-
- return contact->iExtraImage[LOWORD(lParam)];
- }
+ if (LOWORD(lParam) < dat->extraColumnsCount) {
+ ClcContact *contact;
+ if ( cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ return contact->iExtraImage[LOWORD(lParam)];
+ }
+ return EMPTY_EXTRA_ICON;
case CLM_GETEXTRAIMAGELIST:
return (LRESULT) dat->himlExtraColumns;
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index 97b0db6abb..9c1fb44956 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -154,7 +154,7 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact * }
for (i=0; i < dat->extraColumnsCount; i++) {
- if (hitcontact->iExtraImage[i] == 0xFFFF)
+ if (hitcontact->iExtraImage[i] == EMPTY_EXTRA_ICON)
continue;
if (testx >= clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - i) &&
testx < clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - i) + g_IconWidth) {
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp index 2907833af5..47a48a027c 100644 --- a/src/modules/ignore/ignore.cpp +++ b/src/modules/ignore/ignore.cpp @@ -67,13 +67,14 @@ static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentIt for (i=0; i < SIZEOF(iconOn); i++) {
iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
if (iconOn[i] && iImage == 0) iconOn[i] = 0;
- if (iImage != 0xFF) childCount[i]++;
+ if (iImage != EMPTY_EXTRA_ICON)
+ childCount[i]++;
}
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
//set icons
for (i=0; i < SIZEOF(iconOn); i++) {
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i]?(iconOn[i]?i+3:0):0xFF));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i]?(iconOn[i]?i+3:0) : EMPTY_EXTRA_ICON));
if (groupChildCount) groupChildCount[i]+=childCount[i];
}
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(IGNOREEVENT_MAX, 1));
@@ -99,7 +100,7 @@ static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
int iOldIcon = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
- if (iOldIcon != 0xFF && iOldIcon != iImage)
+ if (iOldIcon != EMPTY_EXTRA_ICON && iOldIcon != iImage)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
@@ -124,7 +125,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int case CLCIT_CONTACT:
{
int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
- if (oldiImage != 0xFF && oldiImage != iImage)
+ if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
}
break;
@@ -158,7 +159,7 @@ static void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem, const cha DWORD mask = 0;
for (int i=0; i < IGNOREEVENT_MAX; i++) {
int iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0));
- if (iImage && iImage != 0xFF)
+ if (iImage && iImage != EMPTY_EXTRA_ICON)
mask |= 1 << i;
}
db_set_dw(hContact, "Ignore", pszSetting, mask);
@@ -169,7 +170,7 @@ static void SetAllContactIcons(HWND hwndList) HANDLE hContact = db_find_first();
do {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
- if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == 0xFF) {
+ if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == EMPTY_EXTRA_ICON) {
DWORD proto1Caps, proto4Caps;
char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto) {
@@ -282,7 +283,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM int iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
if (iImage == 0)
iImage = nm->iColumn+3;
- else if (iImage != 0xFF)
+ else if (iImage != EMPTY_EXTRA_ICON)
iImage = 0;
SetIconsForColumn( GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, nm->iColumn, iImage);
}
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp index 9a09bc9bed..88f43b4a3c 100644 --- a/src/modules/visibility/visibility.cpp +++ b/src/modules/visibility/visibility.cpp @@ -48,13 +48,14 @@ static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentIt for (i=0; i < SIZEOF(iconOn); i++) {
iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
if (iconOn[i] && iImage == 0) iconOn[i] = 0;
- if (iImage != 0xFF) childCount[i]++;
+ if (iImage != EMPTY_EXTRA_ICON)
+ childCount[i]++;
}
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
//set icons
for (i=0; i < SIZEOF(iconOn); i++) {
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i]?(iconOn[i]?i+1:0):0xFF));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i]?(iconOn[i]?i+1:0):EMPTY_EXTRA_ICON));
if (groupChildCount) groupChildCount[i]+=childCount[i];
}
}
@@ -78,7 +79,8 @@ static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
iOldIcon = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
- if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
+ if (iOldIcon != EMPTY_EXTRA_ICON && iOldIcon != iImage)
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
}
@@ -114,12 +116,12 @@ static void SetAllContactIcons(HWND hwndList) flags = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
status = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
}
- if (flags&PF1_INVISLIST) {
- if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, 0)) == 0xFF)
+ if (flags & PF1_INVISLIST) {
+ if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, 0)) == EMPTY_EXTRA_ICON)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, status == ID_STATUS_ONLINE?1:0));
}
- if (flags&PF1_VISLIST) {
- if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, 0)) == 0xFF)
+ if (flags & PF1_VISLIST) {
+ if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, 0)) == EMPTY_EXTRA_ICON)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, status == ID_STATUS_OFFLINE?2:0));
}
}
@@ -210,7 +212,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP // Update list, making sure that the options are mutually exclusive
if (itemType == CLCIT_CONTACT) { // A contact
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, iImage));
- if (iImage && SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn?0:1, 0)) != 0xFF)
+ if (iImage && SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn?0:1, 0)) != EMPTY_EXTRA_ICON)
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn?0:1, 0));
}
else if (itemType == CLCIT_INFO) { // All Contacts
|