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

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++學(xué)習(xí)

先調(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() 得到的是在屏幕坐標(biāo)系下的RECT;(即以屏幕左上角為原點(diǎn)
GetClientRect() 得到的是在客戶區(qū)坐標(biāo)系下的RECT; (即以所在窗口左上角為原點(diǎn)

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

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

ScreenToClient() 就是把屏幕坐標(biāo)系下的RECT坐標(biāo)轉(zhuǎn)換為客戶區(qū)坐標(biāo)系下的RECT坐標(biāo)。

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ū)的大小,也就是說這樣得到的左上角永遠(yuǎn)是(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 是窗口相對于整個屏幕的坐標(biāo),屏幕左上點(diǎn)為0,0

相互轉(zhuǎn)化用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ù),可能是存在一定的冗余設(shè)計,但意義不同。
不過在.Net Framework下對WINDOWS API函數(shù)進(jìn)行了重新整理和優(yōu)化,在獲取控件或窗口的屏幕坐標(biāo)和客戶區(qū)坐標(biāo)時更方便的多,只需要得到與控件或窗口相對應(yīng)屏幕坐標(biāo)和客戶區(qū)坐標(biāo)屬性值就可以了

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>
            欧美日韩三区四区| 亚洲欧美精品suv| 亚洲一品av免费观看| 最新成人av在线| 亚洲理论在线| 在线中文字幕一区| 亚洲欧美在线aaa| 欧美一区二区三区在线免费观看| 中文无字幕一区二区三区| 一区二区三区不卡视频在线观看| 亚洲视频一二| 欧美在线91| 欧美搞黄网站| 一区二区国产精品| 久久精品国产久精国产思思| 亚洲黄色av| 欧美日韩国产综合视频在线观看中文 | 久久综合九色综合网站| 麻豆精品在线视频| 欧美日韩中文字幕在线| 国产丝袜一区二区| 日韩一区二区精品视频| 羞羞答答国产精品www一本| 免播放器亚洲| 亚洲视频在线看| 麻豆成人91精品二区三区| 欧美日韩中文| 激情成人在线视频| 99热免费精品| 久久综合成人精品亚洲另类欧美| 亚洲级视频在线观看免费1级| 一区二区三区日韩在线观看| 久久精品视频免费观看| 欧美日韩国产综合视频在线观看| 狠狠色狠色综合曰曰| 亚洲一区二区三区激情| 蜜乳av另类精品一区二区| 国产精品免费一区二区三区观看| 一本色道久久综合| 久久久精品国产免大香伊| 亚洲激情av在线| 香蕉久久国产| 欧美午夜电影网| 91久久亚洲| 蜜臀久久久99精品久久久久久| 亚洲制服欧美中文字幕中文字幕| 欧美精品不卡| 亚洲激情偷拍| 狂野欧美性猛交xxxx巴西| 亚洲综合第一| 国产精品午夜久久| 销魂美女一区二区三区视频在线| 日韩小视频在线观看| 欧美高清影院| 亚洲人精品午夜| 欧美成人午夜| 美日韩免费视频| 亚洲国产欧美一区二区三区久久| 久久亚洲综合色| 久久精品国产亚洲一区二区三区| 国产精品免费在线| 亚洲一区国产视频| 在线天堂一区av电影| 国产精品第三页| 亚洲欧美激情诱惑| 日韩视频中午一区| 欧美视频在线看| 麻豆成人在线| 日韩视频免费| 99视频精品| 国产精品乱码一区二三区小蝌蚪| 亚洲欧美成人综合| 午夜免费在线观看精品视频| 国产性天天综合网| 老司机久久99久久精品播放免费 | 免费亚洲电影在线观看| 伊人久久综合97精品| 老司机午夜精品视频在线观看| 久久精品在线播放| 亚洲国内欧美| 日韩一区二区电影网| 欧美日韩精品在线播放| 午夜在线精品偷拍| 久久久无码精品亚洲日韩按摩| 亚洲国产第一| 日韩亚洲精品电影| 国产伦精品一区二区三区视频孕妇| 欧美在线免费看| 免费不卡欧美自拍视频| 亚洲视频在线视频| 欧美在线视频不卡| 99精品视频免费| 亚洲欧美日韩精品久久| 亚洲福利国产精品| 夜色激情一区二区| 黄色日韩精品| 日韩亚洲一区二区| 狠狠色综合播放一区二区| 亚洲三级免费| 国产日韩欧美在线看| 欧美国产日本| 国产精自产拍久久久久久蜜| 欧美成人免费一级人片100| 国产精品每日更新在线播放网址| 久久久久久夜| 国产精品久久久久久久久久久久久 | 亚洲欧美日韩视频二区| 亚洲激情成人在线| 欧美一级成年大片在线观看| 亚洲美女电影在线| 久久www成人_看片免费不卡| 亚洲视频第一页| 免费亚洲视频| 免费不卡视频| 国产一区二区三区精品欧美日韩一区二区三区| 久久伊伊香蕉| 国产乱码精品一区二区三区忘忧草 | 美女日韩在线中文字幕| 国产精品推荐精品| 在线一区二区三区四区| 久久综合九九| 久久久www成人免费精品| 国产精品成人av性教育| 亚洲国产精品精华液网站| 黄色精品在线看| 欧美在线综合| 欧美一级免费视频| 国产精品igao视频网网址不卡日韩| 欧美韩国一区| 亚洲电影第三页| 久久人人97超碰国产公开结果 | 老色鬼精品视频在线观看播放| 欧美在线三级| 国产精品社区| 亚洲视频一二三| 亚洲性图久久| 欧美日韩免费观看中文| 91久久线看在观草草青青| 亚洲国产老妈| 欧美精品精品一区| 日韩香蕉视频| 亚洲欧美综合国产精品一区| 欧美性事免费在线观看| 亚洲欧洲美洲综合色网| 亚洲免费视频在线观看| 99伊人成综合| 国产精品日韩精品| 一卡二卡3卡四卡高清精品视频| 精品动漫3d一区二区三区免费| 一二三区精品| 亚洲综合视频1区| 欧美日韩免费网站| 在线一区二区视频| 一区二区三区欧美日韩| 欧美日韩国产精品一区二区亚洲| 亚洲国产日韩欧美在线动漫| 韩国精品在线观看| 久久色在线观看| 欧美成人官网二区| 最新亚洲视频| 欧美久久影院| 亚洲一区二区三区四区五区午夜| 欧美一级在线视频| 国产欧美在线视频| 久久香蕉国产线看观看网| 亚洲国产日韩美| 亚洲欧美在线免费观看| 国产区亚洲区欧美区| 欧美影院在线| 亚洲欧洲日产国产网站| 亚洲欧美日韩天堂一区二区| 国产一区在线观看视频| 欧美va亚洲va国产综合| 亚洲图片在区色| 久热爱精品视频线路一| 亚洲欧洲一二三| 国产精品亚洲综合| 久久精品国产96久久久香蕉| 亚洲人成高清| 久久久久免费观看| 国产日本欧美一区二区| 美女主播一区| 亚洲精品乱码久久久久久蜜桃91| 亚洲欧洲99久久| 亚洲国产黄色| 国产欧美日韩视频一区二区三区| 久久天堂成人| 亚洲午夜羞羞片| 亚洲国产精品va| 久久蜜桃香蕉精品一区二区三区| 日韩一级精品| 国产一区二区三区av电影| 欧美另类69精品久久久久9999| 午夜亚洲一区| 日韩视频免费| 亚洲经典在线| 欧美激情性爽国产精品17p| 久久久精品一品道一区| 亚洲一区二区三区高清| 亚洲伦理中文字幕|