前言:它們之間的聯(lián)系和區(qū)別在網(wǎng)上也比較多,但是看來(lái)看去還是不怎么明白,后面還是老老實(shí)實(shí)的看了MSDN,然后有了大致的理解,為了加深理解我特將這快翻譯出來(lái)供大家一起參考,不過(guò)英語(yǔ)實(shí)在太爛總共只有幾句也發(fā)現(xiàn)有些翻譯的不行,尤其是第三句自己感覺(jué)就覺(jué)得很不爽,有意見(jiàn)的盡管提,既包括翻譯內(nèi)容也包括對(duì)CWND對(duì)象和HWND之間的見(jiàn)解。
原文:
The window
object is an object of the C++
CWnd class (or a derived class) that your program creates directly. It comes and goes in response to your program’s constructor and destructor calls. The Windows
window, on the other hand, is an opaque handle to an internal Windows data structure that corresponds to a window and consumes system resources when present. A Windows window is identified by a “window handle” (
HWND) and is created after the
CWnd object is created by a call to the
Create member function of class
CWnd. The window may be destroyed either by a program call or by a user’s action. The window handle is stored in the window object’s
m_hWnd member variable. The following figure shows the relationship between the C++ window object and the Windows window.
Window Object and Windows Window

譯文:
窗體對(duì)象(window object)是一個(gè)由你的程序手動(dòng)創(chuàng)建的C++的CWND類(或者從該類繼承的子類)對(duì)象。
它伴隨你的程序的構(gòu)造和析構(gòu)而被創(chuàng)建和銷毀
而操作系統(tǒng)窗體(Windows window),從另一方面來(lái)說(shuō),對(duì)于操作系統(tǒng)內(nèi)部數(shù)據(jù)結(jié)構(gòu)而言,它是一個(gè)透明的
句柄,也就是說(shuō)它是這樣一個(gè)窗體,在被創(chuàng)建的時(shí)候(直接)消耗著操作系統(tǒng)的資源
這個(gè)操作系統(tǒng)窗體("Windws window" )是被 HWND("window handle")所唯一標(biāo)識(shí)的,它是由CWND對(duì)象創(chuàng)建后通過(guò)調(diào)用
CWND類的Create成員函數(shù)來(lái)創(chuàng)建的。
窗體既可以通過(guò)程序來(lái)終止也可以通過(guò)用戶自己來(lái)手動(dòng)終止。
窗體句柄是存儲(chǔ)在窗口對(duì)象(Window object)的m_hWnd這個(gè)成員變量中;
下面這幅圖表明了C++的Windows對(duì)象和 操作系統(tǒng)的窗體之間的聯(lián)系,
Window Object and Windows Window

注:
從網(wǎng)上看到了一個(gè)比較通俗但是感覺(jué)還好理解的比方,如下:
CWND是MFC中窗口的基類,HWND是WINDOWS中窗口對(duì)象化管理的一個(gè)方面,就像班上人的學(xué)號(hào)一樣,
我只要叫一下:“5號(hào),給我倒杯茶”或者“10號(hào),去操場(chǎng)跑一圈”他們就自動(dòng)去了,我不必要知道他們
怎么倒茶的,或者他們的跑步資勢(shì)。從實(shí)際上來(lái)看,HWND可能是一個(gè)全局?jǐn)?shù)組的序號(hào),這個(gè)數(shù)組的一
部分可能就是指向窗口的信息。