V
also create(null ???, ...
A)
wenn ich klassen (win) nutzen will, die nicht von haus aus verwendet werden können (z.b edit, button ...) muß ich diese registieren.
BOOL COneT32App::InitInstance()
{
// Register your unique class name that you wish to use
WNDCLASS wndcls;
memset(&wndcls, 0, sizeof(WNDCLASS)); // start with NULL
// defaults
wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
//you can specify your own window procedure
wndcls.lpfnWndProc = ::DefWindowProc;
wndcls.hInstance = AfxGetInstanceHandle();
wndcls.hIcon = LoadIcon(IDR_MAINFRAME); // or load a different icon
wndcls.hCursor = LoadCursor( IDC_ARROW );
wndcls.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
wndcls.lpszMenuName = NULL;
// Specify your own class name for using FindWindow later
wndcls.lpszClassName = _T("MyNewClass");
// Register the new class and exit if it fails
if(!AfxRegisterClass(&wndcls))
{
TRACE("Class Registration Failed\n");
return FALSE;
}
// Rest of InitInstance goes here
...
}
oder
LPCTSTR lpszClass=AfxRegisterWndClass(nClass, ::LoadCursor(NULL, IDC_ARROW), NULL, NULL);
CWnd::CreateEx(dwExStyle, lpszClass, "", dwStyle | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, \
rect, pParent, nID);
oder man nutzt
LRESULT CPanelCtrlD::OnEraseBkgnd(WPARAM wParam, LPARAM lParam)
{
}
BOOL CCaptionD::OnEraseBkgnd(CDC* pDC)
{
}
volker