我用以下老技巧将子窗口子类化:
SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)&NewWndProc);
但WM_CREATE
消息永远不会发送给它:
LRESULT CALLBACK NewWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HBRUSH hBackground;
switch (msg)
{
case WM_CREATE:
// this is never received in my child window
break;
}
}
另一种可以替代它的消息是什么,我可以在其中初始化我打算在HBRUSH
或HBITMAP
中使用的WM_PAINT
,WM_NOTIFY / NM_CUSTOMDRAW
变量?>