views:

520

answers:

3

I am creating a window program using VC++ through win32 API. I wanted to create a ellipse shaped window how this can be achived.

+1  A: 

Use SetWindowRgn to make the drawing area of the window an elliptical region. This prevents drawing to the window the exceed the boundary of the ellipse.

1800 INFORMATION
+1  A: 

The only trouble with using SetWindowRgn is regions is they are difficult to create completely arbitrary shapes.

Windows 2000 introduced layered windows to solve this and is how clippy was able to escape the confines of his window.

See http://msdn.microsoft.com/en-us/library/ms997507.aspx for information regarding layered windows.

KeeperOfTheSoul
+2  A: 

Using WS_EX_LAYERED in your windows style attribute, and calling UpdateLayeredWindow is probably the most flexible way to control a custom shaped / transparent window using the Win32 API. There's an excellent break down (though a little old) over on MSDN: http://msdn.microsoft.com/en-us/library/ms997507.aspx

And official doc for UpdateLayeredWindow: http://msdn.microsoft.com/en-us/library/ms633556(VS.85).aspx

marshall_law