Some changes for print dialog
authorVitaly Lipatov <lav@etersoft.ru>
Fri, 25 Apr 2008 06:35:23 +0000 (10:35 +0400)
committerКонстантин Кондратюк <kondratyuk@builder.office.etersoft.ru>
Fri, 25 Apr 2008 06:35:23 +0000 (10:35 +0400)
dlls/comdlg32/printdlg.c

index 808a33c7417c36dca28b3513adc6fdb0f9d67e5c..9d876275b4ce901b14c4d2c0a7f8df86574e2fd9 100644 (file)
@@ -3096,7 +3096,7 @@ PRINTDLG_DefaultPagePaintHook(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
     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) {
@@ -3305,10 +3305,10 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
             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");
        }
 
@@ -3393,14 +3393,20 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
            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;
 }