[This is preliminary documentation and subject to change.]
The GetICMProfile function retrieves the file name of the current output color profile for a specified device context.
BOOL WINAPI GetICMProfile(
HDC hDC,
LPDWORD lpcbName,
LPTSTR lpszFilename
);
If this function succeeds, the return value is TRUE. It also returns TRUE if the lpszFilename parameter is NULL and the size required for the buffer is copied into lpcbName.
If this function fails, the return value is FALSE.
GetICMProfile obtains the file name of the current output profile regardless of whether or not color management is enabled for the device context.
Given a device context, GetICMProfile will output, through the parameter lpszFilename, the path name of the file containing the color profile currently being used by the device context. It will also output, through the parameter lpcbName, the length of the string containing the path name.
It is possible that the profile name returned by GetICMProfile will not be in the list of profiles returned by EnumICMProfiles. The EnumICMProfiles function returns all color space profiles that are associated with a device context (DC) whose settings match that of the DC. If the SetICMProfile function is used to set the current profile, a profile may be associated with the DC that does not match its settings. For instance, the SetICMProfile function can be used to associate the device-independent sRGB profile with a DC. This profile will be used as the current ICM profile for that DC, and calls to GetICMProfile will return its file name. However, the profile will not appear in the list of profiles that is returned from EnumICMProfiles.
If this function is called before any calls to the SetICMProfile function, it can be used to get the default profile for a device context.
Windows NT: Requires version 4.0 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in wingdi.h.
Import Library: Use gdi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Color Management Overview, ICM 2.0 Functions, EnumICMProfiles, SetICMProfile