Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

This function reads an image file, decompresses it, and returns a handle to a bitmap in memory.

Syntax

HBITMAP SHLoadImageFile (
  LPCTSTR 
pszFileName
);

Parameters

pszFileName

[in] The name of the image file to be loaded.

Return Value

A handle to a bitmap if successful, NULL otherwise.

Remarks

This function converts files of several types, including GIF (Graphics Interchange Format), PNG (Portable Network Graphics), JPG (Joint Photographic Experts Group), ICO (icon), and BMP (bitmap) file formats. Other image file types may be supported if the correct decoder is installed.

When you no longer need the bitmap, call the DeleteObjectfunction to delete it.

Requirements

Header aygshell.h
Library aygshell.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Pocket PC for Windows Mobile 2003 and later

See Also

Reference

Shell Functions