Win32/MFC从客户端rect获取窗口rect [英] Win32/MFC Get window rect from client rect

查看:159
本文介绍了Win32/MFC从客户端rect获取窗口rect的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道某个地方可以接受客户端rect的功能,它将为您将其转换为window rect.我只是找不到/记住它!

有人知道这是什么吗?

它会执行以下操作:

const CRect client(0, 0, 200, 200);
const CRect window = ClientRectToWindowRect(client);
SetWindowPos(...)

解决方案

您可能正在考虑 GetWindowRect() .

I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it!

Does anyone know what it is?

It will do something similar to:

const CRect client(0, 0, 200, 200);
const CRect window = ClientRectToWindowRect(client);
SetWindowPos(...)

解决方案

You're probably thinking of AdjustWindowRectEx(). Keep in mind, this is intended for use when creating a window - there's no guarantee that it will produce an accurate set of window dimensions for an existing window; for that, use GetWindowRect().

这篇关于Win32/MFC从客户端rect获取窗口rect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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