GetWindowRect和GetClientRect(转)
来源:互联网 发布:视频生成二维码软件 编辑:程序博客网 时间:2024/06/07 07:48
原文:http://blog.chinaunix.net/u/25372/showart_304363.html
GetWindowRect是取得窗口在屏幕坐标系下的RECT坐标(包括客户区和非客户区),这样可以得到窗口的大小和相对屏幕左上角(0,0)的位置。
GetWindowRect是取得窗口在屏幕坐标系下的RECT坐标(包括客户区和非客户区),这样可以得到窗口的大小和相对屏幕左上角(0,0)的位置。
GetClientRect取得窗口客户区(不包括非客户区)在客户区坐标系下的RECT坐标,可以得到窗口的大小,而不能得到相对屏幕的位置,因为这个矩阵是在客户区坐标系下(相对于窗口客户区的左上角)的。
ClientToScreen把客户区坐标系下的RECT坐标转换为屏幕坐标系下的RECT坐标.
ScreenToClient把屏幕坐标系下的RECT坐标转换为客户区坐标系下的RECT坐标. 我们对同一个窗口先GetWindowRect取得一个RECT,再用ScreenToClient转换到客户坐标系。然后GetClientRect取得一个RECT,再用ClientToScreen转换到屏幕坐标系。显然,GetWindowRect取得的矩阵不小于GetClientRect取得的矩阵。因为前者包含了非客户区,而后包括了客户区。
对GetWindowRect取得的矩阵ScreenToClient后,矩阵的大小没有变小,(-3,-29)是窗口的左上角的坐标,相对窗口客户区左上角。
对GetClientRect取得的矩阵ClientToScreen后,矩阵也没有变大,新得到的矩阵是窗口客户区在屏幕坐标系上的RECT。
0 0
- GetWindowRect和GetClientRect(转)
- GetWindowRect和GetClientRect(转)
- GetWindowRect和GetClientRect(转)
- GetWindowRect和GetClientRect(转)
- GetWindowRect和GetClientRect(转)
- GetWindowRect和GetClientRect(转)
- GetWindowRect和GetClientRect(转)
- GetWindowRect和GetClientRect
- GetWindowRect()和GetClientRect()
- GetWindowRect和GetClientRect 区别
- GetWindowRect和GetClientRect
- GetWindowRect和GetClientRect
- GetWindowRect和GetClientRect
- GetWindowRect 和 GetClientRect
- GetClientRect和GetWindowRect封装
- GetWindowRect和GetClientRect
- GetWindowRect()和GetClientRect()
- GetWindowRect和GetClientRect本质
- 黑马程序员_关于对象初始化
- Android Service 手机启动服务 监听电话的状态 进行录音
- Linux环境的搭建(一)—搭建交叉编译环境
- ios越狱开发相关
- OS X 10.9 Mavericks下怎么安装Command Line Tools(命令行工具)
- GetWindowRect和GetClientRect(转)
- 软考之路(七)---设计模式总结
- PHP中客户端IP地址的获取
- 数据库连接池实现的4种方式
- Spring MVC和Struts2的比较
- Java 毫秒转换为日期类型、日期转换为毫秒
- Linux的装置文件
- [LeetCode] Divide Two Integers
- sql 考勤