handmade.network » Forums » An Interesting Win32 Discovery
Connor_Rentz
Connor
54 posts

It's been so long ;)

#8713 An Interesting Win32 Discovery
1 year, 8 months ago

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

<C
mmozeiko
Mārtiņš Možeiko
1688 posts
1 project
#8714 An Interesting Win32 Discovery
1 year, 8 months ago Edited by Mārtiņš Možeiko on Sept. 25, 2016, 11:12 p.m.

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.
hugo
25 posts

None

#8716 An Interesting Win32 Discovery
1 year, 8 months ago

I remember Winamp assuming those shapes back in the day :) People probably stopped doing it for a reason...

None
Miblo
Matt Mascarenhas
123 posts
2 projects

Annotator, supper gatherer and slammer of thunderous high fives

#8731 An Interesting Win32 Discovery
1 year, 8 months ago

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.
hugo
25 posts

None

#8732 An Interesting Win32 Discovery
1 year, 8 months ago

Nice skin! Thinking about it, that was super customizable comparing to something like Sublime Text themes we have today...

None
Barret5Ocal
Barret Gaylor
21 posts

I am a game designer who recently became interested in coding in a handmade way. I am not that experienced, but I want to learn.

#8733 An Interesting Win32 Discovery
1 year, 8 months ago

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.

Just some designer guy.