Is there an API call to determine the size and position of window caption buttons? I'm trying to draw vista-style caption buttons onto an owner drawn window. I'm dealing with c/c++/mfc.
Edit: Does anyone have a code example to draw the close button?
To define how the captions appear in Windows and some Windows apps, you can select one of the predefined caption options or customize an option to better suit your needs. Select (Start) > Settings > Accessibility > Captions.
Title bars contain at least three small buttons that minimize, maximize or restore, and close the window associated with the title bar. Title bars also contain a context-sensitive Help button.
I've found the function required to get the position of the buttons in vista: WM_GETTITLEBARINFOEX
This link also shows the system metrics required to get all the spacing correct (shame it's not a full dialog picture though). This works perfectly in Vista, and mostly in XP (in XP there is slightly too much of a gap between the buttons).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With