您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetIconInfo函数代码示例

51自学网 2021-06-01 21:09:11
  C++
这篇教程C++ GetIconInfo函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetIconInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetIconInfo函数的具体用法?C++ GetIconInfo怎么用?C++ GetIconInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetIconInfo函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: BindOverlayIcon

HICON BindOverlayIcon(HICON SourceIcon,HICON OverlayIcon){	ICONINFO OverlayIconInfo, TargetIconInfo;	BITMAP OverlayBitmapInfo, TargetBitmapInfo;	HBITMAP OldOverlayBitmap, OldTargetBitmap;	HICON TargetIcon, TempIcon;	HDC OverlayDC, TargetDC;	BLENDFUNCTION bf = {0,0,255,1};	TempIcon = CopyIcon(SourceIcon);	if ( !GetIconInfo( TempIcon, &TargetIconInfo ))		return NULL;	MakeBitmap32(&TargetIconInfo.hbmColor);	CorrectBitmap32Alpha(TargetIconInfo.hbmColor, FALSE);	GetObject(TargetIconInfo.hbmColor, sizeof(BITMAP), &TargetBitmapInfo);	if ( !GetIconInfo(OverlayIcon, &OverlayIconInfo) || !GetObject(OverlayIconInfo.hbmColor, sizeof(BITMAP), &OverlayBitmapInfo))		return NULL;	TargetDC = CreateCompatibleDC(NULL);	OldTargetBitmap = (HBITMAP)SelectObject(TargetDC, TargetIconInfo.hbmColor);	OverlayDC = CreateCompatibleDC(NULL);	OldOverlayBitmap = (HBITMAP)SelectObject(OverlayDC, OverlayIconInfo.hbmColor);	AlphaBlend(TargetDC, 0, 0, TargetBitmapInfo.bmWidth, TargetBitmapInfo.bmHeight,		   OverlayDC, 0, 0, OverlayBitmapInfo.bmWidth, OverlayBitmapInfo.bmHeight, bf);	SelectObject(TargetDC, TargetIconInfo.hbmMask);	SelectObject(OverlayDC, OverlayIconInfo.hbmMask);	BitBlt(TargetDC, 0, 0, TargetBitmapInfo.bmWidth, TargetBitmapInfo.bmHeight,	       OverlayDC, 0, 0, SRCCOPY);	TargetIcon = CreateIconIndirect(&TargetIconInfo);	DestroyIcon(TempIcon);	SelectObject(TargetDC, OldTargetBitmap);	DeleteObject(TargetIconInfo.hbmColor);	DeleteObject(TargetIconInfo.hbmMask);	DeleteDC(TargetDC);	SelectObject(OverlayDC, OldOverlayBitmap);	DeleteObject(OverlayIconInfo.hbmColor);	DeleteObject(OverlayIconInfo.hbmMask);	DeleteDC(OverlayDC);	return TargetIcon;}
开发者ID:aventado,项目名称:secureimplugin,代码行数:50,


示例2: DrawIconExAlpha

void DrawIconExAlpha(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags, bool bIsSmiley){    bool restore = false;    if (skin.bNeedLayerUpdate && !bIsSmiley) {        ICONINFO icon;        if ( GetIconInfo(hIcon, &icon)) {            if ( !IsAlphaTransparent(icon.hbmColor)) {                RECT rc;                SetRect(&rc, xLeft, yTop, xLeft + cxWidth, yTop + cyWidth);                SaveAlpha(&rc);                restore = true;            }            DeleteObject(icon.hbmColor);            DeleteObject(icon.hbmMask);        }    }    DrawIconEx(hdc, xLeft, yTop, hIcon, cxWidth, cyWidth, istepIfAniCur, hbrFlickerFreeDraw, diFlags);    if (skin.bNeedLayerUpdate && restore) {        RECT rc;        SetRect(&rc, xLeft, yTop, xLeft + cxWidth, yTop + cyWidth);        RestoreAlpha(&rc);    }}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:27,


示例3: ConvertBufferToPARGB32

///////////////////////////////////////////////////////////////////////////////////////// private helper for IconToPARGB32BitmapBOOL ConvertBufferToPARGB32(HPAINTBUFFER hPaintBuffer, HDC hdc, HICON hicon, SIZE& sizIcon){    RGBQUAD *prgbQuad = NULL;    int cxRow = 0;	if (CThemed::GetBufferedPaintBits(hPaintBuffer, &prgbQuad, &cxRow))	{		ARGB *pargb = reinterpret_cast<ARGB *>(prgbQuad);		if (!HasAlpha(pargb, sizIcon, cxRow))		{			ICONINFO info = { 0 };			if (GetIconInfo(hicon, &info))			{				if (info.hbmMask)				{					ConvertToPARGB32(hdc, pargb, info.hbmMask, sizIcon, cxRow);				}				// cleanup				VERIFY(DeleteObject(info.hbmColor));				VERIFY(DeleteObject(info.hbmMask));			}		}				return TRUE;	}	    return FALSE;}
开发者ID:Fox-Heracles,项目名称:TodoList,代码行数:33,


