So I'm trying to get the right Device Context so I can set the gamma ramp on individual monitors in an N monitor configuration (2+).
I've tried
[DllImport("gdi32.dll")]
static extern IntPtr CreateDC(string lpszDriver, string lpszDevice, string lpszOutput, IntPtr lpInitData);
With this method I'm using the string "DISPLAY" for lpszDriver, I'm enumerating displays with another pInvoke method and getting the Display device name which ends up being something like "\Registry\Machine\System\CurrentControlSet\Control\Class{4d36e96e-e325-11ce-bfc1-08002be10318}\0042" and passing in as lpszDevice. lpszOutput is null and lpInitData is IntPtr.Zero. The hDC that comes back works, but seems to be global.
and
[DllImport("user32.dll")]
public static extern IntPtr GetDC(IntPtr hWnd);
With this method I've tried using the actual window form handle.
I'm using
[DllImport("gdi32.dll")]
private static extern int SetDeviceGammaRamp(IntPtr hDC, ref RAMP lpRamp);
It does set the gamma ramp, but it always sets both monitors. Any ideas?