示例#1
0
extern "C" int __declspec(dllexport) Load()
{
	mir_getLP(&pluginInfoEx);
	mir_getCLI();

	Icon_RegisterT(hInst, _T(MODULE), g_iconList, _countof(g_iconList));
	LoadMenus();
	InitOptions();

	for (int i = 0; i < _countof(s_fonts); i++) {
		LOGFONT lf;
		SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, FALSE);
		if (i == FLT_FONTID_OFFINVIS || i == FLT_FONTID_INVIS)
			lf.lfItalic = !lf.lfItalic;

		COLORREF defColor = GetSysColor((i == FLT_FONTID_NOTONLIST) ? COLOR_3DSHADOW : COLOR_WINDOWTEXT);

		char szId[20];
		mir_snprintf(szId, "Font%d", i);
		FontService_RegisterFont(MODULE, szId, LPGENT("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
	}

	HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoded);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreshutdown);
	return 0;
}
示例#2
0
static int FrameModulesLoaded(WPARAM, LPARAM)
{
	if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
		LOGFONT lf;
		/* built-in font module is not available before this hook */
		COLORREF clr = GetDefaultColor(FRAMEELEMENT_TEXT);
		FontService_RegisterFont("AutoShutdown", "CountdownFont", LPGENT("Automatic Shutdown"), LPGENT("Countdown on Frame"), LPGENT("Automatic Shutdown"), LPGENT("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
		clr = GetDefaultColor(FRAMEELEMENT_BKGRND);
		FontService_RegisterColor("AutoShutdown", "BkgColor", LPGENT("Automatic Shutdown"), LPGENT("Background"), clr);
		if (!IsThemeActive()) {
			/* progressbar color can only be changed with classic theme */
			clr = GetDefaultColor(FRAMEELEMENT_BAR);
			FontService_RegisterColor("AutoShutdown", "ProgressColor", TranslateT("Automatic Shutdown"), TranslateT("Progress Bar"), clr);
		}
	}
	return 0;
}