How To Create Nonrectangular Windows
Article ID: 125669
Article Last Modified on 2/12/2007
APPLIES TO
- Microsoft Platform Software Development Kit-January 2000 Edition
- Microsoft Win32 Device Driver Kit for Windows 2000
This article was previously published under Q125669
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.
Keywords: kbhowto kbwndw kbwndwprop KB125669