MImgLoadFromFileInfo

Functions ››
Parent Previous Next

hImage = MImgLoadFromFileInfo( sFile, nFlags )

Loads the icon that is associated with a file, a file extension or a folder.

Parameters
sFile
String: The name of the file/folder, the file extension ( e.g. ".bmp" ) or STRING_Null to load the default icon for a folder.
Additionally, you can specify one of the following constants to load the icon of a special folder:

MIMG_FI_SPECIAL_CONTROLPANEL

Virtual folder containing icons for the Control Panel applications

MIMG_FI_SPECIAL_FAVORITES

Folder containing the favorites

MIMG_FI_SPECIAL_INTERNET

Virtual folder representing the Internet

MIMG_FI_SPECIAL_MYCOMPUTER

My Computer

MIMG_FI_SPECIAL_MYDOCUMENTS

My Documents

MIMG_FI_SPECIAL_NETWORK

Network Neighborhood folder

MIMG_FI_SPECIAL_PRINTERS

Virtual folder containing installed printers

MIMG_FI_SPECIAL_PROGRAMS

File system directory that contains the directories for the common program groups that appear on the Start menu for all users

MIMG_FI_SPECIAL_RECENT

File system directory that contains the user's most recently used documents

MIMG_FI_SPECIAL_RECYCLEBIN

Recycle Bin

nFlags
Number: Any combination of the following constants:

MIMG_FI_ICON_LARGE

Loads the large icon

MIMG_FI_ICON_SMALL

Loads the small icon

MIMG_FI_ICON_OPEN

Causing the function to load the file's open icon. A container object displays an open icon to indicate that the container is open, e.g. a folder

Of course it makes no sense to use MIMG_FI_ICON_LARGE and MIMG_FI_ICON_SMALL together.

Return
Number: Handle of the image or 0 if an error occurs

Example

! Get the Excel icon
Set hImage = MImgLoadFromFileInfo( "C:\\Program Files\\Microsoft Office\\Excel.exe", MIMG_FI_ICON_SMALL )
! Get the icon for bitmaps
Set hImage = MImgLoadFromFileInfo( ".bmp", MIMG_FI_ICON_SMALL )
! Get the recycle bin's icon
Set hImage = MImgLoadFromFileInfo( MIMG_FI_SPECIAL_RECYCLEBIN, MIMG_FI_ICON_SMALL )
! Get the icon for open folders
Set hImage = MImgLoadFromFileInfo( STRING_Null, MIMG_FI_ICON_SMALL | MIMG_FI_ICON_OPEN )

See also
Load functions

Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web sites