◄CWnd► ◄Up► ◄Contents► ◄Index► ◄Back► ──Microsoft Foundation Classes────────────────────────────────────────────── afx_msg int OnCreate( LPCREATESTRUCT lpCreateStruct ); Parameter Description <lpCreateStruct> Points to a ◄CREATESTRUCT► structure containing information about the CWnd object being created. Remarks Called when an application requests that the CWnd object be created by calling the ◄Create► or ◄CreateEx► member function. The new CWnd object receives this call after the CWnd object is created but before it becomes visible. OnCreate is called before the Create or CreateEx member function returns. Override this member function to perform any needed initialization of a derived class. The ◄CREATESTRUCT► structure contains copies of the parameters used to create the window. This message-handler member function calls the ◄Default► member function. Override this member function in your derived class to handle the ◄WM_CREATE► message. Return Value OnCreate must return 0 to continue the creation of the CWnd object. If the application returns -1, the CWnd will be destroyed. See Also ◄CWnd::CreateEx►, ◄CWnd::OnNcCreate►, ◄WM_CREATE►, ◄CWnd::Default►, ◄CWnd::FromHandle► -♦-