Microsoft KB Archive/196373

{|
 * width="100%"|

BUG: Rectangle Fails with Certain ROP2 Codes

 * }

Q196373

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK) for Windows NT, version 4.0

-

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.

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, ); 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.

Additional query words:

Keywords : kbAPI kbGDI kbOSWinNT400bug kbSDKPlatform

Issue type : kbbug

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch kbWin32SDKNT400