BUG: Rectangle Fails with Certain ROP2 Codes (196373)



The information in this article applies to:

  • Microsoft Win32 Software Development Kit (SDK) for Windows NT 4.0

This article was previously published under Q196373

SYMPTOMS

Under Windows NT 4.0, the Rectangle API fails to draw if all of the following conditions exist:
  1. The width of the currently selected pen is greater than or equal to 2.
  2. The edges of the rectangle do not intersect the client area.
  3. The current ROP2 code is set to anything but R2_COPYPEN.
If any one of these conditions do not exist, the Rectangle API behaves as documented.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

The following sample code demonstrates the conditions that cause the Rectangle API to fail:
  // Width is 5 so edges will not touch rectclient.
  SelectObject(hdc, CreatePen(0,5,RGB(255,0,0)));
  SetRop2(hdc, <any ROP2 code except R2_COPYPEN>);
  Rectangle(hdc, rectclient.left - 10,  rectclient.top - 10,
                 rectclient.right + 10, rectclient.botom + 10);
				
RESULT: The call to Rectangle returns TRUE, but it does not draw anything.

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbAPI kbBug kbGDI KB196373