komisches Subclassing-prob
-
Hallo!
Ich will gerade einen Dialog subclassen. Die eigene Wndproc soll nur WM_CTLCOLORBTN abfangen.
WNDPROC oldWndProc = NULL; oldWndProc = (WNDPROC)SetWindowLong(wnd, GWL_WNDPROC, (long)SubClassProc); ///// SubclassProc: switch(msg) { case WM_CTLCOLORBTN: if(w.type == WT_CHKBOX) { SetBkMode((HDC)wParam, TRANSPARENT); return 1; } else return 0; break; default: return CallWindowProc(oldWindowProc, wnd, msg, wParam, lParam); break; } return CallWindowProc(owp, wnd, msg, wParam, lParam);Wenn ich das so mache, dann hat der Dialog aber keinen Hintergrund mehr, aber man kann auch nciht durchklicken. Außerdem sehen die Buttons nur noch grau aus, ohne Struktur o.ä.
Könnt ihr mir helfen?
edit: [cpp] sieht schöner aus als [code].

-
MSDN schrieb:
WM_CTLCOLORBTN...If an application processes this message, it must return a handle to a brush. The system uses the brush to paint the background of the button.
um dem dialog wieder hintergrund zu verschaffen versuch mal eine WM_PAINT an die alte WndProc zu schicken...
-
WM_PAINT soll man nie direkt schicken - wohl eher InvalidateRect oder ähnliches

-
ich weis, InvalidateRect() ist wohl angebracheter

-
Auch mit InvalidateRect geht es nicht
Selbst, wenn ich in der SubclassProc alle Nachrichten an die richtige weiterleite, sieht man das Dialogfeld nicht
