前言:它們之間的聯(lián)系和區(qū)別在網(wǎng)上也比較多,但是看來看去還是不怎么明白,后面還是老老實實的看了MSDN,然后有了大致的理解,為了加深理解我特將這快翻譯出來供大家一起參考,不過英語實在太爛總共只有幾句也發(fā)現(xiàn)有些翻譯的不行,尤其是第三句自己感覺就覺得很不爽,有意見的盡管提,既包括翻譯內(nèi)容也包括對CWND對象和HWND之間的見解。
原文:
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

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

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