网站首页  词典首页

请输入您要查询的函数:

 

术语 findresourceex
释义 FindResourceEx
语法:
HRSRC FindResourceEx( HMODULE hModule,
LPCTSTR lpType,
LPCTSTR lpName,
WORD wLanguage
);
FindResourceEx功能
决定了与指定的类型,名称资源的位置,并在指定的模块语言。
参数
hModule
[in]句柄模块的可执行文件中包含的资源。如果该参数为NULL,则函数用于创建搜索当前进程的模块。
lpType
[in]指向一个空结束的字符串指定的资源类型的名称。有关详细信息,请参见备注部分。对于标准资源类型,请参阅资源类型。
lpName
[in]指向一个空结束的字符串指定资源的名称。有关详细信息,请参见备注部分。
wLanguage
[in]指定的资源语言。如果该参数MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),当前的语言与调用线程相关的使用。
要指定的语言比目前的其他语言,使用MAKELANGID宏以创建此参数。有关更多信息,请参见MAKELANGID。
返回值
如果函数成功,返回值是一个句柄指定的资源的信息块。要获取的句柄资源,通过这句柄LoadResource函数。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
如果IS_INTRESOURCE(x)为真在x = lpType或lpName,x指定的类型或给定的资源名称整数标识符。否则,这些参数很长指针为空结束的字符串。如果字符串的第一个字符是英镑符号(#),其余的字符表示一个十进制数,指定该资源的名称或类型的整数标识符。例如,字符串“#258”代表258的整数标识符。
为了减少内存量所需的资源,应用程序应参考的整数,而不是标识符给它的名字。
应用程序可以使用FindResourceEx发现任何类型的资源,但这一职能应只用于如果应用程序必须访问二进制资源数据时,随后调用LockResource函数。
要立即使用资源,应用程序应使用以下资源的具体功能来查找和加载一个调用的资源。
FunctionAction
FormatMessage荷载和格式的消息,表项。
LoadAccelerators加载加速器表。
LoadBitmap加载位图资源。
LoadCursor加载游标资源。
LoadIcon加载一个图标资源。
LoadMenu加载菜单资源。
LoadString加载字符串表项。
例如,一个应用程序可以使用LoadIcon函数加载在屏幕上显示的图标。但是,应用程序应该使用FindResourceEx和LoadResource如果加载图标将其数据复制到另一个应用程序。
字符串资源存储在多达16个部分字符串部分。在每一节中的字符串存储为一个计算序列(不空终止)Unicode字符串。该LoadString函数将提取其相应部分中的字符串资源。
在Windows 95/98/Me:在lpType和lpName参数FindResourceExW不得字符串缓冲区从堆中分配。如有必要,将它们复制到堆栈缓冲区并通过堆栈缓冲区。
Windows 95/98/Me的:虽然FindResourceExW在Microsoft Windows 95,Windows 98的存在,和Windows Millennium Edition(Windows Me)中,它是支持的Unicode(MSLU)微软层提供更一致的行为在所有的Windows操作系统。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
例如
有关示例,请参阅创建资源列表。
功能信息
最低DLL版本 kernel32.dll
在Winbase.h HeaderDeclared,头文件:winuser.h
import libraryKernel32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
资源概况,FindResource,FormatMessage,IS_INTRESOURCE,LoadAccelerators,LoadBitmap,LoadCursor,LoadIcon,LoadMenu,LoadString,LoadResource,MAKELANGID
==英文原文==FindResourceEx Function
Determines the location of the resource with the specified type, name, and language in the specified module.
Syntax
HRSRC FindResourceEx( HMODULE hModule,
LPCTSTR lpType,
LPCTSTR lpName,
WORD wLanguage
);
Parameters
hModule
[in] Handle to the module whose executable file contains the resource. If this parameter is NULL, the function searches the module used to create the current process.
lpType
[in] Pointer to a null-terminated string specifying the type name of the resource. For more information, see the Remarks section below. For standard resource types, see Resource Types .
lpName
[in] Pointer to a null-terminated string specifying the name of the resource. For more information, see the Remarks section below.
wLanguage
[in] Specifies the language of the resource. If this parameter is MAKELANGID (LANG_NEUTRAL, SUBLANG_NEUTRAL), the current language associated with the calling thread is used.
To specify a language other than the current language, use the MAKELANGID macro to create this parameter. For more information, see MAKELANGID.
Return Value
If the function succeeds, the return value is a handle to the specified resource's information block. To obtain a handle to the resource, pass this handle to the LoadResource function.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
If IS_INTRESOURCE (x) is TRUE for x = lpType or lpName, x specifies the integer identifier of the type or name of the given resource. Otherwise, those parameters are long pointers to null-terminated strings. If the first character of the string is a pound sign (#), the remaining characters represent a decimal number that specifies the integer identifier of the resource's name or type. For example, the string "#258" represents the integer identifier 258.
To reduce the amount of memory required for a resource, an application should refer to it by integer identifier instead of by name.
An application can use FindResourceEx to find any type of resource, but this function should be used only if the application must access the binary resource data when making subsequent calls to the LockResource function.
To use a resource immediately, an application should use the following resource-specific functions to find and load the resources in one call.
FunctionAction
FormatMessage Loads and formats a message-table entry.
LoadAccelerators Loads an accelerator table.
LoadBitmap Loads a bitmap resource.
LoadCursor Loads a cursor resource.
LoadIcon Loads an icon resource.
LoadMenu Loads a menu resource.
LoadString Loads a string-table entry.
For example, an application can use the LoadIcon function to load an icon for display on the screen. However, the application should use FindResourceEx and LoadResource if it is loading the icon to copy its data to another application.
String resources are stored in sections of up to 16 strings per section. The strings in each section are stored as a sequence of counted (not null-terminated) Unicode strings. The LoadString function will extract the string resource from its corresponding section.
Windows 95/98/Me: The lpType and lpName parameters to FindResourceExW may not be string buffers allocated from the heap. If necessary, copy them to stack buffers and pass the stack buffers.
Windows 95/98/Me: Although FindResourceExW exists on Microsoft Windows 95, Windows 98, and Windows Millennium Edition (Windows Me), it is supported by the Microsoft Layer for Unicode (MSLU) to provide more consistent behavior across all Windows operating systems. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Example
For an example, see Creating a Resource List .
Function Information
Minimum DLL Versionkernel32.dll
HeaderDeclared in Winbase.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Resources Overview , FindResource , FormatMessage , IS_INTRESOURCE , LoadAccelerators , LoadBitmap , LoadCursor , LoadIcon , LoadMenu , LoadString , LoadResource , MAKELANGID
==原始网址==http://msdn.microsoft.com/en-us/library/ms648043(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:15:36