An Interesting Win32 Discovery

Hello all! I was digging around the web for win32 stuff this week and found something cool.

You can change the shape of your window to a circle! It's really neat and only takes three lines of code:

1
2
3
HRGN hrgn;
hrgn = CreateEllipticRgn(0, 0, 200, 200);
SetWindowRgn(Window, hrgn, TRUE);


It seems it doesn't actually change the shape of your window but only the viewing area of it? Very weird. Does anyone else have some cool win32 "secrets"?

- Connor
You need top use Layered Windows to control actual shape of window.

As for cool win32 secrets - The Old New Thing blog is great for this. You can find all kinds of win32 secrets there. Raymond Chen also has a book about this: https://smile.amazon.com/dp/0321440307 It's great.

Edited by Mārtiņš Možeiko on
I remember Winamp assuming those shapes back in the day :) People probably stopped doing it for a reason...
Oh man, there's a little nostalgia trip! Pretty sure this was the Sonique skin I used for a bit, until the non-personalised fullscreen GUI-style Amarok and now the sleekly personalised ncmpcpp. I guess I still like that "shaped window" aesthetic, though, since I bothered to hack a curved shape into my conky monitor as you can see in the screenshot.
Nice skin! Thinking about it, that was super customizable comparing to something like Sublime Text themes we have today...
Since we are talking about windows stuff, I've wondered if it was possible to make a window that is transparent except for the things you draw into it. That way you can draw symbols and other UI elements onto the screen without a window.