I'm trying to create an SDI (single-document interface) application that has an irregularly shaped client area in my Windows NT application. After digging through the Developer Network Development Library, I have concluded that this is not possible. However, before I back off from this idea, I would like to know if it would be possible to "fake" it by having a transparent window background. I've been able to have my app initially come up this way (that is, whatever is behind my window is visible through the nonpainted portions of the client area), but when the window is moved the background is not updated. Hence my background always shows the scenery that was behind my app when I started the app. Any ideas?
Confused in Redmond
Ugh. Irregularity.
Irregularity is a common problem for humans but a weird problem for windows. In olden times (before the Win32 API), there wasn't an easy way to overcome this problem. However, since you are writing a Windows NT 3.5-based application, you can take advantage of the new SetWindowRgn function. This function (also supported under Windows 95) allows you to set the clipping region for a window including the border. The shape of your region depends upon how you created it. You can create elliptical, polygonal, rectangular, and round regions via calls to the CreateEllipticalRgn, CreatePolygonRgn, CreateRectRgn, and CreateRoundRgn functions. You pass to the creation function the coordinates bounding the region that you wish to set, and the function returns a handle to the region. Once you have the handle to the region, you can pass it to SetWindowRgn.