如何获取窗口标题按钮的大小和位置(最小化,还原,关闭) [英] How to get size and position of window caption buttons (minimise, restore, close)

查看:210
本文介绍了如何获取窗口标题按钮的大小和位置(最小化,还原,关闭)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有API调用来确定窗口字幕按钮的大小和位置?我正在尝试将Vista样式的字幕按钮绘制到所有者绘制的窗口上.我正在处理c/c ++/mfc.

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.

有人有代码示例来绘制关闭按钮吗?

Does anyone have a code example to draw the close button?

推荐答案

我已经找到了在Vista中获取按钮位置所需的功能:

I've found the function required to get the position of the buttons in vista: WM_GETTITLEBARINFOEX

此链接还显示了正确校正所有间距所需的系统指标(可惜它不是完整的对话框图片).这在Vista以及Windows XP中都可以正常使用(在XP中,按钮之间的间隙稍大一些).

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).

这篇关于如何获取窗口标题按钮的大小和位置(最小化,还原,关闭)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