Advertisement Jump to content
Sign in to follow this  

Window appearance questions

This topic is 4001 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've been searching around the net and the Win32 documentations, but there isn't a single thing I coul;d find that answered my questions, so I'm hoping if I ask I'll get something useful. I'm programming stright C++/Win32, no MFC, and now I'm thinking it would have just been much much easier to actually use MFC and the development environment to begin with. :( [sad face] Anyway, I noticed that when I create a child window, the font of the controls is always bold by default... and I think it's ugly. Besides sending the WM_SETFONT message to every control I create, is there a faster way to notify all controls that I want to use a specific font? Secondly, I noticed that rebar controls have a single pixel border, which I'd like to mimic for my child windows, but the closest thing I can find is WS_EX_STATICEDGE. It has a sunken border when I'd like a raised border. Any guidance would be appreciated.

Share this post

Link to post
Share on other sites
AFAIK there is no simpler way for setting the font to every control.

You could however use a single function where you enumerate all childs:

HWND hwndChild = ::GetWindow( hwndParent, GW_CHILD );
while ( hwndChild )
::SendMessage( hwndChild, WM_SETFONT, ... );

hwndChild = ::GetWindow( hwndChild, GW_HWNDNEXT );

About the flat border:

The flat border is created with only WS_BORDER | WS_POPUP | WS_VISIBLE. Still use CreateWindowEx though and do not pass WS_EX_WINDOWEDGE.

If you don't pass WS_POPUP you need to pass another main style, otherwise CreateWindow will automatically force WS_EX_WINDOWEDGE onto it.

Share this post

Link to post
Share on other sites
That's a handy method for handling font change. I might be able to set the font for every single control in the application at once.

As for the border, I still haven't found how to get the right look I would want, even with combining the WS_BORDER to another style. WS_POPUP won't work with child windows, which is what I am changing the appearance of. By default, WS_BORDER just gives me a single pixel black border, but nothing seems to give it the raised edge look, but I'm still trying. If I can't get it, I'll try setting my tool and status bars to have an edge so it has a similar look in the application.

Thank you very much for your help!

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!