示例#1
0
        private void OnPaint()
        {
            var hdc = NativeMethods.GetDC(_hwnd);

            var rect = NativeMethodsSafe.GetWindowRect(_hwnd);

            rect.Left = 0;
            rect.Top  = 0;

            var color = new COLORREF(0xff, 0xff, 0xff);
            var brush = NativeMethods.CreateSolidBrush(color.Value);

            NativeMethods.FillRect(hdc, ref rect, brush);

            NativeMethods.DeleteObject(brush);

            NativeMethods.ReleaseDC(_hwnd, hdc);
        }
示例#2
0
 public RECT GetWindowRect()
 {
     return(NativeMethodsSafe.GetWindowRect(_hwnd));
 }