public static void SetBkModeChecked(HDC hdc, Gdi32BackgroundMode mode) { Gdi32BackgroundMode oldMode = SetBkMode(hdc, mode); // todo: is it worth checking? if (oldMode == Gdi32BackgroundMode.ERROR) { throw new InvalidOperationException($"{nameof(SetBkMode)} failed. Mode: {mode}."); } }
private static extern Gdi32BackgroundMode SetBkMode(HDC hdc, Gdi32BackgroundMode mode);