青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 34, comments - 0, trackbacks - 0, articles - 1
  C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

GetWindowRect與GetClientRect的區(qū)別

Posted on 2012-02-13 20:01 polly 閱讀(498) 評論(0)  編輯 收藏 引用 所屬分類: VC++學習

先調(diào)用GetWindowRect后再調(diào)用ScreenToClient,這個時候得到的rect和直接使用GetClientRect得到的值是相等的。有時候需要獲得窗口矩形的大小和客戶區(qū)矩形的大小二者的值,故需要分別調(diào)用GetWindowRect和GetClientRect。如果只需要獲得客戶區(qū)矩形的大小,調(diào)用GetClientRect就行了。GetWindowRect和GetClientRect函數(shù)的說明如下:

CWnd::GetClientRect  
    void GetClientRect( LPRECT lpRect ) const;
Parameters:
lpRect
    Points to a RECT structure or a CRect object to receive the client coordinates. The left and top members will be 0. The right and bottom members will contain the width and height of the window.
Remarks:
    Copies the client coordinates of the CWnd client area into the structure pointed to by lpRect. The client coordinates specify the upper-left and lower-right corners of the client area. Since client coordinates are relative to the upper-left corners of the CWnd client area, the coordinates of the upper-left corner are (0,0).

CWnd::GetWindowRect
void GetWindowRect( LPRECT lpRect ) const;
Parameters:
lpRect
Points to a CRect object or a RECT structure that will receive the screen coordinates of the upper-left and lower-right corners.
Remarks:
Copies the dimensions of the bounding rectangle of the CWnd object to the structure pointed to by lpRect. The dimensions are given in screen coordinates relative to the upper-left corner of the display screen. The dimensions of the caption, border, and scroll bars, if present, are included.

