Microsoft KB Archive/125669

{|
 * width="100%"|

HOWTO: Create Nonrectangular Windows

 * }

Q125669

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)
 * Microsoft Windows 2000 Driver Development Kit (DDK)

-

SUMMARY
Windows provides an API called SetWindowRgn that makes it easy for applications to create irregularly shaped windows.

MORE INFORMATION
In previous versions of Windows and Windows NT, it was possible to create only rectangular windows. To simulate a non-rectangular window required a lot of work on the application developer's part. Besides handling all drawing for the window, the application was required to perform hit-testing and force underlying windows to repaint as necessary to refresh the "transparent" portions of the window.

Windows 95 and Windows NT version 3.51 greatly simplify this by providing the SetWindowRgn function. An application can now create a region with any desired shape and use SetWindowRgn to set this as the clipping region for the window. Subsequent painting and mouse messages are limited to this region, and Windows automatically updates underlying windows that show through the non-rectangular window. The application need only paint the window as desired.

For more information on using SetWindowRgn, see the Win32 API documentation.

Additional query words:

Keywords : kbOSWinNT351 kbOSWinNT400 kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin95 kbOSWin98 kbWndw kbWndwProp

Issue type : kbhowto

Technology : kbwin2000Search kbwin2000DDK kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWinDDKSearch kbWin32sSearch