网站首页  词典首页

请输入您要查询的函数:

 

术语 findresource
释义 FindResource
语法:
HRSRC FindResource( HMODULE hModule,
LPCTSTR lpName,
LPCTSTR lpType
);
FindResource函数
决定了一个具有指定类型和在指定的模块名称资源的位置。
要指定语言,请使用FindResourceEx功能。
参数
hModule
[in]句柄模块的可执行文件中包含的资源。一个NULL值指定模块的图像文件的操作系统用于创建当前进程的相关处理。
lpName
[in]指定资源的名称。有关详细信息,请参见备注部分。
lpType
[in]指定的资源类型。有关详细信息,请参见备注部分。对于标准资源类型,请参阅资源类型。
返回值
如果函数成功,返回值是一个句柄指定的资源的信息块。要获取的句柄资源,通过这句柄LoadResource函数。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
如果IS_INTRESOURCE(x)为真在x = lpName或lpType,x指定的名称或给定的资源类型的整数标识符。否则,这些参数很长指针为空结束的字符串。如果字符串的第一个字符是英镑符号(#),其余的字符表示一个十进制数,指定该资源的名称或类型的整数标识符。例如,字符串“#258”代表258的整数标识符。
为了减少内存量所需的资源,应用程序应参考的整数,而不是标识符给它的名字。
应用程序可以使用FindResource发现任何类型的资源,但这一职能应只用于如果应用程序必须访问二进制资源数据时,后续调用LockResource。
要立即使用资源,应用程序应该使用下列其中一个资源的具体功能,找到并加载一个调用的资源。
FunctionAction
FormatMessage荷载和格式的消息,表项。
LoadAccelerators加载加速器表。
LoadBitmap加载位图资源。
LoadCursor加载游标资源。
LoadIcon加载一个图标资源。
LoadMenu加载菜单资源。
LoadString加载字符串表项。
例如,一个应用程序可以使用LoadIcon函数加载在屏幕上显示的图标。但是,应用程序应该使用FindResource和LoadResource如果加载图标将其数据复制到另一个应用程序。
字符串资源存储在多达16个部分字符串部分。在每一节中的字符串存储为一个计算序列(不空终止)Unicode字符串。该LoadString函数将提取其相应部分中的字符串资源。
在Windows 95/98/Me:在lpType和lpName参数FindResourceW不得字符串缓冲区从堆中分配。如有必要,将它们复制到堆栈缓冲区并通过堆栈缓冲区。
Windows 95/98/Me: Although FindResourceW 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.要使用此,您必须将某些文件到您的应用,概述了对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版本。
参见
资源概况,FindResourceEx,FormatMessage,IS_INTRESOURCE,LoadAccelerators,LoadBitmap,LoadCursor,LoadIcon,LoadMenu,LoadResource,LoadString,LockResource,SizeofResource
==英文原文==FindResource Function
Determines the location of a resource with the specified type and name in the specified module.
To specify a language, use the FindResourceEx function.
Syntax
HRSRC FindResource( HMODULE hModule,
LPCTSTR lpName,
LPCTSTR lpType
);
Parameters
hModule
[in] Handle to the module whose executable file contains the resource. A value of NULL specifies the module handle associated with the image file that the operating system used to create the current process.
lpName
[in] Specifies the name of the resource. For more information, see the Remarks section below.
lpType
[in] Specifies the resource type. For more information, see the Remarks section below. For standard resource types, see Resource Types .
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 = lpName or lpType, x specifies the integer identifier of the name or type 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 FindResource 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 LockResource .
To use a resource immediately, an application should use one of 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 FindResource 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 FindResourceW 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 FindResourceW 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 Updating Resources .
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 , FindResourceEx , FormatMessage , IS_INTRESOURCE , LoadAccelerators , LoadBitmap , LoadCursor , LoadIcon , LoadMenu , LoadResource , LoadString , LockResource , SizeofResource
==原始网址==http://msdn.microsoft.com/en-us/library/ms648042(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:43