Creating Shaped Windows

This code sample shows how to create shaped windows using the SetWindowRegion and CreatePolygonRgn WinAPI calls.

Screen-shot

The code builds up an array of the Windows POINTAPI type to define the points of the shape (in this case a Christmas Tree), a Windows region is created using the CreatePolygonRgn call and then applied to the main window using the SetWindowRgn call.

Download zipped project file (5k)



Comments

  • Question

    Posted by Legacy on 01/30/2002 12:00am

    Originally posted by: Feldor

    how would you make so when u first start the program it changes shape?

    • question

      Posted by raviraj on 04/27/2004 09:53am

      how to create a form dyanamically

      Reply
    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

  • Live Event Date: August 20, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT When you look at natural user interfaces as a developer, it isn't just fun and games. There are some very serious, real-world usage models of how things can help make the world a better place – things like Intel® RealSense™ technology. Check out this upcoming eSeminar and join the panel of experts, both from inside and outside of Intel, as they discuss how natural user interfaces will likely be getting adopted in a wide variety …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds