< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp

Print this page




 231         env->DeleteLocalRef(control);
 232         throw;
 233     }
 234     if (!ret) {
 235         /* Couldn't use the printer, or spooler isn't running
 236          * Call Page dialog with ' PD_RETURNDEFAULT' so it doesn't try
 237          * to show the dialog, but does prompt the user to install a printer.
 238          * If this returns false, then they declined and we just return.
 239          */
 240         pd.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
 241         ret = AwtPrintDialog::PrintDlg(&pd);
 242     }
 243     if (!ret) {
 244       result = JNI_FALSE;
 245     }
 246     else
 247     {
 248       pd.lpfnPrintHook = (LPPRINTHOOKPROC)PrintDialogHookProc;
 249       pd.lpfnSetupHook = (LPSETUPHOOKPROC)PrintDialogHookProc;
 250       pd.Flags |= PD_ENABLESETUPHOOK | PD_ENABLEPRINTHOOK;





 251       /*
 252           Fix for 6488834.
 253           To disable Win32 native parent modality we have to set
 254           hwndOwner field to either NULL or some hidden window. For
 255           parentless dialogs we use NULL to show them in the taskbar,
 256           and for all other dialogs AwtToolkit's HWND is used.
 257       */
 258       if (awtParent != NULL)
 259       {
 260           pd.hwndOwner = AwtToolkit::GetInstance().GetHWnd();
 261       }
 262       else
 263       {
 264           pd.hwndOwner = NULL;
 265       }
 266 
 267       AwtDialog::CheckInstallModalHook();
 268 
 269       BOOL ret = AwtPrintDialog::PrintDlg(&pd);
 270       if (ret)
 271       {
 272         AwtPrintControl::UpdateAttributes(env, control, pd);
 273         result = JNI_TRUE;
 274       }
 275       else
 276       {
 277         result = JNI_FALSE;
 278       }




 231         env->DeleteLocalRef(control);
 232         throw;
 233     }
 234     if (!ret) {
 235         /* Couldn't use the printer, or spooler isn't running
 236          * Call Page dialog with ' PD_RETURNDEFAULT' so it doesn't try
 237          * to show the dialog, but does prompt the user to install a printer.
 238          * If this returns false, then they declined and we just return.
 239          */
 240         pd.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
 241         ret = AwtPrintDialog::PrintDlg(&pd);
 242     }
 243     if (!ret) {
 244       result = JNI_FALSE;
 245     }
 246     else
 247     {
 248       pd.lpfnPrintHook = (LPPRINTHOOKPROC)PrintDialogHookProc;
 249       pd.lpfnSetupHook = (LPSETUPHOOKPROC)PrintDialogHookProc;
 250       pd.Flags |= PD_ENABLESETUPHOOK | PD_ENABLEPRINTHOOK;
 251       HWND parent = AwtPrintControl::getParentID(env, control);
 252       if (parent != NULL) {
 253           // Windows native modality is requested (used by JavaFX).
 254           pd.hwndOwner = parent;
 255       }
 256       /*
 257           Fix for 6488834.
 258           To disable Win32 native parent modality we have to set
 259           hwndOwner field to either NULL or some hidden window. For
 260           parentless dialogs we use NULL to show them in the taskbar,
 261           and for all other dialogs AwtToolkit's HWND is used.
 262       */
 263       else if (awtParent != NULL)
 264       {
 265           pd.hwndOwner = AwtToolkit::GetInstance().GetHWnd();
 266       }
 267       else
 268       {
 269           pd.hwndOwner = NULL;
 270       }
 271 
 272       AwtDialog::CheckInstallModalHook();
 273 
 274       BOOL ret = AwtPrintDialog::PrintDlg(&pd);
 275       if (ret)
 276       {
 277         AwtPrintControl::UpdateAttributes(env, control, pd);
 278         result = JNI_TRUE;
 279       }
 280       else
 281       {
 282         result = JNI_FALSE;
 283       }


< prev index next >