示例4: ImmGetIMEFileName

void CIme::SetImeIcon(){	HICON hIcon = NULL;	if( ImmIsIME( m_hCurKL ) )	{		char buf[256];		ImmGetIMEFileName( m_hCurKL, buf, 256 );		HMODULE hDll = LoadLibrary( buf );		EnumResourceNames( hDll, RT_GROUP_ICON, (ENUMRESNAMEPROC)EnumResNameProc, (int32)(void*)&hIcon );		FreeLibrary( hDll );	}	m_ImeImage.Release();	if( hIcon )	{		IGraphic* pGraphic = CGraphic::GetInst();		CFRect rt = CFRect( 0, 0, 16, 16 );		m_ImeImage.AddImage( pGraphic, -1, NULL, &rt, CFPos(0.0f, 0.0f), 0xffffffff );		pGraphic->CreateTexture( 16, 16, TF_UNKNOW, &m_ImeImage.GetImage(0).pTexture );		ICONINFO Info; 		GetIconInfo( hIcon, &Info );		m_ImeImage.GetImage(0).pTexture->FillFromHBitmap( Info.hbmColor, Info.hbmMask );		::DestroyIcon( hIcon );	}	OnImeChanged();}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:29,


示例5: pfnGetBufferedPaintBits

HRESULT CIconMenu::ConvertBufferToPARGB32(HPAINTBUFFER hPaintBuffer, HDC hdc, HICON hicon, SIZE& sizIcon){	RGBQUAD *prgbQuad;	int cxRow;	HRESULT hr = pfnGetBufferedPaintBits(hPaintBuffer, &prgbQuad, &cxRow);	if (SUCCEEDED(hr))	{		Gdiplus::ARGB *pargb = reinterpret_cast<Gdiplus::ARGB *>(prgbQuad);		if (!HasAlpha(pargb, sizIcon, cxRow))		{			ICONINFO info;			if (GetIconInfo(hicon, &info))			{				if (info.hbmMask)				{					hr = ConvertToPARGB32(hdc, pargb, info.hbmMask, sizIcon, cxRow);				}				DeleteObject(info.hbmColor);				DeleteObject(info.hbmMask);			}		}	}	return hr;}
开发者ID:hfeeki,项目名称:TortoiseGit,代码行数:26,


示例6: SetCaption

