Function Reference


Loads the specified icon resource from the executable (.exe) file associated with an application instance

#include <WinAPIIcons.au3>
_WinAPI_LoadIcon ( $hInstance, $sName )


$hInstance A handle to an instance of the module whose executable file contains the icon to be loaded.
$sName The name of the icon resource to be loaded. Alternatively, if $hInstance is 0, it can be
one of the following predefined values.

Return Value

Success: The icon handle.
Failure: 0, call _WinAPI_GetLastError() to get extended error information.


_WinAPI_LoadIcon() loads the icon resource only if it has not been loaded; otherwise, it retrieves a
handle to the existing resource.

_WinAPI_LoadIcon() can only load an icon whose size conforms to the $SM_CXICON and $SM_CYICON system metric
values. Use the _WinAPI_LoadImage() function to load icons of other sizes.

When you are finished using the icon, destroy it using the _WinAPI_DestroyIcon() function.


_WinAPI_DestroyIcon, _WinAPI_LoadImage

See Also

Search LoadIcon in MSDN Library.