如何获得最小化、最大化、关闭按钮所在的Rect

musictom 2006-11-16 11:45:35
要求能根据windows的主题变化而正确显示,我的代码有点问题,换一个主题就不能保证正确了,请高手们帮我看看, 这个是关闭按钮的:
void GetCloseButtonRect(Rect rectButton)
{
GetWindowRect(Handle, rectButton);
OffsetRect(rectButton, -rectButton.Left, -rectButton.Top);

rectButton.top = rectButton.top + GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE);
rectButton.bottom = rectButton.top + GetSystemMetrics(SM_CYSIZE) - 4;
rectButton.Left = rectButton.Right - GetSystemMetrics(SM_CXSIZE) + 4;
}
...全文
179 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ReverseEngineering 2007-01-05
  • 打赏
  • 举报
回复
没遇到过,顶。
syy64 2006-11-17
  • 打赏
  • 举报
回复
函数是在哪儿调用的?
一分之千 2006-11-17
  • 打赏
  • 举报
回复
SM_CXBORDER, SM_CYBORDER
musictom 2006-11-17
  • 打赏
  • 举报
回复
我是用的delphi调用的,代码是delphi改的
xiangrujian 2006-11-16
  • 打赏
  • 举报
回复
关注,帮顶

19,469

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