summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/icons.cpp
blob: 5a3d562e18720b3b3702dac92d4ce40df350720a (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
31
32
33
34
35
36
37
38
39
40
#include "stdafx.h"

static IconItem iconList[] =
{
	{	LPGEN("Upload file(s)"),	"upload",	IDI_UPLOAD	},
	{	LPGEN("Dropbox"),			"dropbox",	IDI_DROPBOX	},
	{	LPGEN("GDrive"),			"gdrive",	IDI_GDRIVE	}
};

void InitializeIcons()
{
	Icon_Register(hInstance, "Protocols/" MODULE, iconList, _countof(iconList), MODULE);
}

HANDLE GetIconHandle(int iconId)
{
	for (int i = 0; i < _countof(iconList); i++)
		if (iconList[i].defIconID == iconId)
			return iconList[i].hIcolib;

	return NULL;
}

HANDLE GetIconHandle(const char *name)
{
	for (size_t i = 0; i < _countof(iconList); i++)
		if (mir_strcmpi(iconList[i].szName, name) == 0)
			return iconList[i].hIcolib;

	return NULL;
}

HICON LoadIconEx(int iconId, bool big)
{
	for (int i = 0; i < _countof(iconList); i++)
		if (iconList[i].defIconID == iconId)
			return IcoLib_GetIconByHandle(iconList[i].hIcolib, big);

	return NULL;
}