两者的参数是一致的,返回值不同, this is because the CWnd::CreateEx 's implementation calls CreateWindowEx API internally! the HWND handle return by CreateWindowEx Win32 API is stored in CWnd::m_hWnd,so it just to return the BOOL to indicate whether our Cratewindow call is successfully executed! 他们和CWND::ONCREATE的关系是怎样的?? virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RE..) is called before Windows calls CreateWindow[Ex] for it. So the m_hWnd is NULL then .However the OnCreate handler for WM_CRATE is called after CCreateWindow[Ex] CWnd::Create[Ex] returns!
However the OnCreate (Message handler for WM_CRATE )is called after CreateWindow[Ex] but before function CWnd::Create[Ex] returns!
Cwnd mywnd;
mywnd.CreateEX()而CreateWindowEx
是window的api函数当然, cwnd::createEx最终是调用CreateWindowEx
来实现窗口的创建的可以说cwnd::createEx是对 CreateWindowEx的封装(所以他们的参数几乎一样)
CreateWindowEx是API函数,创建窗口,不会引起OnCreate事件的发生
this is because the CWnd::CreateEx 's implementation calls
CreateWindowEx API internally!
the HWND handle return by CreateWindowEx Win32 API is stored in
CWnd::m_hWnd,so it just to return the BOOL to indicate whether our Cratewindow
call is successfully executed!
他们和CWND::ONCREATE的关系是怎样的??
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RE..)
is called before Windows calls CreateWindow[Ex] for it. So the m_hWnd is NULL then .However the OnCreate handler for WM_CRATE is called after CCreateWindow[Ex]
CWnd::Create[Ex] returns!
CWnd::Create[Ex] returns!