Reducing the Need for Manual Reload of Color Calibration when Docking in Windows 7

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

resume-from-sleep

  • 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

on-workstation-unlock

  • 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.

Advertisement

11 Responses to Reducing the Need for Manual Reload of Color Calibration when Docking in Windows 7

  1. Booyah says:

    Thanks for this post! I was keeping my Spyder3 unit hooked up for the sake of running the monitor (which took care of applying the profiles). More often than not it would just fail for no reason so I’d have to restart. I’ve been waiting for something like this.

    One less program to be running, one less device to draw power 🙂

  2. herbert says:

    do you have any idea how to execute the loader manually by command line instead of triggering using event triggers by now ?!

    thanks

  3. Awesome, mate! You rock.

    • BTW, the “eventcreate” command allows you to create an event yourself. If you add a trigger to the “Calibration Loader” task that listens for your custom-thrown event, you can make the calibration loader kick in by just invoking a VBS script containing the “eventcreate” invocation (double-click on Windows is enough).
      The VBS script needs to run in administrator mode, though. Luckily there are ways to make it automatically elevate to administrator level.

  4. Benjamin says:

    Brian, thanks for this article. I have the same issue with a pure Windows Fujitsu laptop at work. However, I haven’t got the permissions to change scheduled tasks on my work laptop. Is there a way to invoke the command manually via command line or something similar?

    Best, Benjamin

  5. Arne says:

    It is possible to generate and use an event log entry to reload the color calibration, at least with Windows 10.

    This requires the activation of some system audit policies:

    Open the Local Group Policy Editor and navigate to:
    Computer Configuration > Windows Settings > Security Settings > Advanced Audit Policy Configuration > System Audit Policies – Local Group Policies > Detailed Tracking

    Change the properties of “Audit PNP activity” to “[x] Configure the following audit events:” “[x] Success”

    Now you will find an Event ID 6414 in the “Security” log (underneath “Windows Logs”) every time a Plug and Play Event occurs, which you add as a trigger for the Calibration Loader task.

    Since there are a lot of 6141 events, you will want to create a Custom event and manually edit the XML query in the XML tab:

    *[System/Provider[@Name=’Microsoft-Windows-Security-Auditing’] and EventData/Data[@Name=’DeviceID’]=’DISPLAY\DELA02C\4&53C4C18&0&UID200195′]

    Replace the DeviceID with the ID of your external monitor in the XPath query above. You can find the DeviceID in the Device Manager: Open the Properties of your Monitor, bring up the Details tab, and select the Property “Device Instance Path”. Replace any & with & and your Color calibration should be updated every time you connect this monitor.

  6. Jeff says:

    Thank you! But what is the Source and Event ID for a monitor resuming from sleep? A monitor sleeping/waking is enough to unload the calibration profiles on my system.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: