• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetIconInfo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了GetIconInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:images.cpp


示例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,代码来源:bitmap_func.cpp


示例3: ConvertBufferToPARGB32

///////////////////////////////////////////////////////////////////////////////////////
// private helper for IconToPARGB32Bitmap
BOOL 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,代码来源:GraphicsMisc.cpp


示例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,代码来源:CIme.cpp


示例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,代码来源:IconMenu.cpp


示例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,代码来源:PropPageFrameDefault.cpp


示例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,代码来源:stripperwindow.cpp


示例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,代码来源:dc-capture.c


示例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,代码来源:sea_itt_lib.cpp


示例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,代码来源:HandleCache.cpp


示例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,代码来源:IconBitmapUtils.cpp


示例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,代码来源:GdiplusUtilities.cpp


示例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,代码来源:icotobmp.c


示例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,代码来源:LiferayNativityContextMenus.cpp


示例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,代码来源:SCmnCtrl.cpp


示例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,代码来源:XButtonXP.cpp


示例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,代码来源:winbmp.c


示例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,代码来源:tools.cpp


示例19:

// Add the mouse pointer to the buffer
void
vncDesktop::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,代码来源:vncdesktop.cpp


示例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,代码来源:SCmnCtrl.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetId函数代码示例发布时间:2022-05-30
下一篇:
C++ GetIconHandle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap