Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsICMModuleMBS module.

WindowsICMModuleMBS.AssociateColorProfileWithDevice(ProfileName as string, DeviceName as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The AssociateColorProfileWithDevice function associates a specified color profile with a specified device.

ProfileName: The file name of the profile to associate.
DeviceName: The name of the device to associate.

Returns true on success and false on failure.

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 SetUsePerUserProfiles had been called for Device with the usePerUserProfiles parameter set to TRUE.

WindowsICMModuleMBS.DisassociateColorProfileFromDevice(ProfileName as string, DeviceName as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The DisassociateColorProfileFromDevice function disassociates a specified color profile with a specified device on a specified computer.

Returns true on success and false on failure.

ProfileName: The file name of the profile to disassociate.
DeviceName: The name of the device to disassociate.

If more than one profile is associated with a device, WCS uses the last one associated as the default. That is, if your application sequentially associates three profiles with a device, WCS will use the last one associated as the default. If your application then calls the DisassociateColorProfileFromDevice function to disassociate the third profile (which is the default in this example), the WCS will use the second profile as the default.

If your application disassociates all profiles from a device, WCS uses the sRGB profile as the default.

DisassociateColorProfileFromDevice always removes the specified profile from the current user's per-user profile association list for the specified device. Before removing the profile from the list, DisassociateColorProfileFromDevice determines whether the user has previously expressed the desire to use a per-user profile association list for the device. If so, then DisassociateColorProfileFromDevice simply removes the specified profile from the existing per-user profile association list for the device. If not, then DisassociateColorProfileFromDevice creates a new per-user profile association list for the device by copying the system-wide association list for that device. It then removes the specified profile from 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 SetUsePerUserProfiles had been called for Device with the usePerUserProfiles parameter set to TRUE.

WindowsICMModuleMBS.EnumColorProfiles(criterias as WindowsICMEnumMBS) as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The EnumColorProfiles function enumerates all the profiles satisfying the given enumeration criteria.
Example
dim c as new WindowsICMEnumMBS // no options set

dim a(-1) as string = WindowsICMModuleMBS.EnumColorProfiles(c)

for each s as string in a
MsgBox s
next

On success the function returns an array of profile names.

Several profiles are typically associated with printers, based on the paper and ink types. There is a default profile for each device. For International Color Consortium (ICC) profiles, GDI selects the best one from the ICC-associated profiles when your application creates a device context (DC).

Do not attempt to use EnumColorProfiles to determine the default profile for a device. Instead, create a device context for the device and then invoke the GetICMProfile function. On Windows Vista and Windows 7, the WcsGetDefaultColorProfile function can also be used to determine a device's default color profile.

If the Fields member of WindowsICMEnumMBS that is pointed to by the criterias parameter is set to ET_DEVICENAME, this function will enumerate all of the color profiles associated with all types of devices attached to the user's computer, regardless of the device class. If the Fields member is set to ET_DEVICENAME or ET_DEVICECLASS and a device class is specified in the DeviceClass member, this function will only enumerate the profiles associated with the specified device class. If the Fields member is set only to ET_DEVICECLASS, the EnumColorProfiles function will enumerate all profiles that can be associated with that type of device.

Whenever EnumColorProfiles is examining the profiles associated with a specific device, the results depend on whether the user has chosen to use the system-wide list of profiles associated with that device, or his or her own ("per-user") list. Calling SetUsePerUserProfiles with its usePerUserProfiles parameter set to TRUE causes future calls to EnumColorProfiles to look at only the current user's per-user list of profile associations for the specified device. Calling WcsSetUsePerUserProfiles with its usePerUserProfiles parameter set to FALSE causes future calls to EnumColorProfiles to look at the system-wide list of profile associations for the specified device. If SetUsePerUserProfiles has never been called for the current user, EnumColorProfiles examines the system-wide list.

This function will provide the information for converting WCS-specific DMP information to the legacy EnumType record in enable consistent profile enumeration. The defaults will be the same as ICC if this information is not present.

Per-user/LUA support

The enumeration is specific to current user. Both system wide and current user device associations are considered. For default profile configuration, current user settings override system wide ones.

Some examples using this method:

WindowsICMModuleMBS.GetColorDirectory as folderitem

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The GetColorDirectory function retrieves the path of the Windows COLOR directory on a specified machine.
Example
dim f as FolderItem = WindowsICMModuleMBS.GetColorDirectory

if f=nil then
MsgBox "No path?"
else
MsgBox f.NativePath
end if

On success returns folderitem for color directory. Returns nil on any error.

Some examples using this method:

WindowsICMModuleMBS.GetStandardColorSpaceProfile(ProfileID as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The GetStandardColorSpaceProfile function retrieves the color profile registered for the specified standard color space.
Example
MsgBox WindowsICMModuleMBS.GetStandardColorSpaceProfile(WindowsICMModuleMBS.LCS_WINDOWS_COLOR_SPACE)

ProfileID: Specifies the ID value of the standard color space for which to retrieve the profile. The only valid values for this parameter are LCS_sRGB and LCS_WINDOWS_COLOR_SPACE.

This function supports Windows Color System (WCS) device model profiles (DMPs) in addition to International Color Consortium (ICC) profiles. It does not support WCS CAMP or GMMP profiles and will return an error if such profiles are used.

Overview of Windows Vista Specific Functionality

This will support WCS DMPs in addition to ICC profiles. It will not support WCS CAMP or GMMP profiles and will return an error if such profiles are used with this API.

Per-user/LUA support

This will retrieve the color profile registered for the given standard color space for current user. If there is no such setting for the current user, it retrieves the system wide setting.

This uses WcsGetDefaultColorProfile with WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER.

This is executable in LUA context.

Some examples using this method:

WindowsICMModuleMBS.InstallColorProfile(file as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The InstallColorProfile function installs a given profile for use on a specified machine.

The profile is also copied to the COLOR directory.
Returns true on success and false on failure.

WindowsICMModuleMBS.RegisterCMM(cmmID as Integer, file as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
RegisterCMM associates a specified identification value with the specified color management module dynamic link library (CMM DLL).

When this ID appears in a color profile, Windows can then locate the corresponding CMM so as to create a transform.

cmmID: Specifies the ID signature of the CMM registered with the International Color Consortium (ICC).

file: Points to the CMM DLL.

Returns true on success and false on failure.

WindowsICMModuleMBS.SelectCMM(cmmID as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
SelectCMM allows an application to select the preferred color management module (CMM) to use.

cmmID: Specifies the signature of the desired CMM as registered with the International Color Consortium (ICC).

Windows 2000 only: Setting this parameter to 0 causes the WCS system to select the default CMM.

Returns true on success and false on failure.

WindowsICMModuleMBS.SetStandardColorSpaceProfile(ProfileID as Integer, ProfileName as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The SetStandardColorSpaceProfile function registers a specified profile for a given standard color space.

The profile can be queried using GetStandardColorSpaceProfile.

ProfileID: Specifies the ID value of the standard color space that the given profile represents.
Profilename: path to the profile file.

Returns true on success and false on failure.

The profile must already be installed on the system before it can be registered for a standard color space.

This function supports Windows Color System (WCS) device model profiles (DMPs) in addition to International Color Consortium (ICC) profiles. It does not support WCS CAMP or GMMP profiles and will return an error if such profiles are used.

Per-user/LUA support

This will register a specified profile for a given standard color space only for current user.

This uses SetDefaultColorProfile with WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER.

This is executable in LUA context if the profile is already installed, fails otherwise with access denied since install is system-wide and requires administrator privileges.

WindowsICMModuleMBS.UninstallColorProfile(ProfileName as string, DeleteFile as boolean = true) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
UninstallColorProfile removes a specified color profile from a specified computer. Associated files are optionally deleted from the system.

ProfileName: Points to the file name of the profile to uninstall.

DeleteFile: If set to true, the function deletes the profile from the COLOR directory. If set to false, this function has no effect.

Returns true on success and false on failure.

WindowsICMModuleMBS.UnregisterCMM(cmmID as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The UnregisterCMM function dissociates a specified ID value from a given color management module dynamic-link library (CMM DLL).

cmmID: Specifies the ID value identifying the CMM whose registration is to be removed. This is the signature of the CMM registered with the International Color Consortium (ICC).

Returns true on success and false on failure.

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...