WinApi中的GetClientRect和GetWindowRect有什么区别? [英] What is the difference between GetClientRect and GetWindowRect in WinApi?

查看:494
本文介绍了WinApi中的GetClientRect和GetWindowRect有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在InvalidateRect中使用什么来刷新我的窗口?为什么?

What of these should I use in InvalidateRect to refresh my window? And why?

推荐答案

窗口rect包括非客户区,即窗口边框,字幕栏等。不会。

The window rect includes the non-client area, i.e. the window borders, caption bar etc. The client rect does not.

GetWindowsRect在屏幕坐标中返回一个矩形,而GetClientRect在客户端坐标中返回一个矩形。

GetWindowsRect returns a rect in screen coordinates whereas GetClientRect returns a rect in client coordinates.

InvalidateRect接收客户端坐标中的rect。如果要使整个客户端区域失效,则将NULL传递给InvalidateRect。你可以传入由GetClientRect返回的rect,但它更简单和更清楚的传递NULL。

InvalidateRect receives a rect in client coordinates. If you want to invalidate your entire client area then pass NULL to InvalidateRect. You could pass in the rect returned by GetClientRect but it is far simpler and clearer to pass NULL.

这篇关于WinApi中的GetClientRect和GetWindowRect有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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