Discussion:
AssociateColorProfileWithDevice fails
(too old to reply)
Kris Carron
2004-02-03 17:16:12 UTC
Permalink
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
Louis Solomon [SteelBytes]
2004-02-04 01:46:32 UTC
Permalink
maybe use EnumDisplayDevices to get the device name for the display.
--
Louis Solomon
www.steelbytes.com
Post by Kris Carron
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.
Kris Carron
2004-02-04 10:31:06 UTC
Permalink
Sorry, I forgot to mention that I tried EnumDisplayDevices already. On my system the first call returns \\.\DISPLAY1 for the adapter name. The second call, using that name as the first parameter returns \\.\DISPLAY1\Monitor0 for the display name

I used both in the call to AssociateColorProfileWithDevice but with no luck

- Kris
gaj
2013-05-09 20:31:22 UTC
Permalink
Kris Carron wrote on 02/03/2004 12:16 ET
Post by Kris Carron
H
I'm trying to setup a new ICC monitor profile. According to the API docs
should first install the profile calling InstallColorProfile and afterward
associate the installed profile with the monitor usin
AssociateColorProfileWithDevice. The InstallColorProfile returns successfull
and seems to have done it's job. After installation of the profile th
profil
Post by Kris Carron
appears in the registry under HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindow
NTCurrentVersionICMmntr as it shoul
The call to AssociateColorProfileWithDevice however fails. It returns FALSE
The weird think is that GetLastError returns 0, indicating that everythin
wen
Post by Kris Carron
well. The profile was not associated with the monitor. It doesn't appear i
the Display Properties | Advanced | Color Management tab. Associating th
sam
Post by Kris Carron
profile using the Display Properties Control Panel applet works just fin
The call to AssociateColorProfileWithDevice has only three parameters.
passed NULL for the first one, indicating the local machine. The second on
i
Post by Kris Carron
the fully qualified path of my profile. I'm ruling out these two as the caus
of the failure; the first parameter is trivial and when passing an invali
pat
Post by Kris Carron
for the second parameter, GetLastError actually returns an error cod
indicating that it is invalid. So that leaves the third parameter which is
string specifying the device name. The API docs don't specify what tha
actually is in case of a monitor. I've used names like .DISPLAY1
.DISPLAY1U0 , .DISPLAY1Unit0 and several others probably not wort
mentioning. All used names resulted in a failure with GetLastError equal t
0
Post by Kris Carron
I did pay attention to escaping the backslashes correctly, so that's not it
I thin
Does anyone have any ideas as to what is going wrong here? Am I using th
correct sequence of calls? Is something else missin
Just to be complete; I'm using Windows 2000 Professional with all lates
updates and Visual Studio 6.0 (yeah, I know ;-) for building my C/C+
applicatio
Thanks for your hel
did you get any solution to your problem i am getting same problem, install i
working fine but my profile is not getting associated with //./Display1
Loading...