6792023: Print suspends on Windows 2000 Pro since 6u12 b01
authordcherepanov
Tue, 17 Feb 2009 14:30:52 +0300
changeset 2456 45ee87a35349
parent 2455 e2d60882b891
child 2457 38ee6f7fd9f8
6792023: Print suspends on Windows 2000 Pro since 6u12 b01 Reviewed-by: art, anthony
jdk/src/windows/native/sun/windows/awt_FileDialog.cpp
jdk/src/windows/native/sun/windows/awt_PrintDialog.cpp
jdk/src/windows/native/sun/windows/awt_PrintJob.cpp
jdk/src/windows/native/sun/windows/awt_Window.h
--- a/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp	Tue Feb 17 14:27:03 2009 +0300
+++ b/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp	Tue Feb 17 14:30:52 2009 +0300
@@ -101,7 +101,8 @@
         }
     }
 
-    return ComCtl32Util::GetInstance().DefWindowProc(NULL, hWnd, message, wParam, lParam);
+    WNDPROC lpfnWndProc = (WNDPROC)(::GetProp(hWnd, NativeDialogWndProcProp));
+    return ComCtl32Util::GetInstance().DefWindowProc(lpfnWndProc, hWnd, message, wParam, lParam);
 }
 
 static UINT_PTR CALLBACK
@@ -135,16 +136,19 @@
             }
 
             // subclass dialog's parent to receive additional messages
-            ComCtl32Util::GetInstance().SubclassHWND(parent,
-                                                     FileDialogWndProc);
+            WNDPROC lpfnWndProc = ComCtl32Util::GetInstance().SubclassHWND(parent,
+                                                                           FileDialogWndProc);
+            ::SetProp(parent, NativeDialogWndProcProp, reinterpret_cast<HANDLE>(lpfnWndProc));
 
             break;
         }
         case WM_DESTROY: {
+            WNDPROC lpfnWndProc = (WNDPROC)(::GetProp(parent, NativeDialogWndProcProp));
             ComCtl32Util::GetInstance().UnsubclassHWND(parent,
                                                        FileDialogWndProc,
-                                                       NULL);
+                                                       lpfnWndProc);
             ::RemoveProp(parent, ModalDialogPeerProp);
+            ::RemoveProp(parent, NativeDialogWndProcProp);
             break;
         }
         case WM_NOTIFY: {
--- a/jdk/src/windows/native/sun/windows/awt_PrintDialog.cpp	Tue Feb 17 14:27:03 2009 +0300
+++ b/jdk/src/windows/native/sun/windows/awt_PrintDialog.cpp	Tue Feb 17 14:30:52 2009 +0300
@@ -65,7 +65,8 @@
         }
     }
 
-    return ComCtl32Util::GetInstance().DefWindowProc(NULL, hWnd, message, wParam, lParam);
+    WNDPROC lpfnWndProc = (WNDPROC)(::GetProp(hWnd, NativeDialogWndProcProp));
+    return ComCtl32Util::GetInstance().DefWindowProc(lpfnWndProc, hWnd, message, wParam, lParam);
 }
 
 static UINT_PTR CALLBACK
@@ -99,16 +100,19 @@
             }
 
             // subclass dialog's parent to receive additional messages
-            ComCtl32Util::GetInstance().SubclassHWND(hdlg,
-                                                     PrintDialogWndProc);
+            WNDPROC lpfnWndProc = ComCtl32Util::GetInstance().SubclassHWND(hdlg,
+                                                                           PrintDialogWndProc);
+            ::SetProp(hdlg, NativeDialogWndProcProp, reinterpret_cast<HANDLE>(lpfnWndProc));
 
             break;
         }
         case WM_DESTROY: {
+            WNDPROC lpfnWndProc = (WNDPROC)(::GetProp(hdlg, NativeDialogWndProcProp));
             ComCtl32Util::GetInstance().UnsubclassHWND(hdlg,
                                                        PrintDialogWndProc,
-                                                       NULL);
+                                                       lpfnWndProc);
             ::RemoveProp(hdlg, ModalDialogPeerProp);
+            ::RemoveProp(hdlg, NativeDialogWndProcProp);
             break;
         }
     }
--- a/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp	Tue Feb 17 14:27:03 2009 +0300
+++ b/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp	Tue Feb 17 14:30:52 2009 +0300
@@ -2885,7 +2885,8 @@
         }
     }
 
-    return ComCtl32Util::GetInstance().DefWindowProc(NULL, hWnd, message, wParam, lParam);
+    WNDPROC lpfnWndProc = (WNDPROC)(::GetProp(hWnd, NativeDialogWndProcProp));
+    return ComCtl32Util::GetInstance().DefWindowProc(lpfnWndProc, hWnd, message, wParam, lParam);
 }
 
 /**
@@ -2919,16 +2920,19 @@
             }
 
             // subclass dialog's parent to receive additional messages
-            ComCtl32Util::GetInstance().SubclassHWND(hDlg,
-                                                     PageDialogWndProc);
+            WNDPROC lpfnWndProc = ComCtl32Util::GetInstance().SubclassHWND(hDlg,
+                                                                           PageDialogWndProc);
+            ::SetProp(hDlg, NativeDialogWndProcProp, reinterpret_cast<HANDLE>(lpfnWndProc));
 
             break;
         }
         case WM_DESTROY: {
+            WNDPROC lpfnWndProc = (WNDPROC)(::GetProp(hDlg, NativeDialogWndProcProp));
             ComCtl32Util::GetInstance().UnsubclassHWND(hDlg,
                                                        PageDialogWndProc,
-                                                       NULL);
+                                                       lpfnWndProc);
             ::RemoveProp(hDlg, ModalDialogPeerProp);
+            ::RemoveProp(hDlg, NativeDialogWndProcProp);
             break;
         }
     }
--- a/jdk/src/windows/native/sun/windows/awt_Window.h	Tue Feb 17 14:27:03 2009 +0300
+++ b/jdk/src/windows/native/sun/windows/awt_Window.h	Tue Feb 17 14:30:52 2009 +0300
@@ -34,6 +34,7 @@
 // property name tagging windows disabled by modality
 static LPCTSTR ModalBlockerProp = TEXT("SunAwtModalBlockerProp");
 static LPCTSTR ModalDialogPeerProp = TEXT("SunAwtModalDialogPeerProp");
+static LPCTSTR NativeDialogWndProcProp = TEXT("SunAwtNativeDialogWndProcProp");
 
 #ifndef WH_MOUSE_LL
 #define WH_MOUSE_LL 14