//=================================================
[DllImport("coredll.dll")]
internal static extern int GetDeviceCaps(
IntPtr hdc,
int nIndex);
[DllImport("coredll.dll")]
internal extern static IntPtr GetDC( IntPtr windowHandle );
[DllImport("coredll.dll")]
internal static extern int ReleaseDC(
IntPtr hWnd,
IntPtr hDC );
internal const int BITSPIXEL = 12;
public static bool IsMonoScreen()
{
//Get Screen DC
IntPtr hDC = GetDC(IntPtr.Zero);
//Get number of bits per pixel
int ires = GetDeviceCaps(hDC, BITSPIXEL);
ReleaseDC(IntPtr.Zero, hDC);
//If it's less than 4 it should be a B&W
if (ires > 4)
return false;
else
return true;
}
//===========================================
[8D]
Alex Yakhnin, eMVP
IntelProg, Inc.
http://www.intelprog.com