[This is preliminary documentation and subject to change.]
The ICM 2.0 Programmer's Reference includes a sample application, ICMView. It serves both as a functioning application for demonstrating what color mapping accomplishes, and a programming example illustrating the use of many of the ICM 2.0 functions.
ICMView is unusual in that it implements color management both inside and outside of the device context. This is helpful for demonstration purposes, but not characteristic of most real-world applications. In general, an application would be likely to use one strategy or the other, not both.
Much of the sample code is dedicated to creating a normal Windows application. Of particular interest to programmers concerned with color management using ICM 2.0 are the user-defined DIBPaint function in Dibs.c and the user-defined PrintImage function in Print.c.
DIBPaint illustrates using ICM functions to perform color management within a device context. PrintImage, on the other hand, performs color management outside the device context. It is worth noting that in a more complex application, the printer output profile should be reset every time an end-of-page occurs.