void CPropPageFrameDefault::SetCaption(LPCTSTR lpszCaption, HICON hIcon /*= NULL*/){	CPropPageFrame::SetCaption(lpszCaption, hIcon);	// build image list	if (m_Images.GetSafeHandle())		m_Images.DeleteImageList();	if (hIcon)	{		ICONINFO	ii;		if (!GetIconInfo(hIcon, &ii))			return;		CBitmap	bmMask;		bmMask.Attach(ii.hbmMask);		if (ii.hbmColor) DeleteObject(ii.hbmColor);		BITMAP	bm;		bmMask.GetBitmap(&bm);		if (!m_Images.Create(bm.bmWidth, bm.bmHeight, ILC_COLOR32|ILC_MASK, 0, 1))			return;		if (m_Images.Add(hIcon) == -1)			m_Images.DeleteImageList();	}}
开发者ID:Strongc,项目名称:playasa,代码行数:27,


示例7: QTreeWidgetItem

StripperWindow::StripperWindow(QTreeWidget *parent, HWND hwnd):        QTreeWidgetItem(parent, QTreeWidgetItem::Type){    //stubbed out.    handle = hwnd;    HICON icon_handle = (HICON)GetClassLongPtr(handle, GCLP_HICON);    //pre-empt the "failed to GetIconInfo() error" so it speeds through quickly.    ICONINFO dummy;    if(!GetIconInfo(icon_handle, &dummy)) {        icon = QPixmap();    } else {        icon = QPixmap::fromWinHICON(icon_handle);    }    LPWSTR lpwstr_buf = (WCHAR*)calloc(sizeof(WCHAR), 255);    GetWindowText(hwnd, lpwstr_buf, 255);    title = QString::fromWCharArray(lpwstr_buf, 255);    free(lpwstr_buf);    borderless_p = false;    //this might seem like duplication...    setData(0, Qt::DecorationRole, QVariant(icon));    setData(1, Qt::DisplayRole, QVariant(title));    setFont(1, QFont(QString("Verdana"), 0, QFont::Bold, false));    setData(2, Qt::CheckStateRole, QVariant(StrippedP()));}
开发者ID:rplacd,项目名称:Striptease,代码行数:28,


示例8: draw_cursor

static void draw_cursor(struct dc_capture *capture, HDC hdc){	HICON icon;	ICONINFO ii;	CURSORINFO *ci = &capture->ci;	if (!(capture->ci.flags & CURSOR_SHOWING))		return;	icon = CopyIcon(capture->ci.hCursor);	if (!icon)		return;	if (GetIconInfo(icon, &ii)) {		POINT pos;		pos.x = ci->ptScreenPos.x - (int)ii.xHotspot - capture->x;		pos.y = ci->ptScreenPos.y - (int)ii.yHotspot - capture->y;		DrawIcon(hdc, pos.x, pos.y, icon);		DeleteObject(ii.hbmColor);		DeleteObject(ii.hbmMask);	}	DestroyIcon(icon);}
开发者ID:GamingAtheist,项目名称:obs-studio,代码行数:26,


示例9: IconToBitmap

Gdiplus::GpBitmap* IconToBitmap(HICON hIcon){    ICONINFO iconInfo;    if (!GetIconInfo(hIcon, &iconInfo))        return nullptr;    Gdiplus::GpBitmap* pBitmap = nullptr;    if (Gdiplus::Ok != gdi_call(GdipCreateBitmapFromHICON)(hIcon, &pBitmap))        return nullptr;    Gdiplus::GpBitmap* pBmpMask = nullptr;    if (Gdiplus::Ok != gdi_call(GdipCreateBitmapFromHBITMAP)(iconInfo.hbmMask, NULL, &pBmpMask))        return nullptr;    FGdipBitmapSetPixel SetPixel = gdi_call(GdipBitmapSetPixel);    FGdipBitmapGetPixel GetPixel = gdi_call(GdipBitmapGetPixel);    Gdiplus::ARGB pixel, mask;    for (UINT y = 0; y < iconInfo.yHotspot * 2; ++y)    {        for (UINT x = 0; x < iconInfo.xHotspot * 2; ++x)        {            GetPixel(pBitmap, x, y, &pixel);            GetPixel(pBmpMask, x, y, &mask);            SetPixel(pBitmap, x, y, pixel | mask);        }    }    gdi_call(GdipDisposeImage)(pBmpMask);    return pBitmap;}
开发者ID:01org,项目名称:IntelSEAPI,代码行数:32,


示例10: KILOBYTES

    // private    //-------------------------------------------------------------------------    Hash HandleCache::_CalculateHash( HCURSOR hcursor )    {        static const ULong HASH_BUFFER_LIMIT = KILOBYTES(8);            ICONINFO    iconinfo = {0};        LONG        count;        Byte        buffer[HASH_BUFFER_LIMIT];        // require valid        if( hcursor == NULL )            return 0;        // get icon info        if( GetIconInfo(hcursor, &iconinfo) == FALSE )            return 0;        // get icon bitmap buffer        count = GetBitmapBits( iconinfo.hbmColor ? iconinfo.hbmColor : iconinfo.hbmMask, sizeof(buffer), buffer );        // iconinfo cleanup         if( iconinfo.hbmColor )            DeleteObject(iconinfo.hbmColor);        if( iconinfo.hbmMask )            DeleteObject(iconinfo.hbmMask);        // fail if no bits read        if(count == 0)            return 0;        // generate hash        return Tools::Fnv164Hash(buffer, count);    }
开发者ID:jamesbascle,项目名称:YoloMouse,代码行数:34,


示例11: GetBufferedPaintBits

HRESULT IconBitmapUtils::ConvertBufferToPARGB32(HPAINTBUFFER hPaintBuffer, HDC hdc, HICON hicon, SIZE& sizIcon){    RGBQUAD *prgbQuad;    int cxRow;    HRESULT hr = GetBufferedPaintBits(hPaintBuffer, &prgbQuad, &cxRow);    if (FAILED(hr))        return hr;    Gdiplus::ARGB *pargb = reinterpret_cast<Gdiplus::ARGB *>(prgbQuad);    if (HasAlpha(pargb, sizIcon, cxRow))        return S_OK;    ICONINFO info;    if (!GetIconInfo(hicon, &info))        return S_OK;    SCOPE_EXIT    {        DeleteObject(info.hbmColor);        DeleteObject(info.hbmMask);    };    if (info.hbmMask)        return ConvertToPARGB32(hdc, pargb, info.hbmMask, sizIcon, cxRow);    return S_OK;}
开发者ID:Teivaz,项目名称:TortoiseGit,代码行数:25,


示例12: GetIconInfo

Gdiplus::Bitmap* GdiplusUtilities::FromHICON32(HICON hIcon){	Gdiplus::Bitmap* ret = NULL;	ICONINFO iconInfo;	GetIconInfo(hIcon, &iconInfo);	BITMAP bitmapData;	GetObject(iconInfo.hbmColor, sizeof(BITMAP), &bitmapData);	if (bitmapData.bmBitsPixel != 32)		ret = Gdiplus::Bitmap::FromHICON(hIcon);	else	{		ret = new Gdiplus::Bitmap(bitmapData.bmWidth, bitmapData.bmHeight, PixelFormat32bppARGB);		Gdiplus::BitmapData bmpData;		ret->LockBits(&Gdiplus::Rect(0,0,bitmapData.bmWidth, bitmapData.bmHeight), Gdiplus::ImageLockModeWrite, PixelFormat32bppARGB, &bmpData);#ifndef GetDIBitsVERSION		//===Version GetBitmapBits		// THIS FUNCTION IS UNDER TESTING. WHAT IF THE bitmap stride is different? Where will the new data go?		ASSERT(bmpData.Stride == bmpData.Width * 4);		::GetBitmapBits(iconInfo.hbmColor, 4 * bitmapData.bmWidth * bitmapData.bmHeight, bmpData.Scan0);		//===Version GetBitmapBits===END#else		//===Version GetDIBits (incomplete)		::GetDIBits(GetDC(), iconInfo.hbmColor, 0, bitmapData.bm)			//===Version GetDIBits#endif			ret->UnlockBits(&bmpData);	} 	DeleteObject(iconInfo.hbmColor);	DeleteObject(iconInfo.hbmMask);	return ret;}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:32,


示例13: PhpConvertToPArgb32IfNeeded

static VOID PhpConvertToPArgb32IfNeeded(    _In_ HPAINTBUFFER PaintBuffer,    _In_ HDC hdc,    _In_ HICON Icon,    _In_ ULONG Width,    _In_ ULONG Height    ){    RGBQUAD *quad;    ULONG rowWidth;    if (SUCCEEDED(GetBufferedPaintBits_I(PaintBuffer, &quad, &rowWidth)))    {        PULONG argb = (PULONG)quad;        if (!PhpHasAlpha(argb, Width, Height, rowWidth))        {            ICONINFO iconInfo;            if (GetIconInfo(Icon, &iconInfo))            {                if (iconInfo.hbmMask)                {                    PhpConvertToPArgb32(hdc, argb, iconInfo.hbmMask, Width, Height, rowWidth);                }                DeleteObject(iconInfo.hbmColor);                DeleteObject(iconInfo.hbmMask);            }        }    }}
开发者ID:Azarien,项目名称:processhacker2,代码行数:32,


示例14: GetBufferedPaintBits

HRESULT LiferayNativityContextMenus::_ConvertBufferToPARGB32(HPAINTBUFFER hPaintBuffer, HDC hdc, HICON hicon, SIZE& sizIcon){	RGBQUAD *prgbQuad;	int cxRow;	HRESULT hResult = GetBufferedPaintBits(hPaintBuffer, &prgbQuad, &cxRow);	if (SUCCEEDED(hResult))	{		Gdiplus::ARGB *pargb = reinterpret_cast<Gdiplus::ARGB *>(prgbQuad);		if (!_HasAlpha(pargb, sizIcon, cxRow))		{			ICONINFO info;			if (GetIconInfo(hicon, &info))			{				if (info.hbmMask)				{					hResult = _ConvertToPARGB32(hdc, pargb, info.hbmMask, sizIcon, cxRow);				}				DeleteObject(info.hbmColor);				DeleteObject(info.hbmMask);			}		}	}	return hResult;}
开发者ID:iterate-ch,项目名称:liferay-nativity,代码行数:30,


示例15: GetIconInfo

CSize SIconWnd::GetDesiredSize(LPRECT pRcContainer){    if(!m_theIcon) return CSize();    ICONINFO iconInfo={0};    GetIconInfo(m_theIcon,&iconInfo);        return CSize(iconInfo.xHotspot*2,iconInfo.yHotspot*2);}
开发者ID:blueantst,项目名称:soui,代码行数:8,


示例16: DrawIcon

//=============================================================================	void CXButtonXP::DrawIcon(CDC *pDC,						  BOOL bHasText,						  CRect& rectItem,		// from LPDRAWITEMSTRUCT						  CRect& rectText,						  BOOL bIsPressed,						  BOOL bIsThemed,						  BOOL bIsDisabled)//=============================================================================	{	if (m_hIcon)	{		// first get size of icon		DWORD dwWidth = 32;		// assume 32x32		DWORD dwHeight = 32;		ICONINFO iconinfo;		if (GetIconInfo(m_hIcon, &iconinfo))		{			CBitmap* pBitmap = CBitmap::FromHandle(iconinfo.hbmColor);			if (pBitmap)			{				BITMAP bm;				pBitmap->GetBitmap(&bm);				dwWidth = bm.bmWidth;				dwHeight = bm.bmHeight;			}			if (iconinfo.hbmColor) 				::DeleteObject(iconinfo.hbmColor);			if (iconinfo.hbmMask) 				::DeleteObject(iconinfo.hbmMask);		}		CRect rectImage(rectItem);		PrepareImageRect(bHasText, rectItem, rectText, bIsPressed, bIsThemed,			dwWidth, dwHeight, rectImage);		HICON hIcon = m_hIcon;		UINT nFlags = bIsDisabled ? DSS_DISABLED : DSS_NORMAL;		if (bIsDisabled && m_hGrayIcon)		{			hIcon = m_hGrayIcon;			nFlags = DSS_NORMAL;		}		nFlags |= DST_ICON;		pDC->DrawState(CPoint(rectImage.left, rectImage.top),					   CSize(rectImage.right - rectImage.left, rectImage.bottom - rectImage.top),					   hIcon,					   nFlags,					   (CBrush *) NULL);	}}
开发者ID:Turante,项目名称:boinc-client-configuration,代码行数:58,


示例17: bmp_from_icon

/*** Get the contents of the specified window handle and put** them into the specified bitmap.  x0,y0 = upper left coordinates** of source rectangle.*/static int bmp_from_icon(WILLUSBITMAP *bmp,HICON hIcon)    {    ICONINFO iinfo;    if (!GetIconInfo(hIcon,&iinfo))        return(0);    return(bmp_to_from_winbmp(bmp,iinfo.hbmColor)!=NULL);    }
开发者ID:darkgeek,项目名称:k2pdfopt,代码行数:14,


示例18: MyGetIconInfo

MYICON_INFO MyGetIconInfo(HICON hIcon){    MYICON_INFO myinfo;    ZeroMemory(&myinfo, sizeof(myinfo));    ICONINFO info;    ZeroMemory(&info, sizeof(info));    BOOL bRes = FALSE;    bRes = GetIconInfo(hIcon, &info);    if (!bRes)    {        return myinfo;    }    BITMAP bmp;    ZeroMemory(&bmp, sizeof(bmp));    if (info.hbmColor)    {        const int nWrittenBytes = GetObject(info.hbmColor, sizeof(bmp), &bmp);        if (nWrittenBytes > 0)        {            myinfo.nWidth = bmp.bmWidth;            myinfo.nHeight = bmp.bmHeight;            myinfo.nBitsPerPixel = bmp.bmBitsPixel;        }    }    else if (info.hbmMask)    {        // Icon has no color plane, image data stored in mask        const int nWrittenBytes = GetObject(info.hbmMask, sizeof(bmp), &bmp);        if (nWrittenBytes > 0)        {            myinfo.nWidth = bmp.bmWidth;            myinfo.nHeight = bmp.bmHeight / 2;            myinfo.nBitsPerPixel = 1;        }    }    if (info.hbmColor)    {        DeleteObject(info.hbmColor);    }    if (info.hbmMask)    {        DeleteObject(info.hbmMask);    }    return myinfo;}
开发者ID:bianliu1013,项目名称:PDock,代码行数:56,


示例19:

// Add the mouse pointer to the buffervoidvncDesktop::CaptureMouse(BYTE *scrBuff, UINT scrBuffSize){	POINT CursorPos;	ICONINFO IconInfo;	// If the mouse cursor handle is invalid then forget it	if (m_hcursor == NULL)		return;	// Get the cursor position	if (!GetCursorPos(&CursorPos))		return;	// Translate position for hotspot	if (GetIconInfo(m_hcursor, &IconInfo))	{		CursorPos.x -= ((int) IconInfo.xHotspot);		CursorPos.y -= ((int) IconInfo.yHotspot);		if (IconInfo.hbmMask != NULL)			DeleteObject(IconInfo.hbmMask);		if (IconInfo.hbmColor != NULL)			DeleteObject(IconInfo.hbmColor);	}	// Select the memory bitmap into the memory DC	HBITMAP oldbitmap;	if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)		return;	// Draw the cursor	DrawIconEx(		m_hmemdc,									// handle to device context 		CursorPos.x, CursorPos.y,		m_hcursor,									// handle to icon to draw 		0,0,										// width of the icon 		0,											// index of frame in animated cursor 		NULL,										// handle to background brush 		DI_NORMAL | DI_COMPAT						// icon-drawing flags 		);	// Select the old bitmap back into the memory DC	SelectObject(m_hmemdc, oldbitmap);	// Save the bounding rectangle	m_cursorpos.tl = CursorPos;	m_cursorpos.br = rfb::Point(GetSystemMetrics(SM_CXCURSOR),		GetSystemMetrics(SM_CYCURSOR)).translate(CursorPos);	// Clip the bounding rect to the screen	// Copy the mouse cursor into the screen buffer, if any of it is visible	m_cursorpos = m_cursorpos.intersect(m_bmrect);	if (!m_cursorpos.is_empty()) {		CopyToBuffer(m_cursorpos, scrBuff, scrBuffSize);	}}
开发者ID:lizard007,项目名称:msf3,代码行数:57,


示例20: GetIconInfo

CSize SIconWnd::GetDesiredSize(LPCRECT pRcContainer){    if(!m_theIcon) return CSize();    ICONINFO iconInfo={0};    GetIconInfo(m_theIcon,&iconInfo);    if(iconInfo.hbmColor) DeleteObject(iconInfo.hbmColor);    if(iconInfo.hbmMask) DeleteObject(iconInfo.hbmMask);    return CSize(iconInfo.xHotspot*2,iconInfo.yHotspot*2);}
开发者ID:ming-hai,项目名称:soui,代码行数:10,


示例21: sizeof

BOOL CImageBoxEx::SetIcon(HICON hIconIn, HICON hIconOut, HICON hIconDisable){	if (hIconIn == NULL && hIconOut == NULL && hIconDisable == NULL)		return FALSE;		this->FreeResources();		ICONINFO ii;		this->m_Icons[0].m_hIcon = hIconIn;	::ZeroMemory(&ii, sizeof(ICONINFO));	if (!GetIconInfo(hIconIn, &ii))		return FALSE;		this->m_Icons[0].m_nIconX = (DWORD) (ii.xHotspot * 2);	this->m_Icons[0].m_nIconY = (DWORD) (ii.yHotspot * 2);	::DeleteObject(ii.hbmMask);	::DeleteObject(ii.hbmColor);		this->m_Icons[1].m_hIcon = hIconOut;	::ZeroMemory(&ii, sizeof(ICONINFO));	if (!GetIconInfo(hIconOut, &ii))		return FALSE;		this->m_Icons[1].m_nIconX = (DWORD) (ii.xHotspot * 2);	this->m_Icons[1].m_nIconY = (DWORD) (ii.yHotspot * 2);	::DeleteObject(ii.hbmMask);	::DeleteObject(ii.hbmColor);		this->m_Icons[2].m_hIcon = hIconDisable;	::ZeroMemory(&ii, sizeof(ICONINFO));	if (!GetIconInfo(hIconDisable, &ii))		return FALSE;		this->m_Icons[2].m_nIconX = (DWORD) (ii.xHotspot * 2);	this->m_Icons[2].m_nIconY = (DWORD) (ii.yHotspot * 2);	::DeleteObject(ii.hbmMask);	::DeleteObject(ii.hbmColor);		this->Invalidate();		return TRUE;}
开发者ID:albertzeng,项目名称:eRadQueue,代码行数:43,


示例22: wchar_t

LPCWSTR CIconList::GetIconInfoStr(HICON h, wchar_t (&szInfo)[80]){	ICONINFO ii = {};	GetIconInfo(h, &ii);	BITMAP bi = {};	GetObject(ii.hbmColor, sizeof(bi), &bi);	_wsprintf(szInfo, SKIPCOUNT(szInfo) L"{%ix%i} planes=%u bpp=%u", bi.bmWidth, bi.bmHeight, bi.bmPlanes, bi.bmBitsPixel);	SafeDeleteObject(ii.hbmColor);	SafeDeleteObject(ii.hbmMask);	return szInfo;}
开发者ID:robovod,项目名称:ConEmu,代码行数:11,


示例23: DestroySmileyList

void CSmileyString::AddListeningToIcon(struct SHORTDATA *dat, PDNCE pdnce, TCHAR *szText, BOOL replace_smileys){    iMaxSmileyHeight = 0;	DestroySmileyList();    if (szText == NULL) return;	int text_size = (int)_tcslen( szText );        plText = li.List_Create( 0, 1 );    // Add Icon    {        BITMAP bm;        ICONINFO icon;        ClcContactTextPiece *piece = (ClcContactTextPiece *) mir_alloc(sizeof(ClcContactTextPiece));        piece->type = TEXT_PIECE_TYPE_SMILEY;        piece->len = 0;        piece->smiley = g_hListeningToIcon;        piece->smiley_width = 16;        piece->smiley_height = 16;        if (GetIconInfo(piece->smiley, &icon))        {            if (GetObject(icon.hbmColor,sizeof(BITMAP),&bm))            {                piece->smiley_width = bm.bmWidth;                piece->smiley_height = bm.bmHeight;            }            DeleteObject(icon.hbmMask);            DeleteObject(icon.hbmColor);        }        dat->text_smiley_height = max(piece->smiley_height, dat->text_smiley_height);        iMaxSmileyHeight = max(piece->smiley_height, iMaxSmileyHeight);        li.List_Insert( plText, piece, plText->realCount);    }    // Add text    {        ClcContactTextPiece *piece = (ClcContactTextPiece *) mir_alloc(sizeof(ClcContactTextPiece));        piece->type = TEXT_PIECE_TYPE_TEXT;        piece->start_pos = 0;        piece->len = text_size;        li.List_Insert( plText, piece, plText->realCount);    }}
开发者ID:raoergsls,项目名称:miranda,代码行数:52,


示例24: gst_gdiscreencapsrc_screen_capture

static gbooleangst_gdiscreencapsrc_screen_capture (GstGDIScreenCapSrc * src, GstBuffer * buf){  HWND capture;  HDC winDC;  gint height, width;  GstMapInfo map;  if (G_UNLIKELY (!src->hBitmap || !src->dibMem))    return FALSE;  width = src->info.bmiHeader.biWidth;  height = -src->info.bmiHeader.biHeight;  /* Capture screen */  capture = GetDesktopWindow ();  winDC = GetWindowDC (capture);  BitBlt (src->memDC, 0, 0, width, height,      winDC, src->src_rect.left, src->src_rect.top, SRCCOPY);  ReleaseDC (capture, winDC);  /* Capture mouse cursor */  if (src->show_cursor) {    CURSORINFO ci;    ci.cbSize = sizeof (CURSORINFO);    GetCursorInfo (&ci);    if (ci.flags & CURSOR_SHOWING) {      ICONINFO ii;      GetIconInfo (ci.hCursor, &ii);      DrawIconEx (src->memDC,          ci.ptScreenPos.x - src->src_rect.left - ii.xHotspot,          ci.ptScreenPos.y - src->src_rect.top - ii.yHotspot, ci.hCursor, 0, 0,          0, NULL, DI_DEFAULTSIZE | DI_NORMAL | DI_COMPAT);      DeleteObject (ii.hbmColor);      DeleteObject (ii.hbmMask);    }  }  /* Copy DC bits to GST buffer */  gst_buffer_map (buf, &map, GST_MAP_WRITE);  memcpy (map.data, src->dibMem, map.size);  gst_buffer_unmap (buf, &map);  return TRUE;}
开发者ID:asrashley,项目名称:gst-plugins-bad,代码行数:51,


示例25: SHGetFileInfo

/* Sets a tabs icon. Normally, this iconis the folders icon, however if the tabis locked, the icon will be a lock. */void Explorerplusplus::SetTabIcon(int iIndex,int iTabId,LPITEMIDLIST pidlDirectory){	TCITEM			tcItem;	SHFILEINFO		shfi;	ICONINFO		IconInfo;	int				iImage;	int				iRemoveImage;	/* If the tab is locked, use a lock icon. */	if(m_TabInfo[iTabId].bAddressLocked || m_TabInfo[iTabId].bLocked)	{		iImage = TAB_ICON_LOCK_INDEX;	}	else	{		SHGetFileInfo((LPCTSTR)pidlDirectory,0,&shfi,sizeof(shfi),			SHGFI_PIDL|SHGFI_ICON|SHGFI_SMALLICON);		/* TODO: The proxy icon may also be the lock icon, if		the tab is locked. */		SetTabProxyIcon(iTabId,shfi.hIcon);		GetIconInfo(shfi.hIcon,&IconInfo);		iImage = ImageList_Add(TabCtrl_GetImageList(m_hTabCtrl),			IconInfo.hbmColor,IconInfo.hbmMask);		DeleteObject(IconInfo.hbmColor);		DeleteObject(IconInfo.hbmMask);		DestroyIcon(shfi.hIcon);	}	/* Get the index of the current image. This image	will be removed after the new image is set. */	tcItem.mask		= TCIF_IMAGE;	TabCtrl_GetItem(m_hTabCtrl,iIndex,&tcItem);	iRemoveImage = tcItem.iImage;	/* Set the new image. */	tcItem.mask		= TCIF_IMAGE;	tcItem.iImage	= iImage;	TabCtrl_SetItem(m_hTabCtrl,iIndex,&tcItem);	if(iRemoveImage != TAB_ICON_LOCK_INDEX)	{		/* Remove the old image. */		TabCtrl_RemoveImage(m_hTabCtrl,iRemoveImage);	}}
开发者ID:linquize,项目名称:explorerplus-custom,代码行数:52,


示例26: GetIconInfo

void IconType::GetSize(SIZE& size){	if (m_SmileyIcon == NULL)		return;	ICONINFO ii;	GetIconInfo(m_SmileyIcon, &ii);	BITMAP bm;	GetObject(ii.hbmColor, sizeof(bm), &bm);	size.cx = bm.bmWidth;	size.cy = bm.bmHeight;	DeleteObject(ii.hbmMask);	DeleteObject(ii.hbmColor);}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:15,


示例27: size

CSize CFilterEdit::GetIconSize(HICON hIcon){	CSize size(0, 0);	ICONINFO iconinfo;	if (GetIconInfo(hIcon, &iconinfo))	{		BITMAP bmp;		if (GetObject(iconinfo.hbmColor, sizeof(BITMAP), &bmp))		{			size.cx = bmp.bmWidth;			size.cy = bmp.bmHeight;		}	}	return size;}
开发者ID:15375514460,项目名称:TortoiseGit,代码行数:15,


示例28: sz

CSize CRichElement::GetSize() const{	CSize sz( 0, 0 );	if ( m_nType == retGap )	{		_stscanf( m_sText, L"%lu", &sz.cx );	}	else if ( m_nType == retBitmap && m_hImage != NULL )	{		BITMAP pInfo = {};		GetObject( (HBITMAP)m_hImage, sizeof(pInfo), &pInfo );		sz.cx = pInfo.bmWidth;		sz.cy = pInfo.bmHeight;	}	else if ( m_nType == retIcon )	{		sz.cx = sz.cy = 16;		ICONINFO ii;		if ( GetIconInfo( (HICON)m_hImage, &ii ) )		{			BITMAP bmInfo = {};			GetObject( ii.hbmColor, sizeof(BITMAP), &bmInfo );			if ( bmInfo.bmWidth > 16 )				sz.cx = bmInfo.bmWidth;			if ( bmInfo.bmHeight > 16 )				sz.cy = bmInfo.bmHeight;			DeleteObject( ii.hbmColor );			DeleteObject( ii.hbmMask );		}		UINT nID = 0;		_stscanf( m_sText, L"%u.%li.%li", &nID, &sz.cx, &sz.cy );	}	else if ( m_nType == retEmoticon || m_nType == retCmdIcon )	{		sz.cx = sz.cy = 16;	}	else if ( m_nType == retAnchor )	{		sz.cx = sz.cy = 16;		_stscanf( m_sText, L"%li.%li", &sz.cx, &sz.cy );	}	return sz;}
开发者ID:GetEnvy,项目名称:Envy,代码行数:48,


示例29: DestroySmileyList

void CSmileyString::AddListeningToIcon(ClcData *dat, wchar_t *szText){	iMaxSmileyHeight = 0;	DestroySmileyList();	if (szText == nullptr)		return;	int text_size = (int)mir_wstrlen(szText);	plText = List_Create(0, 1);	// Add Icon	{		ClcContactTextPiece *piece = (ClcContactTextPiece *)mir_alloc(sizeof(ClcContactTextPiece));		piece->type = TEXT_PIECE_TYPE_SMILEY;		piece->len = 0;		piece->smiley = g_hListeningToIcon;		piece->smiley_width = 16;		piece->smiley_height = 16;		ICONINFO icon;		if (GetIconInfo(piece->smiley, &icon)) {			BITMAP bm;			if (GetObject(icon.hbmColor, sizeof(BITMAP), &bm)) {				piece->smiley_width = bm.bmWidth;				piece->smiley_height = bm.bmHeight;			}			DeleteObject(icon.hbmMask);			DeleteObject(icon.hbmColor);		}		dat->text_smiley_height = max(piece->smiley_height, dat->text_smiley_height);		iMaxSmileyHeight = max(piece->smiley_height, iMaxSmileyHeight);		List_Insert(plText, piece, plText->realCount);	}	// Add text	{		ClcContactTextPiece *piece = (ClcContactTextPiece *)mir_alloc(sizeof(ClcContactTextPiece));		piece->type = TEXT_PIECE_TYPE_TEXT;		piece->start_pos = 0;		piece->len = text_size;		List_Insert(plText, piece, plText->realCount);	}}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:48,


示例30: Destroy

void CxImage::CreateFromHICON(HICON hico){	Destroy();	if (hico) { 		ICONINFO iinfo;		GetIconInfo(hico,&iinfo);		CreateFromHBITMAP(iinfo.hbmColor);#if CXIMAGE_SUPPORT_ALPHA		CxImage mask;		mask.CreateFromHBITMAP(iinfo.hbmMask);		mask.GrayScale();		mask.Negative();		AlphaSet(mask);#endif    }}
开发者ID:axxapp,项目名称:winxgui,代码行数:16,



注:本文中的GetIconInfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetId函数代码示例
C++ GetIconHandle函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。