GetWindowRect和GetClientRect(得到窗口坐标)
来源:互联网 发布:苗木识别软件 编辑:程序博客网 时间:2024/06/13 23:31
GetWindowRect是取得窗口在屏幕坐标系下的RECT坐标(包括客户区和非客户区),这样可以得到窗口的大小和相对屏幕左上角(0,0)的位置。![](http://img.my.csdn.net/uploads/201209/19/1347989002_3205.jpg)
GetClientRect取得窗口客户区(不包括非客户区)在客户区坐标系下的RECT坐标,可以得到窗口的大小,而不能得到相对屏幕的位置,因为这个矩阵是在客户区坐标系下(相对于窗口客户区的左上角)的。
ClientToScreen把客户区坐标系下的RECT坐标转换为屏幕坐标系下的RECT坐标.
ScreenToClient把屏幕坐标系下的RECT坐标转换为客户区坐标系下的RECT坐标. 我们对同一个窗口先GetWindowRect取得一个RECT,再用ScreenToClient转换到客户坐标系。然后GetClientRect取得一个RECT,再用ClientToScreen转换到屏幕坐标系。显然,GetWindowRect取得的矩阵不小于GetClientRect取得的矩阵。因为前者包含了非客户区,而后包括了客户区。
对GetWindowRect取得的矩阵ScreenToClient后,矩阵的大小没有变小,(-3,-29)是窗口的左上角的坐标,相对窗口客户区左上角。
对GetClientRect取得的矩阵ClientToScreen后,矩阵也没有变大,新得到的矩阵是窗口客户区在屏幕坐标系上的RECT。
![](http://img.my.csdn.net/uploads/201209/19/1347989002_3205.jpg)
- GetWindowRect和GetClientRect(得到窗口坐标)
- GetWindowRect和GetClientRect
- GetWindowRect()和GetClientRect()
- GetWindowRect和GetClientRect 区别
- GetWindowRect和GetClientRect
- GetWindowRect和GetClientRect
- GetWindowRect和GetClientRect
- GetWindowRect 和 GetClientRect
- GetClientRect和GetWindowRect封装
- GetWindowRect和GetClientRect
- GetWindowRect()和GetClientRect()
- GetWindowRect和GetClientRect本质
- GetWindowRect和GetClientRect
- GetWindowRect和GetClientRect分析
- GetWindowRect和GetClientRect
- GetWindowRect和GetClientRect区别
- GetWindowRect和GetClientRect
- GetWindowRect和GetClientRect
- USB ACM device
- UVA 12482 Short Story Competition
- man命令
- 【STL】vector学习笔记
- 5 件程序员不太想做的重要事情
- GetWindowRect和GetClientRect(得到窗口坐标)
- java split 使用方法总结
- UVA 12493 Stars
- CUDA实现QuickSortr排序算法(一)
- php 5.2 filter
- Tomcat中三种部署项目的方法
- Apache安装
- hdu 1863 畅通工程
- VIM文本对象---非常有用