AssociateColorProfileWithDevice
The AssociateColorProfileWithDevice function associates a specified color profile with a specified device.
BOOL WINAPI AssociateColorProfileWithDevice(
PCTSTR pMachineName, // reserved, must be NULL
PCTSTR pProfileName, // file name containing device profile
PCTSTR pDeviceName // name of device
);
Parameters
- pMachineName
Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to associate the specified profile and device. A NULL pointer indicates the local machine. - pProfileName
Points to the file name of the profile to associate. - pDeviceName
Points to the name of the device to associate.
Return Values
If this function succeeds, the return value is TRUE.
If this function fails, the return value is FALSE. For extended error information, call GetLastError.
Remarks
The AssociateColorProfileWithDevice function will fail if the profile has not been installed on the computer using the InstallColorProfile function.
Note that under Windows (Windows 95 or later), the PostScript device driver for printers assumes a CMYK color model. Therefore, all PostScript printers must use a CMYK color profile. Windows 2000 does not have this limitation.
If the specified device is a monitor, this function updates the default profile.
Several profiles are typically associated with printers, based on paper and ink types. There is no default. The GDI selects the best one from the associated profiles when your application creates a device context (DC).
Scanners also have no default profile. However, it is atypical to associate more than one profile with a scanner.
AssociateColorProfileWithDevice always adds the specified profile to the current user's per-user profile association list for the specified device. Before adding the profile to the list, AssociateColorProfileWithDevice determines whether the user has previously expressed the desire to use a per-user profile association list for the device. If so, then AssociateColorProfileWithDevice simply adds the specified profile to the existing per-user profile association list for the device. If not, then AssociateColorProfileWithDevice creates a new per-user profile association list for the device by copying the system-wide association list for that device. It then appends the specified profile to the per-user list. From that point on, the current user will be using a per-user profile association list for the specified device, as if WcsSetUsePerUserProfiles had been called for pDevice with the usePerUserProfiles parameter set to TRUE.
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.
** Unicode:** Implemented as Unicode and ANSI versions on Windows 2000/XP/Vista.
See Also
Basic Color Management Concepts, Functions, DisassociateColorProfileFromDevice