如何获得最小化、最大化、关闭按钮所在的Rect
要求能根据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;
}