The AssociateColorProfileWithDevice function associates a specified color profile with a specified device.
BOOL WINAPI AssociateColorProfileWithDevice( PCTSTR pMachineName, PCTSTR pProfileName, PCTSTR pDeviceName );
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.
Points to the file name of the profile to associate.
Points to the name of the device to associate.
If this function succeeds, the return value is TRUE.
If this function fails, the return value is FALSE. For extended error information, call GetLastError.
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.
Minimum supported client
|Windows 2000 Professional|
Minimum supported server
|Windows 2000 Server|
Unicode and ANSI names
|AssociateColorProfileWithDeviceW (Unicode) and AssociateColorProfileWithDeviceA (ANSI)|
Build date: 11/16/2010