int GetStatusIconsCount(MCONTACT hContact) { int nIcon = 0; while (Srmm_GetNthIcon(hContact, nIcon) != NULL) nIcon++; return nIcon; }
void CheckStatusIconClick(MCONTACT hContact, HWND hwndFrom, POINT pt, const RECT &rc, int gap, int click_flags) { int iconNum = (pt.x - rc.left) / (GetSystemMetrics(SM_CXSMICON) + gap); StatusIconData *sid = Srmm_GetNthIcon(hContact, iconNum); if (sid == NULL) return; StatusIconClickData sicd = { sizeof(sicd) }; ClientToScreen(hwndFrom, &pt); sicd.clickLocation = pt; sicd.dwId = sid->dwId; sicd.szModule = sid->szModule; sicd.flags = click_flags; NotifyEventHooks(hHookIconPressedEvt, hContact, (LPARAM)&sicd); }
void DrawStatusIcons(MCONTACT hContact, HDC hDC, const RECT &rc, int gap) { int x = rc.left; int cx_icon = GetSystemMetrics(SM_CXSMICON); int cy_icon = GetSystemMetrics(SM_CYSMICON); int nIcon = 0; StatusIconData *sid; while ((sid = Srmm_GetNthIcon(hContact, nIcon++)) != 0 && x < rc.right) { HICON hIcon = ((sid->flags & MBF_DISABLED) && sid->hIconDisabled) ? sid->hIconDisabled : sid->hIcon; SetBkMode(hDC, TRANSPARENT); DrawIconEx(hDC, x, (rc.top + rc.bottom - cy_icon) >> 1, hIcon, cx_icon, cy_icon, 0, NULL, DI_NORMAL); x += cx_icon + gap; } }
void DrawStatusIcons(HANDLE hContact, HDC hDC, RECT r, int gap) { HICON hIcon; int x = r.left; int nIcon = 0; StatusIconData *sid; while ((sid = Srmm_GetNthIcon(hContact, nIcon++)) != 0 && x < r.right) { if ((sid->flags & MBF_DISABLED) && sid->hIconDisabled) hIcon = sid->hIconDisabled; else hIcon = sid->hIcon; SetBkMode(hDC, TRANSPARENT); DrawIconEx(hDC, x, (r.top + r.bottom - GetSystemMetrics(SM_CYSMICON)) >> 1, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL); x += GetSystemMetrics(SM_CYSMICON) + gap; } }