Exemple #1
0
ImageType::ImageType(const unsigned id, const CMString& file, IStream* pStream)
	: ImageBase(id)
{
	m_bmp = NULL;
	m_pPropertyItem = NULL;
	m_nCurrentFrame = 0;
	m_nFrameCount = 0;

	if (!InitGdiPlus()) return;

	if (pStream)
		m_bmp = new Gdiplus::Bitmap(pStream);
	else
		m_bmp = new Gdiplus::Bitmap(T2W_SM(file.c_str()));

	if (m_bmp->GetLastStatus() != Gdiplus::Ok) {
		delete m_bmp;
		m_bmp = NULL;
		return;
	}

	GUID pageGuid = Gdiplus::FrameDimensionTime;
	m_nFrameCount = m_bmp->GetFrameCount(&pageGuid);

	if (IsAnimated()) {
		int nSize = m_bmp->GetPropertyItemSize(PropertyTagFrameDelay);
		m_pPropertyItem = (Gdiplus::PropertyItem*) new char[nSize];
		m_bmp->GetPropertyItem(PropertyTagFrameDelay, nSize, m_pPropertyItem);
	}
}
static int systemModulesLoaded(WPARAM wParam, LPARAM lParam)
{
#if defined(_UNICODE)
    if ( !ServiceExists( MS_DB_CONTACT_GETSETTING_STR )) {
        MessageBox(NULL, TranslateT( "This plugin requires db3x plugin version 0.5.1.0 or later" ), _T("CList Nicer+"), MB_OK );
        return 1;
    }
#endif    
    InitGdiPlus();
    LoadCLUIModule();

    if(ServiceExists(MS_MC_DISABLEHIDDENGROUP))
        CallService(MS_MC_DISABLEHIDDENGROUP, 1, 0);
        
    return 0;
}
Exemple #3
0
ImageType::ImageType(const unsigned id, const CMString& file, const int index, const IcoTypeEnum type)
	: ImageBase(id)
{
	m_bmp = NULL;
	m_pPropertyItem = NULL;
	m_nCurrentFrame = 0;
	m_nFrameCount = 0;

	if (!InitGdiPlus()) return;

	switch (type) {
	case icoDll:
		{
			const HMODULE hModule = LoadDll(file);
			if (hModule != NULL) {
				HICON hIcon = (HICON)LoadImage(hModule, MAKEINTRESOURCE(-index), IMAGE_ICON, 0, 0, 0);
				m_bmp = new Gdiplus::Bitmap(hIcon);
				DestroyIcon(hIcon);
			}
		}
		break;

	case icoFile:
		m_bmp = new Gdiplus::Bitmap(T2W_SM(file.c_str()));
		break;

	default:
		HICON hIcon = NULL;
		ExtractIconEx(file.c_str(), index, NULL, &hIcon, 1);
		m_bmp = new Gdiplus::Bitmap(hIcon);
		DestroyIcon(hIcon);
		break;
	}

	if (m_bmp->GetLastStatus() != Gdiplus::Ok) {
		delete m_bmp;
		m_bmp = NULL;
		return;
	}
}