Warning: file_get_contents(https://whois.pconline.com.cn/jsLabel.jsp?ip=127.0.0.1) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable in D:\wwwroot\huidong\wwwroot\function.inc.php on line 884
HBITMAP 转 HICON - huidong

huidong

首页 | 会员登录 | 关于争取 2022 寒假做出汇东网 Ver3.0.0 !
搜索文章


// HBITMAP 转 HICON
HICON HICONFromHBitmap(HBITMAP hBmp)
{
    BITMAP bmp;
    GetObject(hBmp, sizeof(BITMAP), &bmp);

    HBITMAP hbmMask = CreateCompatibleBitmap(GetDC(NULL), bmp.bmWidth, bmp.bmHeight);

    ICONINFO ii = { 0 };
    ii.fIcon = TRUE;
    ii.hbmColor = hBmp;
    ii.hbmMask = hbmMask;

    HICON hIcon = CreateIconIndirect(&ii);
    DeleteObject(hbmMask);

    return hIcon;
}


不需要时,调用 DestroyIcon


改编自:https://blog.csdn.net/windows_nt/article/details/8470637 



返回首页


Copyright (C) 2018-2024 huidong