现在的位置: 首页 > 综合 > 正文

GetClientRect & GetWindowRect 区别

2013年03月06日 ⁄ 综合 ⁄ 共 560字 ⁄ 字号 评论关闭

The GetClientRect function retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).

GetClientRect得到的是客户区的大小,也就是说这样得到的左上角永远是(0,0)

The GetWindowRect function retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.

GetWindowRect 是窗口相对于整个屏幕的坐标,屏幕左上点为0,0

相互转化用ScreenToClient 或者 ClientToScreen

抱歉!评论已关闭.