GetWindowRect() 得到的是在屏幕坐標系下的RECT;(即以屏幕左上角為原點
GetClientRect() 得到的是在客戶區(qū)坐標系下的RECT; (即以所在窗口左上角為原點

GetWindowRect()取的是整個窗口的矩形;
GetClientRect()取的僅是客戶區(qū)的矩形,也就是說不包括標題欄,外框等;

第一個函數(shù)獲得的是窗口在屏幕上的位置,得到的結果可能是這樣CRect(10,10,240,240);
第二個函數(shù)和它不同,它只獲得了客戶區(qū)的大小,因此得到的結果總是這樣CRect(0,0,width,height);

ScreenToClient() 就是把屏幕坐標系下的RECT坐標轉換為客戶區(qū)坐標系下的RECT坐標。

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得到的是客戶區(qū)的大小,也就是說這樣得到的左上角永遠是(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

ClientToScreen
The ClientToScreen function converts the client coordinates of a specified point to screen coordinates.
BOOL ClientToScreen(
   HWND hWnd,        // window handle for source coordinates
   LPPOINT lpPoint   // pointer to structure containing screen coordinates
);

Parameters
hWnd
Handle to the window whose client area is used for the conversion.
lpPoint
Pointer to a POINT structure that contains the client coordinates to be converted. The new screen coordinates are copied into this structure if the function succeeds.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
雖然存在調(diào)用GetWindowRect后再調(diào)用ScreenToClient==GetClientRect,但ScreenToClient()和ClientToScreen()兩者都是屬于WINDOWS API函數(shù),可能是存在一定的冗余設計,但意義不同。
不過在.Net Framework下對WINDOWS API函數(shù)進行了重新整理和優(yōu)化,在獲取控件或窗口的屏幕坐標和客戶區(qū)坐標時更方便的多,只需要得到與控件或窗口相對應屏幕坐標和客戶區(qū)坐標屬性值就可以了

ScreenToClient
The ScreenToClient function converts the screen coordinates of a specified point on the screen to client coordinates.
BOOL ScreenToClient(
   HWND hWnd,         // window handle for source coordinates
   LPPOINT lpPoint    // address of structure containing coordinates
);
Parameters:
hWnd
Handle to the window whose client area will be used for the conversion.
lpPoint
Pointer to a POINT structure that contains the screen coordinates to be converted.
Return Values:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久久久久久一区| 免费观看成人| 欧美午夜a级限制福利片| 免费观看成人www动漫视频| 久久美女性网| 免费中文日韩| 欧美日韩一区二区三区在线看 | 国产精品啊啊啊| 国产精品乱码久久久久久| 国产精品一区二区久久久| 国产有码在线一区二区视频| 国模精品娜娜一二三区| 亚洲日本免费电影| 亚洲午夜日本在线观看| 久久久99久久精品女同性| 美女在线一区二区| 亚洲毛片在线免费观看| 欧美一级网站| 欧美日本一区二区三区| 国产一区久久| 亚洲午夜影视影院在线观看| 久久另类ts人妖一区二区| 亚洲国产精品一区二区久| 亚洲第一毛片| 性做久久久久久久免费看| 久久综合久久久久88| 国产精品久久激情| 亚洲国产精品悠悠久久琪琪| 亚洲欧美日韩成人| 亚洲国产欧美一区二区三区同亚洲| av成人手机在线| 欧美在线观看视频一区二区三区 | 亚洲欧美伊人| 欧美—级在线免费片| 国产精品中文字幕欧美| 日韩午夜电影av| 欧美在线观看视频一区二区| 亚洲国产精品一区制服丝袜| 欧美影院精品一区| 欧美视频在线不卡| 亚洲人成网站777色婷婷| 久久国产精品亚洲va麻豆| 99精品欧美一区二区三区综合在线 | 日韩视频一区二区三区| 久久久美女艺术照精彩视频福利播放| 欧美日韩综合在线| 亚洲三级观看| 亚洲电影免费观看高清| 久久久久国产精品www| 亚洲国产精品t66y| 影音先锋中文字幕一区| 亚洲综合精品自拍| 欧美成人乱码一区二区三区| 久久精品91久久久久久再现| 国产精品久久久久久久7电影| 亚洲伦理中文字幕| 欧美黄色影院| 欧美国产精品一区| 亚洲精品免费电影| 91久久精品一区二区三区| 美日韩精品免费| 91久久久久久久久| 亚洲国产成人精品视频| 欧美顶级少妇做爰| 一本色道久久加勒比精品| 欧美激情bt| 欧美激情视频免费观看| 最新精品在线| 亚洲国产成人在线播放| 欧美国产日韩免费| 国产精品99久久不卡二区| 亚洲麻豆av| 国产九九精品| 久久一区国产| 欧美成人视屏| 亚洲特色特黄| 亚洲欧美精品| 狠狠入ady亚洲精品| 欧美**字幕| 欧美区一区二| 欧美一级视频精品观看| 欧美一区二区三区在线视频| 国产亚洲精品久久久久久| 久久综合婷婷| 欧美精品v日韩精品v国产精品 | 亚洲国产精品成人| 欧美国产免费| 欧美日韩一区二| 新67194成人永久网站| 久久久91精品国产一区二区精品| 原创国产精品91| 亚洲精品国精品久久99热| 国产精品美女999| 久久精品国产v日韩v亚洲| 免费观看久久久4p| 亚洲男女自偷自拍| 看欧美日韩国产| 亚洲一区二区视频在线| 亚洲一级免费视频| 亚洲黄色影院| 亚洲欧美精品suv| 亚洲美女在线国产| 欧美在线综合| 中文网丁香综合网| 久久久一区二区三区| 亚洲影院色无极综合| 免费不卡亚洲欧美| 久久成年人视频| 国产精品草莓在线免费观看| 欧美电影免费观看网站| 亚洲福利免费| 在线视频免费在线观看一区二区| 国内久久视频| 亚洲一品av免费观看| 亚洲第一综合天堂另类专| 一区二区三区四区国产精品| 在线国产日韩| 先锋资源久久| 亚洲欧美中文在线视频| 欧美日本在线一区| 免费一区视频| 国产精品综合网站| 亚洲婷婷在线| 亚洲自拍偷拍网址| 欧美吻胸吃奶大尺度电影| 亚洲黄色视屏| 亚洲国产日韩精品| 久久久噜噜噜久久| 美女黄网久久| 伊人狠狠色j香婷婷综合| 欧美一级播放| 欧美一级二区| 国产精品三级视频| 亚洲亚洲精品在线观看 | 欧美专区18| 国产精品日韩电影| 亚洲图片你懂的| 午夜精品国产精品大乳美女| 欧美亚一区二区| 亚洲香蕉网站| 久久狠狠久久综合桃花| 国产日本欧美视频| 久久国内精品视频| 老色鬼精品视频在线观看播放| 红桃视频一区| 美女999久久久精品视频| 亚洲国产一区在线| 国产精品99久久久久久久久久久久| 欧美精品v国产精品v日韩精品| 亚洲福利久久| 亚洲专区欧美专区| 国产一区亚洲| 久久中文字幕导航| 亚洲日本激情| 性色av一区二区三区| 极品少妇一区二区三区| 猛干欧美女孩| 一区二区三区**美女毛片| 亚洲欧美中文日韩在线| 国产伊人精品| 欧美成人影音| 亚洲视频一区二区在线观看| 欧美影院久久久| 亚洲电影免费在线| 欧美日韩免费看| 欧美亚洲网站| 亚洲欧洲一区| 久久精品视频在线播放| 亚洲人成久久| 国产日韩欧美在线观看| 免费成人在线视频网站| 夜夜嗨网站十八久久| 久久精品日产第一区二区| 日韩午夜激情av| 国产视频在线一区二区| 欧美大片一区| 亚洲欧美日韩中文视频| 亚洲国产裸拍裸体视频在线观看乱了中文| 一区二区三区国产| 久久精品国产清自在天天线 | 美女网站久久| 亚洲美女一区| 久久亚洲精品伦理| 亚洲图色在线| 亚洲日本成人网| 国产亚洲人成a一在线v站| 欧美精品一区二区三| 欧美在线亚洲综合一区| 亚洲无线一线二线三线区别av| 欧美国产在线观看| 久久人人看视频| 亚洲欧美一区二区原创| 亚洲免费观看| 在线观看一区| 国产亚洲精品一区二555| 国产精品theporn| 欧美人与性动交α欧美精品济南到| 久久大综合网| 欧美一区二区三区在线观看| 亚洲婷婷综合久久一本伊一区|