网站首页  词典首页

请输入您要查询的函数:

 

术语 loadresource
释义 LoadResource
语法:
HGLOBAL LoadResource( HMODULE hModule,
HRSRC hResInfo
);
LoadResource函数
加载到全局内存指定的资源。
参数
hModule
[in]句柄模块的可执行文件中包含的资源。如果hModule为NULL,系统加载的是用来创建当前进程模块的资源。
hResInfo
[in]句柄资源加载。这种处理是由FindResource或FindResourceEx函数返回。
返回值
如果函数成功,返回值是一个处理与资源相关的数据。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
在LoadResource返回类型是HGLOBAL为了向后兼容,而不是因为函数返回的句柄全局内存块。不要通过这句柄GlobalLock或GlobalFree函数。要获得一个指向资源数据,调用LockResource函数。
要立即使用资源,应用程序应使用以下资源的具体功能来查找和加载一个调用的资源。
FunctionActionTo删除资源
FormatMessage荷载和格式化信息表entryNo需要采取的行动
LoadAccelerators加载加速器tableDestroyAcceleratorTable
LoadBitmap加载位图resourceDeleteObject
LoadCursor加载一个游标resourceDestroyCursor
LoadIcon加载一个图标resourceDestroyIcon
LoadMenu加载菜单resourceDestroyMenu
LoadString加载字符串resourceNo需要采取的行动
例如,一个应用程序可以使用LoadIcon函数加载在屏幕上显示的图标,然后由DestroyIcon完成时。
该系统将自动删除这些资源的过程时,创建它们的终止,但是,调用适当的函数可以节省内存和减少了进程的工作集大小。
例如
举一个例子见更新资源。
功能信息
最低DLL版本 kernel32.dll
在Winbase.h HeaderDeclared,头文件:winuser.h
import libraryKernel32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
资源概况,FindResource,FindResourceEx,调用LoadLibrary,LoadModule伪,LockResource
==英文原文==LoadResource Function
Loads the specified resource into global memory.
Syntax
HGLOBAL LoadResource( HMODULE hModule,
HRSRC hResInfo
);
Parameters
hModule
[in] Handle to the module whose executable file contains the resource. If hModule is NULL, the system loads the resource from the module that was used to create the current process.
hResInfo
[in] Handle to the resource to be loaded. This handle is returned by the FindResource or FindResourceEx function.
Return Value
If the function succeeds, the return value is a handle to the data associated with the resource.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
The return type of LoadResource is HGLOBAL for backward compatibility, not because the function returns a handle to a global memory block. Do not pass this handle to the GlobalLock or GlobalFree function. To obtain a pointer to the resource data, call the LockResource function.
To use a resource immediately, an application should use the following resource-specific functions to find and load the resource in one call.
FunctionActionTo remove resource
FormatMessage Loads and formats a message-table entryNo action needed
LoadAccelerators Loads an accelerator tableDestroyAcceleratorTable
LoadBitmap Loads a bitmap resourceDeleteObject
LoadCursor Loads a cursor resourceDestroyCursor
LoadIcon Loads an icon resourceDestroyIcon
LoadMenu Loads a menu resourceDestroyMenu
LoadString Loads a string resourceNo action needed
For example, an application can use the LoadIcon function to load an icon for display on the screen, followed by DestroyIcon when done.
The system automatically deletes these resources when the process that created them terminates; however, calling the appropriate function saves memory and decreases the size of the process's working set.
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 Unicode version.
See Also
Resources Overview , FindResource , FindResourceEx , LoadLibrary , LoadModule , LockResource
==原始网址==http://msdn.microsoft.com/en-us/library/ms648046(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:22:51