Reducing the Need for Manual Reload of Color Calibration when Docking in Windows 7
May 3, 2011 11 Comments
Windows 7 has native support for monitor color calibration (though the OS X calibration wizard is more advanced). Unfortunately, at least with my MacBook Pro 5,3 and Apple Cinema display, Windows unloads the calibrations every time the external display is hot-plugged into my laptop. This forces me to go to Control Panel | Color Management | Advanced and click Reload current calibrations on a regular basis. I’ve even pinned this applet to my start menu for this purpose.
I’ve been looking for a command-line way to invoke this so that I can automate it and haven’t come up with anything other than possibly invoking colorcpl.exe and programmatically selecting the Advanced tab and sending a click to the Reload current calibrations button. However, poking around, I recently discovered that there is a scheduled task “\Microsoft\Windows\WindowsColorSystem\Calibration Loader”. This thing appears to do exactly what I want: reload the current calibrations.
The Action of the task is a “Custom Hander” which means it’s a COM handler. The XML definition of this task is in “%systemroot%\System32\Tasks\Microsoft\Windows\WindowsColorSystem\Calibration Loader”. Looking in there you will find the COM CLSID:
<Actions Context="Group"> <ComHandler> <ClassId>{B210D694-C8DF-490D-9576-9E20CDBC20BD}</ClassId> </ComHandler> </Actions>
I’ll have to dig into that at a later time.
Meanwhile, my main use-case is docking my laptop which usually has a closed lid or has just been re-opened so it is waking from sleep and locked. There are system events defined for those cases. The other case is just hot-plugging my monitor which is comparatively rare and doesn’t seem to generate an event. In any case, I can add the resume-from-sleep and workstation-unlocked events to the triggers for the calibration re-load task. This largely addresses my issues.
In Scheduled Tasks, navigate to \Microsoft\Windows\WindowsColorSystem and open Calibration Loader. Go to Triggers and add two new events to trigger the task.
Add On Wakeup Event Trigger
- Begin the task: On an event
- Basic
- Log: System
- Source: Power-Troubleshooter
- Event ID: 1
- [check] Delay task for: 5 seconds (optional, I’m experimenting with this)
Add On Workstation Unlock Event Trigger
- Begin the task: On workstation unlock
- Any user
Remaining Annoyances
If you have a MacBook and like to customize the brightness of your external Cinematic Display and/or you like have overridden the default behavior so that function keys behave like function keys rather than Mac OS X-like macro keys by default, then you find when you hot dock your settings aren’t respected. The problem is that when a monitor or keyboard is hot docked, the bootcamp.exe process that interfaces with the Apple system controller doesn’t apply your settings. The solution is to restart bootcamp.exe.
I have a simple convenience powershell script to restart bootcamp.exe.
get-process | where { $_.Name -eq 'bootcamp' } | stop-process start-process 'C:\Program Files\Boot Camp\Bootcamp.exe'
You may wish to have this also run on an event trigger. However, if you do, the annoyance is that it will litter your system tray with dead “Boot Camp” black diamond icons. I tend to have a powershell console open all the time, so I just invoke the script manually whenever I dock my monitor and keyboard.