Index: trunk/src/user32/HOOK.CPP
===================================================================
--- trunk/src/user32/HOOK.CPP	(revision 8130)
+++ trunk/src/user32/HOOK.CPP	(revision 8132)
@@ -1,3 +1,3 @@
-/* $Id: HOOK.CPP,v 1.35 2002-02-11 16:05:58 sandervl Exp $ */
+/* $Id: HOOK.CPP,v 1.36 2002-03-28 16:20:06 sandervl Exp $ */
 
 /*
@@ -861,2 +861,34 @@
                           ? TRUE : FALSE);
 }
+
+#ifdef __WIN32OS2__
+//******************************************************************************
+//Custom Odin hooks
+static HOOKPROC pfnOdinHook = NULL;
+//******************************************************************************
+HHOOK WIN32API SetOdinHookA(HOOKPROC proc )
+{
+    if(pfnOdinHook) DebugInt3();
+
+    pfnOdinHook = proc;
+    return (HHOOK)proc;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API UnhookOdinHook(HHOOK hhook)
+{
+    pfnOdinHook = NULL;
+    return TRUE;
+}
+//******************************************************************************
+//******************************************************************************
+LRESULT HOOK_CallOdinHookA(INT code, WPARAM wParam, LPARAM lParam)
+{
+    if(pfnOdinHook) {
+        return pfnOdinHook(code, wParam, lParam);
+    }
+    return 0;
+}
+//******************************************************************************
+//******************************************************************************
+#endif //__WIN32OS2__
Index: trunk/src/user32/win32wbase.cpp
===================================================================
--- trunk/src/user32/win32wbase.cpp	(revision 8130)
+++ trunk/src/user32/win32wbase.cpp	(revision 8132)
@@ -1,3 +1,3 @@
-/* $Id: win32wbase.cpp,v 1.320 2002-03-27 10:56:25 sandervl Exp $ */
+/* $Id: win32wbase.cpp,v 1.321 2002-03-28 16:20:06 sandervl Exp $ */
 /*
  * Win32 Window Base Class for OS/2
@@ -46,4 +46,5 @@
 #include <heapstring.h>
 #include <winuser32.h>
+#include <custombuild.h>
 #include "win32wbase.h"
 #include "wndmsg.h"
@@ -638,5 +639,5 @@
         if(ret)
         {
-            dprintf(("CBT-hook returned 0!!"));
+            dprintf(("CBT-hook returned non-0 !!"));
             SetLastError(ERROR_CAN_NOT_COMPLETE); //todo: wrong error
             return FALSE;
@@ -904,4 +905,7 @@
             if (!(getStyle() & WS_CHILD) && !owner)
                 HOOK_CallHooksA(WH_SHELL, HSHELL_WINDOWCREATED, getWindowHandle(), 0);
+
+            //Call custom Odin hook for window creation (for all windows)
+            HOOK_CallOdinHookA(HODIN_WINDOWCREATED, hwnd, 0);
 
             SetLastError(0);
Index: trunk/src/user32/windlg.cpp
===================================================================
--- trunk/src/user32/windlg.cpp	(revision 8130)
+++ trunk/src/user32/windlg.cpp	(revision 8132)
@@ -1,3 +1,3 @@
-/* $Id: windlg.cpp,v 1.31 2002-02-26 11:12:25 sandervl Exp $ */
+/* $Id: windlg.cpp,v 1.32 2002-03-28 16:20:07 sandervl Exp $ */
 /*
  * Win32 dialog apis for OS/2
@@ -66,23 +66,4 @@
 }
 //******************************************************************************
-//This function can be used by a custom Odin build to register a hook procedure
-//that gets called before or after dialog creation
-//******************************************************************************
-static HOOKPROC pfnCustomDialogHook = NULL;
-//******************************************************************************
-BOOL WIN32API SetCustomDialogHook(HOOKPROC pfnDialogProc)
-{
-    dprintf(("SetCustomDialogHook %x", pfnDialogProc));
-    pfnCustomDialogHook = pfnDialogProc;
-    return TRUE;
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API ClearCustomDialogHook()
-{
-    pfnCustomDialogHook = NULL;
-    return TRUE;
-}
-//******************************************************************************
 //******************************************************************************
 HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hInst,
@@ -112,9 +93,5 @@
     }
     HWND hwnd = dialog->getWindowHandle();
-
-    if(pfnCustomDialogHook) {
-        dprintf(("Calling Dialog hook for dialog %x", hwnd));
-        pfnCustomDialogHook(HCUSTOM_POSTDIALOGCREATION, hwnd, 0);
-    }
+    HOOK_CallOdinHookA(HODIN_POSTDIALOGCREATION, hwnd, 0);
 
     RELEASE_WNDOBJ(dialog);
@@ -150,8 +127,5 @@
     HWND hwnd = dialog->getWindowHandle();
 
-    if(pfnCustomDialogHook) {
-        dprintf(("Calling Dialog hook for dialog %x", hwnd));
-        pfnCustomDialogHook(HCUSTOM_POSTDIALOGCREATION, hwnd, 0);
-    }
+    HOOK_CallOdinHookA(HODIN_POSTDIALOGCREATION, hwnd, 0);
 
     RELEASE_WNDOBJ(dialog);
