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

GetWindowRect() || GetClientRect()||ScreenToClient()||ClientToScreen

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

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()取的是整個(gè)窗口的矩形;
GetClientRect()取的僅是客戶區(qū)的矩形,也就是說(shuō)不包括標(biāo)題欄,外框等;

第一個(gè)函數(shù)獲得的是窗口在屏幕上的位置,得到的結(jié)果可能是這樣CRect(10,10,240,240);
第二個(gè)函數(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ū)的大小,也就是說(shuō)這樣得到的左上角永遠(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 是窗口相對(duì)于整個(gè)屏幕的坐標(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è)計(jì),但意義不同。
不過(guò)在.Net Framework下對(duì)WINDOWS API函數(shù)進(jìn)行了重新整理和優(yōu)化,在獲取控件或窗口的屏幕坐標(biāo)和客戶區(qū)坐標(biāo)時(shí)更方便的多,只需要得到與控件或窗口相對(duì)應(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.

posted on 2011-04-01 11:30 wrh 閱讀(984) 評(píng)論(1)  編輯 收藏 引用

評(píng)論

# re: GetWindowRect() || GetClientRect()||ScreenToClient()||ClientToScreen 2011-04-26 12:46 寧波停車(chē)棚

這些東西好像我都沒(méi)怎么接觸過(guò),呵呵不懂。  回復(fù)  更多評(píng)論   


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


導(dǎo)航

<2011年4月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

統(tǒng)計(jì)

常用鏈接

留言簿(19)

隨筆檔案

文章檔案

收藏夾

搜索

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            国产精品免费看久久久香蕉| 久久久久女教师免费一区| 久久超碰97人人做人人爱| 亚洲视频在线观看视频| 久久免费精品视频| 久久精品视频在线免费观看| 国产精品福利在线| 91久久嫩草影院一区二区| 在线成人欧美| 久久精品亚洲一区二区三区浴池 | 国产麻豆视频精品| 999亚洲国产精| 99国产精品国产精品久久| 久热爱精品视频线路一| 久久尤物电影视频在线观看| 国产婷婷一区二区| 午夜亚洲性色福利视频| 欧美在线视频在线播放完整版免费观看 | 国产精品嫩草久久久久| 亚洲理论在线观看| 日韩视频免费在线观看| 欧美—级高清免费播放| 亚洲精品久久久久久久久| 亚洲国产综合在线看不卡| 猛男gaygay欧美视频| 欧美国产精品一区| 亚洲激情专区| 欧美高清视频一区二区| 亚洲精品黄色| 亚洲一区二区三区影院| 国产精品欧美日韩一区二区| 亚洲一区二区三区成人在线视频精品| 午夜精品亚洲一区二区三区嫩草| 国产精品免费小视频| 亚洲欧美日韩另类| 久久这里只有| 亚洲精品视频啊美女在线直播| 欧美高清hd18日本| 日韩午夜免费视频| 亚洲一区亚洲| 狠狠色狠狠色综合人人| 美国十次了思思久久精品导航| 亚洲国产成人精品视频| 一本色道久久综合| 国产午夜精品全部视频播放| 久久久99精品免费观看不卡| 亚洲国产精品传媒在线观看| 一区二区三区欧美| 国产欧美日韩一区二区三区| 久久中文精品| 在线一区二区三区四区| 久久精品欧洲| 亚洲精品一区二区三| 欧美视频一区二区在线观看 | 亚洲国产精品一区二区第一页| 欧美第一黄色网| 亚洲免费视频一区二区| 男女av一区三区二区色多| 在线亚洲成人| 影音先锋一区| 国产精品久久久久免费a∨| 久久精品中文字幕免费mv| 亚洲欧洲美洲综合色网| 久久久777| 亚洲视频欧美在线| 在线日本成人| 国产欧美va欧美va香蕉在| 美女视频网站黄色亚洲| 午夜宅男欧美| 一区二区三区|亚洲午夜| 久久亚洲精品伦理| 亚洲欧美另类久久久精品2019| 伊人精品成人久久综合软件| 国产精品久久久久一区二区三区共| 美女成人午夜| 午夜精品久久久久久久久久久| 亚洲精品视频一区二区三区| 老牛国产精品一区的观看方式| 亚洲欧美变态国产另类| 欧美刺激午夜性久久久久久久| 欧美一区二区三区视频在线| 亚洲国产一成人久久精品| 亚洲欧美激情四射在线日 | 亚洲第一成人在线| 国产精品久久久久久久久久妞妞| 欧美91精品| 久久亚洲精品中文字幕冲田杏梨 | 欧美激情bt| 久久精品日产第一区二区| 亚洲性视频网址| 日韩视频在线观看一区二区| 欧美激情一区二区三区在线| 久久视频免费观看| 久久成人国产| 亚洲欧美偷拍卡通变态| 在线一区亚洲| 一二三区精品| 宅男在线国产精品| 99精品99| 一本色道88久久加勒比精品 | 欧美黄网免费在线观看| 久久久久欧美| 久久久夜精品| 久久一区二区三区国产精品| 久久久夜色精品亚洲| 久久久久久尹人网香蕉| 欧美在线观看日本一区| 欧美一区亚洲| 久久成人精品一区二区三区| 欧美一区二区高清在线观看| 欧美一区二区三区免费视频| 亚洲欧美日韩在线| 欧美在线啊v一区| 久久国产精品网站| 久久免费黄色| 欧美激情 亚洲a∨综合| 欧美日韩卡一卡二| 欧美午夜精品久久久久久久| 国产精品第一页第二页第三页| 国产精品亚洲第一区在线暖暖韩国| 国产精品久久精品日日| 国产精品自拍在线| 国产真实久久| 亚洲国产欧美另类丝袜| 99香蕉国产精品偷在线观看| 亚洲一区二区三区四区五区黄| 亚洲欧洲av一区二区| 久久久久久成人| 亚洲二区视频| 亚洲视频一区| 久久噜噜亚洲综合| 欧美成人小视频| 国产精品国产三级国产aⅴ入口| 国产一区二区三区高清在线观看| 精品不卡视频| 亚洲图片在区色| 久久综合给合| 亚洲免费精品| 欧美一区二区三区视频| 久久久亚洲午夜电影| 欧美日韩精品福利| 国产一区白浆| 99国产一区| 久久久久久69| 一本色道久久综合亚洲91| 久久国产视频网| 欧美视频在线观看免费网址| 一区二区三区在线视频播放| 在线亚洲一区观看| 久久久人成影片一区二区三区观看| 亚洲激情女人| 欧美综合77777色婷婷| 欧美精品在线一区二区三区| 激情国产一区| 亚洲网站在线观看| 女女同性女同一区二区三区91| 亚洲性线免费观看视频成熟| 欧美成人免费一级人片100| 国产精品一区二区三区成人| 亚洲人www| 久久躁日日躁aaaaxxxx| 亚洲一级影院| 欧美精品不卡| 亚洲欧洲在线视频| 久久久亚洲高清| 亚洲一级影院| 欧美四级电影网站| 亚洲精品一区二区三区在线观看| 久久久91精品| 亚洲欧美日韩国产一区二区三区| 欧美另类专区| 亚洲美女诱惑| 欧美成人一区二区三区| 久久高清免费观看| 国产日韩亚洲欧美综合| 亚洲性人人天天夜夜摸| 亚洲激情图片小说视频| 久久精品91久久久久久再现| 国产亚洲激情视频在线| 亚洲欧美在线播放| 一区二区高清视频| 欧美日韩国产高清| 亚洲免费成人av电影| 欧美二区在线播放| 久久亚洲精选| 91久久精品一区二区别| 蜜臀99久久精品久久久久久软件| 久久精品免费播放| 国内久久精品| 久久久国产午夜精品| 欧美夜福利tv在线| 国产综合香蕉五月婷在线| 久久九九久久九九| 欧美一区二区三区电影在线观看| 国产日韩在线看片| 久久久99久久精品女同性| 性欧美大战久久久久久久免费观看| 国产精品专区h在线观看| 久久www免费人成看片高清| 欧美一区二区三区免费观看|