Kris Carron
2004-02-03 17:16:12 UTC
Hi
I'm trying to setup a new ICC monitor profile. According to the API docs I should first install the profile calling InstallColorProfile and afterwards associate the installed profile with the monitor using AssociateColorProfileWithDevice. The InstallColorProfile returns successfully and seems to have done it's job. After installation of the profile the profile appears in the registry under \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM\mntr as it should
The call to AssociateColorProfileWithDevice however fails. It returns FALSE. The weird think is that GetLastError returns 0, indicating that everything went well. The profile was not associated with the monitor. It doesn't appear in the Display Properties | Advanced | Color Management tab. Associating the same profile using the Display Properties Control Panel applet works just fine
The call to AssociateColorProfileWithDevice has only three parameters. I passed NULL for the first one, indicating the local machine. The second one is the fully qualified path of my profile. I'm ruling out these two as the cause of the failure; the first parameter is trivial and when passing an invalid path for the second parameter, GetLastError actually returns an error code indicating that it is invalid. So that leaves the third parameter which is a string specifying the device name. The API docs don't specify what that actually is in case of a monitor. I've used names like \\.\DISPLAY1, \\.\DISPLAY1\U0 , \\.DISPLAY1\Unit0 and several others probably not worth mentioning. All used names resulted in a failure with GetLastError equal to 0. I did pay attention to escaping the backslashes correctly, so that's not it - I think
Does anyone have any ideas as to what is going wrong here? Am I using the correct sequence of calls? Is something else missing
Just to be complete; I'm using Windows 2000 Professional with all latest updates and Visual Studio 6.0 (yeah, I know ;-) for building my C/C++ application
Thanks for your help
I'm trying to setup a new ICC monitor profile. According to the API docs I should first install the profile calling InstallColorProfile and afterwards associate the installed profile with the monitor using AssociateColorProfileWithDevice. The InstallColorProfile returns successfully and seems to have done it's job. After installation of the profile the profile appears in the registry under \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM\mntr as it should
The call to AssociateColorProfileWithDevice however fails. It returns FALSE. The weird think is that GetLastError returns 0, indicating that everything went well. The profile was not associated with the monitor. It doesn't appear in the Display Properties | Advanced | Color Management tab. Associating the same profile using the Display Properties Control Panel applet works just fine
The call to AssociateColorProfileWithDevice has only three parameters. I passed NULL for the first one, indicating the local machine. The second one is the fully qualified path of my profile. I'm ruling out these two as the cause of the failure; the first parameter is trivial and when passing an invalid path for the second parameter, GetLastError actually returns an error code indicating that it is invalid. So that leaves the third parameter which is a string specifying the device name. The API docs don't specify what that actually is in case of a monitor. I've used names like \\.\DISPLAY1, \\.\DISPLAY1\U0 , \\.DISPLAY1\Unit0 and several others probably not worth mentioning. All used names resulted in a failure with GetLastError equal to 0. I did pay attention to escaping the backslashes correctly, so that's not it - I think
Does anyone have any ideas as to what is going wrong here? Am I using the correct sequence of calls? Is something else missing
Just to be complete; I'm using Windows 2000 Professional with all latest updates and Visual Studio 6.0 (yeah, I know ;-) for building my C/C++ application
Thanks for your help