summaryrefslogtreecommitdiff
path: root/plugins/CurrencyRates/src/ExtraImages.cpp
blob: 686f4e34e7c44022bc97ceb44f71dc9861cb074b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "StdAfx.h"

static HANDLE hExtraIcon;

void CurrencyRates_InitExtraIcons()
{
	hExtraIcon = ExtraIcon_RegisterIcolib(ICON_STR_CURRENCYRATE, CURRENCYRATES_PROTOCOL_NAME, CURRENCYRATES_PROTOCOL_NAME "_" ICON_STR_MAIN);
}

bool SetContactExtraImage(MCONTACT hContact, EImageIndex nIndex)
{
	if (!hExtraIcon)
		return false;

	HANDLE hIcolib;
	switch (nIndex) {
	case eiUp:
		hIcolib = CurrencyRates_GetIconHandle(IDI_ICON_UP);
		break;
	case eiDown:
		hIcolib = CurrencyRates_GetIconHandle(IDI_ICON_DOWN);
		break;
	case eiNotChanged:
		hIcolib = CurrencyRates_GetIconHandle(IDI_ICON_NOTCHANGED);
		break;
	default:
		hIcolib = nullptr;
	}
	return ExtraIcon_SetIcon(hExtraIcon, hContact, hIcolib) == 0;
}