Jump to content
  • Advertisement
Sign in to follow this  
Enlighten

Custom Windows?

This topic is 4629 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like to make a program that has a custom shape. For example, Windows Media Player, as well as many other applications, have the ability to be a custom shape. This is what I mean by custom shape: Anyway, I would like to know how that's done. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
They work something like this: The window is made transparent, and the interface is drawn by blitting a number of bitmaps on to the window. The bitmaps have transparent parts, indicated by a magenta colour. These parts of the bitmap are ignored during blitting, and the parts of the window which they would cover remain transparent. All of this is controlled by some scripting language. Windows Media Player uses javascript. If you want to take a look at this, open any of the files in C:\Program Files\Windows Media Player\Skins with a standard zip file viewer like WinRAR. It's all in there. Winamp functions in pretty much the same way.

A quick search on Google for "making a window transparent" turned up this little gem: Transparent Windows Support in Win 2000 and Win ME. It seems to be what you're looking for, and the test program compiles and runs under Windows XP. I'm not sure if this is the correct way to do window transparency with Windows XP; you'll probably find out with some more searching.

EDIT: If you're wondering about blitting, it's the process of taking the pixels from a source device (a bitmap or something) and moving them to a destination device (a window or something). See the function BitBlt for more info.

Share this post


Link to post
Share on other sites
Nice clock there Gan!

Enlighten, if you know you're going to ship on Windows 2000 and newer operating systems, you can utilize what is generally known as "Layered Window" (instead of window region). It provides smooth blending with the rest of windows on your desktop, so you don't get those jagged edges like you see in the WMP picture above (layered windows support per-pixel alpha blending). As most people have moved on to Windows 2000 or newer OSes, it is IMO a wiser choice than using window regions :)

I have done both approaches and found that layered windows are easier to implement. Check this link for more details on how it's done.

Share this post


Link to post
Share on other sites
http://www.stromcode.com/modules.php?name=Glowdot_Tutorials&op=view&tid=1

Enjoy, gives you everything you want without horrific MFC nightmares :) Incase the other provided links don't get you going in the right direction.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!