GetColorProfileFromHandle

Given a handle to an open color profile, the GetColorProfileFromHandle function will copy the contents of the profile into a buffer supplied by the application. If the handle is a Windows Color System (WCS) handle, then the DMP is returned and the CAMP and GMMP associated with the HPROFILE are ignored.

BOOL WINAPI GetColorProfileFromHandle(
  HPROFILE hProfile,  PBYTE pBuffer,  PDWORD pcbSize);

Parameters

  • hProfile
    Handle to an open color profile. The function determines whether the HPROFILE contains ICC or WCS profile information.
  • pBuffer
    Pointer to buffer to receive raw ICC or DMP profile data. Can be NULL. If it is, the size required for the buffer will be stored in the memory location pointed to by pcbSize. The buffer can be allocated to the appropriate size, and this function called again with pBuffer containing the address of the buffer.
  • pcbSize
    Pointer to a DWORD that holds the size of buffer pointed at by pBuffer. On return it is filled with size of buffer that was actually used if the function succeeds. If this function is called with pBuffer set to NULL, this parameter will contain the size of the buffer required.

Return Values

If this function succeeds, the return value is TRUE. It returns FALSE if the pBuffer parameter is NULL and the size required for the buffer is copied into pcbSize.

If this function fails, the return value is FALSE. For extended error information, call GetLastError.

Requirements

**  Windows Vista:** Support for WCS profiles included in Windows Vista and later.
**  Windows NT/2000/XP:** Support for ICC profiles included in Windows 2000 and later.
**  Windows 95/98/Me:** Support for ICC profiles included in Windows 98 and later.
**  Header:** Declared in Icm.h.
**  Library:** Use Mscms.lib.

See Also

Basic Color Management Concepts, Functions