Export (0) Print
Expand All

OleMetafilePictFromIconAndLabel function

Creates a metafile in which the specified icon and label are drawn.

Syntax


HGLOBAL OleMetafilePictFromIconAndLabel(
  _In_  HICON hIcon,
  _In_  LPOLESTR lpszLabel,
  _In_  LPOLESTR lpszSourceFile,
  _In_  UINT iIconIndex
);

Parameters

hIcon [in]

Handle to the icon that is to be drawn into the metafile. This parameter can be NULL. If hIcon is NULL, this function returns NULL without creating a metafile.

lpszLabel [in]

The icon label. This parameter can be NULL. If lpszLabel is NULL, the resulting metafile will not include a label.

lpszSourceFile [in]

The path and file name of the icon file. This string can be obtained through the user interface or from the registration database. This parameter can be NULL.

iIconIndex [in]

The location of the icon within the file named by lpszSourceFile, expressed as an offset in bytes from the beginning of file.

Return value

A global handle to a METAFILEPICT structure containing the icon and label. The metafile uses the MM_ANISOTROPIC mapping mode.

If an error occurs, the returned handle is NULL. In this case, the caller can call GetLastError to obtain further information.

Remarks

This function is called by OleGetIconOfFile and OleGetIconOfClass.

If lpszSourceFile is not NULL and iIconIndex is not 0, the name of the source file passed in lpszSourceFile and the index passed by iIconIndex are added to the created metafile as a comment record.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ole2.h

Library

Ole32.lib

DLL

Ole32.dll

See also

OleGetIconOfClass
OleGetIconOfFile

 

 

Community Additions

ADD
Show:
© 2014 Microsoft