TRACE("uMsg: WM_USER+%d\n",uMsg-WM_USER);
/* Call user paint hook if enable */
if (pda->dlga->Flags & PSD_ENABLEPAGEPAINTHOOK)
- if (pda->dlga->lpfnPagePaintHook(hwndDlg, uMsg, wParam, lParam))
+ if (pda->dlga->lpfnPagePaintHook && pda->dlga->lpfnPagePaintHook(hwndDlg, uMsg, wParam, lParam))
return TRUE;
switch (uMsg) {
GWLP_WNDPROC,
(ULONG_PTR)PRINTDLG_PagePaintProc);
- /* FIXME: Paint hook. Must it be at begin of initialization or at end? */
+ /* Process WM_INITDIALOG with PageSetupHook before other messages */
res = TRUE;
if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) {
- if (!pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,(LPARAM)pda->dlga))
+ if (pda->dlga->lpfnPageSetupHook && !pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,(LPARAM)pda->dlga))
FIXME("Setup page hook failed?\n");
}
WARN("__WINE_PAGESETUPDLGDATA prop not set?\n");
return FALSE;
}
- if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) {
- res = pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,lParam);
- if (res) return res;
- }
+
+ if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) {
+ if (pda->dlga->lpfnPageSetupHook && pda->dlga->lpfnPageSetupHook(hDlg, uMsg, wParam, lParam))
+ return TRUE; /* do not process this message with default procedure */
+ /* TODO: if hook processes message it must returns a valid brush handle */
+ }
}
switch (uMsg) {
case WM_COMMAND:
return PRINTDLG_PS_WMCommandA(hDlg, wParam, lParam, pda);
+/* case WM_CTLCOLORDLG:*/
+ /* FIXME: any other WM_CTLCOLORDLG* ? */
+/* FIXME("WM_CTLCOLORDLG do not realize yet\n");*/
+/* return TRUE;*/
}
return FALSE;
}