A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/windows/desktop/api/libloaderapi/nf-libloaderapi-loadresource below:

LoadResource function (libloaderapi.h) - Win32 apps

Retrieves a handle that can be used to obtain a pointer to the first byte of the specified resource in memory.

Syntax
HGLOBAL LoadResource(
  [in, optional] HMODULE hModule,
  [in]           HRSRC   hResInfo
);
Parameters

[in, optional] hModule

Type: HMODULE

A 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.

[in] hResInfo

Type: HRSRC

A handle to the resource to be loaded. This handle is returned by the FindResource or FindResourceEx function.

Return value

Type: HGLOBAL

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.

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 first byte of the resource data, call the LockResource function; to obtain the size of the resource, call SizeofResource.

GlobalSize returns 0 for a resource HGLOBAL. As a result, any APIs that depend on GlobalSize to determine the size of the HGLOBAL will not function correctly. For example, use SHCreateMemStream instead of CreateStreamOnHGlobal.

To use a resource immediately, an application should use the following resource-specific functions to find and load the resource in one call.

For example, an application can use the LoadIcon function to load an icon for display on the screen, followed by DestroyIcon when done.

Examples

For an example see Updating Resources.

Requirements Requirement Value Minimum supported client Windows 2000 Professional [desktop apps only] Minimum supported server Windows 2000 Server [desktop apps only] Target Platform Windows Header libloaderapi.h (include Windows.h) Library Kernel32.lib DLL Kernel32.dll See also

FindResource

FindResourceEx

LoadLibrary

LoadModule

LockResource


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4