网站首页  词典首页

请输入您要查询的函数:

 

术语 createiconfromresourceex
释义 CreateIconFromResourceEx
语法:
HICON CreateIconFromResourceEx( PBYTE pbIconBits,
DWORD cbIconBits,
BOOL fIcon,
DWORD dwVersion,
int cxDesired,
int cyDesired,
UINT uFlags
);
CreateIconFromResourceEx功能
该CreateIconFromResourceEx函数创建一个从资源描述图标位图标或光标。
参数
pbIconBits
[in]指向一个缓冲区包含的图标或光标资源位。这些位通常加载到LookupIconIdFromDirectoryEx和LoadResource函数调用。
cbIconBits
[in]指定的大小,以字节为单位设置的位指向的pbIconBits参数。
FICON的
[in]指定是否图标或光标是要创建。如果此参数为true,一个图标是要创建的。如果它是假,游标是要创建的。
dwVersion
[in]指定的图标或光标资源位版本号格式指向的pbIconBits参数。此参数可以0x00030000。
cxDesired
[in]指定所需的宽度,以像素为单位的图标或光标。如果此参数为0,函数使用SM_CXICON或SM_CXCURSOR系统公制值设定宽度。
cyDesired
[in]指定所需高度,以像素为单位的图标或光标。如果此参数为0,函数使用SM_CYICON或SM_CYCURSOR制度吨的价格来确定高度。
uFlags
[in]指定下列值的组合:
LR_DEFAULTCOLOR
使用默认的颜色格式。
LR_DEFAULTSIZE
使用的宽度或由系统指定高度的游标或图标度量的值,如果cxDesired或cyDesired值设置为零。如果此标志没有被指定的cxDesired和cyDesired设置为零,该函数使用实际资源的大小。如果资源包含多个图像,函数使用第一个图像的大小。
LR_MONOCHROME
创建一个单色图标或光标。
LR_SHARED
该图标或光标句柄,如果该图标或光标创建多次股份。如果LR_SHARED没有设置,第二个要求是相同的资源,以CreateIconFromResourceEx将创建图标或光标再次返回一个不同的处理。
当您使用此标志时,系统会破坏资源时,不再需要。
不要使用LR_SHARED的图标或游标非标准尺寸,可能有所变动,装货,或者是从文件加载。
当加载一个系统图标或光标,您必须使用LR_SHARED或函数将无法加载资源。
在Windows 95/98/Me:该函数查找与缓存请求的资源名称的第一个图像,无论大小的要求。
返回值
如果函数成功,返回值是一个句柄,图标或光标。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
该CreateIconFromResource,CreateIconFromResourceEx,CreateIconIndirect,GetIconInfo和LookupIconIdFromDirectoryEx功能允许外壳应用程序和浏览器的图标,审查和使用整个系统资源。
您应该要求与CreateIconFromResourceEx创建的图标DestroyIcon。
例如
有关示例,请参阅共享图标资源。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 4.0
UnicodeImplemented为Unicode版本。
参见
图标概述,CreateIconFromResource,位图信息,CreateIconIndirect,DestroyIcon,GetIconInfo,LoadResource,LookupIconIdFromDirectoryEx
==英文原文==CreateIconFromResourceEx Function
The CreateIconFromResourceEx function creates an icon or cursor from resource bits describing the icon.
Syntax
HICON CreateIconFromResourceEx( PBYTE pbIconBits,
DWORD cbIconBits,
BOOL fIcon,
DWORD dwVersion,
int cxDesired,
int cyDesired,
UINT uFlags
);
Parameters
pbIconBits
[in] Pointer to a buffer containing the icon or cursor resource bits. These bits are typically loaded by calls to the LookupIconIdFromDirectoryEx and LoadResource functions.
cbIconBits
[in] Specifies the size, in bytes, of the set of bits pointed to by the pbIconBits parameter.
fIcon
[in] Specifies whether an icon or a cursor is to be created. If this parameter is TRUE, an icon is to be created. If it is FALSE, a cursor is to be created.
dwVersion
[in] Specifies the version number of the icon or cursor format for the resource bits pointed to by the pbIconBits parameter. This parameter can be 0x00030000.
cxDesired
[in] Specifies the desired width, in pixels, of the icon or cursor. If this parameter is zero, the function uses the SM_CXICON or SM_CXCURSOR system metric value to set the width.
cyDesired
[in] Specifies the desired height, in pixels, of the icon or cursor. If this parameter is zero, the function uses the SM_CYICON or SM_CYCURSOR system metric value to set the height.
uFlags
[in] Specifies a combination of the following values:
LR_DEFAULTCOLOR
Uses the default color format.
LR_DEFAULTSIZE
Uses the width or height specified by the system metric values for cursors or icons, if the cxDesired or cyDesired values are set to zero. If this flag is not specified and cxDesired and cyDesired are set to zero, the function uses the actual resource size. If the resource contains multiple images, the function uses the size of the first image.
LR_MONOCHROME
Creates a monochrome icon or cursor.
LR_SHARED
Shares the icon or cursor handle if the icon or cursor is created multiple times. If LR_SHARED is not set, a second call to CreateIconFromResourceEx for the same resource will create the icon or cursor again and return a different handle.
When you use this flag, the system will destroy the resource when it is no longer needed.
Do not use LR_SHARED for icons or cursors that have non-standard sizes, that may change after loading, or that are loaded from a file.
When loading a system icon or cursor, you must use LR_SHARED or the function will fail to load the resource.
Windows 95/98/Me: The function finds the first image with the requested resource name in the cache, regardless of the size requested.
Return Value
If the function succeeds, the return value is a handle to the icon or cursor.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
The CreateIconFromResource , CreateIconFromResourceEx, CreateIconIndirect , GetIconInfo , and LookupIconIdFromDirectoryEx functions allow shell applications and icon browsers to examine and use resources throughout the system.
You should call DestroyIcon for icons created with CreateIconFromResourceEx.
Example
For an example, see Sharing Icon Resources .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 4.0
UnicodeImplemented as Unicode version.
See Also
Icons Overview , CreateIconFromResource , BITMAPINFOHEADER , CreateIconIndirect , DestroyIcon , GetIconInfo , LoadResource , LookupIconIdFromDirectoryEx
==原始网址==http://msdn.microsoft.com/en-us/library/ms648061(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:18:54