關於GetClientRect 和 GetWindowRect

gavinlee發表於2006-11-29

GetClientRect得到的是客戶區的大小,也就是說這樣得到的左上角永遠是(0,0)

GetWindowRect 是視窗相對於整個螢幕的座標,螢幕左上點為0,0

[@more@]

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).

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.

相互轉化用ScreenToClient 或者 ClientToScreen

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/310974/viewspace-880578/,如需轉載,請註明出處,否則將追究法律責任。

相關文章