Color Management: Monitor profile changed notification for Windows?
Asked Answered
D

1

10

The Short Version:

I’m looking for the Windows API equivalent of the Cocoa – windowDidChangeBackingProperties: notification in the NSWindowDelegate protocol which is called when a window’s colorspace changes (when it’s moved to another monitor or when the monitor profile is change by the user).

Does anyone know what the equivalent API would be on Windows?

The Long Version:

I’m developing an app that is fully color managed. As such I need to be notified when the monitor’s color profile is changed or when the application window is moved to a different screen. On the Mac side this is easy, I just implement the – windowDidChangeBackingProperties: method for my window’s delegate and I’ll get notifications whenever the user drags the window to another monitor or whenever the global monitor profile is changed. Simple & easy. On the Windows side I don’t know how to get these notifications.

Currently I’m getting the monitor profile using the GetICMProfile() WCS (Windows Color System) function when the app starts up. I need some notification for when the monitor profile changes.

How do I receive monitor profile change notifications on Windows?

Bonus points for a notification for when the application window is moved from one monitor to another. I’d hope that there exists a notification for that, but if there isn’t I can probably figure it out by monitoring window moves.

Durmast answered 14/8, 2014 at 1:14 Comment(0)
P
1

A possible solution is to query the color profile with GetICMProfile() in some specific messages (WM_SHOWWINDOW, WM_ACTIVATE, and WM_EXITSIZEMOVE) and then to compare if the profile filename has changed (if the filename has changed, the current profile has changed too).

This is a shame, but it looks like the HWND doesn't receive a message when we change the color profile from the display settings, so the WM_ACTIVE partially solves that problem (when the window is clicked/activated, we can check if the color profile has changed).

Protoxide answered 3/12, 2018 at 21:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.