Moved private USER definitions to a new user_private.h header, and
removed the global user.h.

diff --git a/dlls/user/button.c b/dlls/user/button.c
index 50bd16e..676e67d 100644
--- a/dlls/user/button.c
+++ b/dlls/user/button.c
@@ -73,7 +73,7 @@
 #include "wingdi.h"
 #include "wine/winuser16.h"
 #include "controls.h"
-#include "user.h"
+#include "user_private.h"
 
 /* GetWindowLong offsets for window extra information */
 #define STATE_GWL_OFFSET  0
diff --git a/dlls/user/combo.c b/dlls/user/combo.c
index c70a494..e7c5348 100644
--- a/dlls/user/combo.c
+++ b/dlls/user/combo.c
@@ -45,7 +45,6 @@
 #include "wine/winuser16.h"
 #include "wine/unicode.h"
 #include "message.h"
-#include "user.h"
 #include "win.h"
 #include "controls.h"
 #include "winreg.h"
diff --git a/dlls/user/comm16.c b/dlls/user/comm16.c
index 35ee2f8..c7303d4 100644
--- a/dlls/user/comm16.c
+++ b/dlls/user/comm16.c
@@ -68,6 +68,7 @@
 #include "winuser.h"
 #include "wine/winuser16.h"
 #include "win.h"
+#include "user_private.h"
 #include "winerror.h"
 
 #include "wine/debug.h"
diff --git a/dlls/user/controls.h b/dlls/user/controls.h
index e21e72d..a2ac8b6 100644
--- a/dlls/user/controls.h
+++ b/dlls/user/controls.h
@@ -46,6 +46,9 @@
 };
 
 
+/* defwnd proc */
+extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType );
+
 /* desktop */
 extern BOOL DESKTOP_SetPattern( LPCWSTR pattern );
 
@@ -58,6 +61,7 @@
 extern HMENU MENU_GetSysMenu(HWND hWndOwner, HMENU hSysPopup);
 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
                                      INT orgX, INT orgY );
+extern BOOL MENU_SetMenu(HWND, HMENU);
 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt );
 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar );
 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
diff --git a/dlls/user/desktop.c b/dlls/user/desktop.c
index 9d07dc6..81e6ff6 100644
--- a/dlls/user/desktop.c
+++ b/dlls/user/desktop.c
@@ -30,7 +30,6 @@
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
-#include "user.h"
 #include "controls.h"
 #include "wine/winuser16.h"
 
diff --git a/dlls/user/dialog16.c b/dlls/user/dialog16.c
index e01ed47..669f14f 100644
--- a/dlls/user/dialog16.c
+++ b/dlls/user/dialog16.c
@@ -29,7 +29,7 @@
 #include "wine/winuser16.h"
 #include "controls.h"
 #include "win.h"
-#include "user.h"
+#include "user_private.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dialog);
diff --git a/dlls/user/display.c b/dlls/user/display.c
index 76353e2..f4146cb 100644
--- a/dlls/user/display.c
+++ b/dlls/user/display.c
@@ -23,7 +23,7 @@
 #include "wine/debug.h"
 #include "windef.h"
 #include "winbase.h"
-#include "user.h"
+#include "user_private.h"
 #include "wine/winuser16.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(cursor);
diff --git a/dlls/user/edit.c b/dlls/user/edit.c
index a9785d5..4d7871b 100644
--- a/dlls/user/edit.c
+++ b/dlls/user/edit.c
@@ -71,7 +71,7 @@
 #include "controls.h"
 #include "local.h"
 #include "message.h"
-#include "user.h"
+#include "user_private.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(edit);
diff --git a/dlls/user/focus.c b/dlls/user/focus.c
index 3126379..212eaaf 100644
--- a/dlls/user/focus.c
+++ b/dlls/user/focus.c
@@ -31,7 +31,7 @@
 #include "winerror.h"
 #include "win.h"
 #include "message.h"
-#include "user.h"
+#include "user_private.h"
 #include "wine/server.h"
 #include "wine/debug.h"
 
diff --git a/dlls/user/hook.c b/dlls/user/hook.c
index 4ac3504..13491d5 100644
--- a/dlls/user/hook.c
+++ b/dlls/user/hook.c
@@ -73,6 +73,7 @@
 #include "heap.h"
 #include "message.h"
 #include "win.h"
+#include "user_private.h"
 #include "wine/server.h"
 #include "wine/unicode.h"
 #include "wine/debug.h"
diff --git a/dlls/user/hook16.c b/dlls/user/hook16.c
index 8bcef5c..073d91df 100644
--- a/dlls/user/hook16.c
+++ b/dlls/user/hook16.c
@@ -30,6 +30,7 @@
 #include "wine/winuser16.h"
 #include "message.h"
 #include "win.h"
+#include "user_private.h"
 #include "winproc.h"
 #include "wine/debug.h"
 
diff --git a/dlls/user/listbox.c b/dlls/user/listbox.c
index 84b2e05..57abfc4 100644
--- a/dlls/user/listbox.c
+++ b/dlls/user/listbox.c
@@ -48,7 +48,6 @@
 #include "winuser.h"
 #include "winerror.h"
 #include "message.h"
-#include "user.h"
 #include "controls.h"
 #include "wine/debug.h"
 #include "win.h"
diff --git a/dlls/user/menu.c b/dlls/user/menu.c
index bf84233..385b01d 100644
--- a/dlls/user/menu.c
+++ b/dlls/user/menu.c
@@ -44,7 +44,7 @@
 #include "win.h"
 #include "controls.h"
 #include "nonclient.h"
-#include "user.h"
+#include "user_private.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(menu);
diff --git a/dlls/user/message.c b/dlls/user/message.c
index 32d17b2..8632a68 100644
--- a/dlls/user/message.c
+++ b/dlls/user/message.c
@@ -35,7 +35,7 @@
 #include "wine/unicode.h"
 #include "wine/server.h"
 #include "message.h"
-#include "user.h"
+#include "user_private.h"
 #include "win.h"
 #include "winproc.h"
 #include "wine/debug.h"
diff --git a/dlls/user/message.h b/dlls/user/message.h
index 6098388..fb98a18 100644
--- a/dlls/user/message.h
+++ b/dlls/user/message.h
@@ -88,4 +88,10 @@
                              LRESULT lReturn, WPARAM wParam, LPARAM lParam );
 extern int SPY_Init(void);
 
+/* check if hwnd is a broadcast magic handle */
+inline static BOOL is_broadcast( HWND hwnd )
+{
+    return (hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST);
+}
+
 #endif  /* __WINE_MESSAGE_H */
diff --git a/dlls/user/msg16.c b/dlls/user/msg16.c
index 70ade57..9bec8ae 100644
--- a/dlls/user/msg16.c
+++ b/dlls/user/msg16.c
@@ -23,6 +23,7 @@
 #include "winerror.h"
 #include "message.h"
 #include "win.h"
+#include "user_private.h"
 #include "winproc.h"
 #include "wine/debug.h"
 
diff --git a/dlls/user/resource.c b/dlls/user/resource.c
index bde2d29..817309e 100644
--- a/dlls/user/resource.c
+++ b/dlls/user/resource.c
@@ -28,7 +28,6 @@
 #include "wine/winbase16.h"
 #include "wine/winuser16.h"
 #include "wownt32.h"
-#include "user.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(resource);
diff --git a/dlls/user/scroll.c b/dlls/user/scroll.c
index 0f37617..1bc3a19 100644
--- a/dlls/user/scroll.c
+++ b/dlls/user/scroll.c
@@ -42,7 +42,7 @@
 #include "controls.h"
 #include "win.h"
 #include "wine/debug.h"
-#include "user.h"
+#include "user_private.h"
 #include "message.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(scroll);
diff --git a/dlls/user/static.c b/dlls/user/static.c
index 9c62d91..2a2aae7 100644
--- a/dlls/user/static.c
+++ b/dlls/user/static.c
@@ -56,7 +56,7 @@
 #include "wownt32.h"
 #include "cursoricon.h"
 #include "controls.h"
-#include "user.h"
+#include "user_private.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(static);
diff --git a/dlls/user/text.c b/dlls/user/text.c
index 5fc7bc6..5c6921a 100644
--- a/dlls/user/text.c
+++ b/dlls/user/text.c
@@ -39,7 +39,6 @@
 #include "winerror.h"
 #include "winnls.h"
 #include "wownt32.h"
-#include "user.h"
 #include "controls.h"
 #include "wine/debug.h"
 
diff --git a/dlls/user/uitools.c b/dlls/user/uitools.c
index 4c1b566..243a863 100644
--- a/dlls/user/uitools.c
+++ b/dlls/user/uitools.c
@@ -26,7 +26,7 @@
 #include "wingdi.h"
 #include "wine/winuser16.h"
 #include "winuser.h"
-#include "user.h"
+#include "user_private.h"
 #include "wine/unicode.h"
 #include "wine/debug.h"
 
diff --git a/dlls/user/user16.c b/dlls/user/user16.c
index a20f78b..87db925 100644
--- a/dlls/user/user16.c
+++ b/dlls/user/user16.c
@@ -24,7 +24,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "wownt32.h"
-#include "user.h"
+#include "user_private.h"
 #include "win.h"
 #include "winproc.h"
 #include "cursoricon.h"
diff --git a/dlls/user/user_main.c b/dlls/user/user_main.c
index 70d2a03..2a9d095 100644
--- a/dlls/user/user_main.c
+++ b/dlls/user/user_main.c
@@ -31,7 +31,7 @@
 #include "controls.h"
 #include "cursoricon.h"
 #include "message.h"
-#include "user.h"
+#include "user_private.h"
 #include "win.h"
 #include "wine/debug.h"
 
diff --git a/dlls/user/user_private.h b/dlls/user/user_private.h
new file mode 100644
index 0000000..e3e3833
--- /dev/null
+++ b/dlls/user/user_private.h
@@ -0,0 +1,144 @@
+/*
+ * USER private definitions
+ *
+ * Copyright 1993 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_USER_PRIVATE_H
+#define __WINE_USER_PRIVATE_H
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "local.h"
+
+extern WORD USER_HeapSel;
+
+#define USER_HEAP_ALLOC(size) \
+            ((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) ))
+#define USER_HEAP_REALLOC(handle,size) \
+            ((HANDLE)(ULONG_PTR)LOCAL_ReAlloc( USER_HeapSel, LOWORD(handle), (size), LMEM_FIXED ))
+#define USER_HEAP_FREE(handle) \
+            LOCAL_Free( USER_HeapSel, LOWORD(handle) )
+#define USER_HEAP_LIN_ADDR(handle)  \
+         ((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, LOWORD(handle))) : NULL)
+
+#define GET_WORD(ptr)  (*(const WORD *)(ptr))
+#define GET_DWORD(ptr) (*(const DWORD *)(ptr))
+
+/* internal messages codes */
+enum wine_internal_message
+{
+    WM_WINE_DESTROYWINDOW = 0x80000000,
+    WM_WINE_SETWINDOWPOS,
+    WM_WINE_SHOWWINDOW,
+    WM_WINE_SETPARENT,
+    WM_WINE_SETWINDOWLONG,
+    WM_WINE_ENABLEWINDOW,
+    WM_WINE_SETACTIVEWINDOW,
+    WM_WINE_KEYBOARD_LL_HOOK,
+    WM_WINE_MOUSE_LL_HOOK
+};
+
+struct tagCURSORICONINFO;
+
+typedef struct tagUSER_DRIVER {
+    /* keyboard functions */
+    void   (*pInitKeyboard)(LPBYTE);
+    SHORT  (*pVkKeyScanEx)(WCHAR, HKL);
+    UINT   (*pMapVirtualKeyEx)(UINT, UINT, HKL);
+    INT    (*pGetKeyNameText)(LONG, LPWSTR, INT);
+    INT    (*pToUnicodeEx)(UINT, UINT, LPBYTE, LPWSTR, int, UINT, HKL);
+    UINT   (*pGetKeyboardLayoutList)(INT, HKL *);
+    HKL    (*pGetKeyboardLayout)(DWORD);
+    BOOL   (*pGetKeyboardLayoutName)(LPWSTR);
+    HKL    (*pLoadKeyboardLayout)(LPCWSTR, UINT);
+    HKL    (*pActivateKeyboardLayout)(HKL, UINT);
+    BOOL   (*pUnloadKeyboardLayout)(HKL);
+    void   (*pBeep)(void);
+    /* mouse functions */
+    void   (*pInitMouse)(LPBYTE);
+    void   (*pSetCursor)(struct tagCURSORICONINFO *);
+    void   (*pGetCursorPos)(LPPOINT);
+    void   (*pSetCursorPos)(INT,INT);
+    /* screen saver functions */
+    BOOL   (*pGetScreenSaveActive)(void);
+    void   (*pSetScreenSaveActive)(BOOL);
+    /* clipboard functions */
+    void   (*pAcquireClipboard)(HWND);                     /* Acquire selection */
+    BOOL   (*pCountClipboardFormats)(void);                /* Count available clipboard formats */
+    void   (*pEmptyClipboard)(BOOL);                       /* Empty clipboard data */
+    BOOL   (*pEndClipboardUpdate)(void);                   /* End clipboard update */
+    BOOL   (*pEnumClipboardFormats)(UINT);                 /* Enumerate clipboard formats */
+    BOOL   (*pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */
+    BOOL   (*pGetClipboardFormatName)(UINT, LPSTR, UINT);  /* Get a clipboard format name */
+    BOOL   (*pIsClipboardFormatAvailable)(UINT);           /* Check if specified format is available */
+    INT    (*pRegisterClipboardFormat)(LPCSTR);            /* Register a clipboard format */
+    void   (*pResetSelectionOwner)(HWND, BOOL);
+    BOOL   (*pSetClipboardData)(UINT, HANDLE16, HANDLE, BOOL);   /* Set specified selection data */
+    /* display modes */
+    LONG   (*pChangeDisplaySettingsExW)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
+    BOOL   (*pEnumDisplaySettingsExW)(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
+    /* windowing functions */
+    BOOL   (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL);
+    BOOL   (*pDestroyWindow)(HWND);
+    BOOL   (*pGetDC)(HWND,HDC,HRGN,DWORD);
+    void   (*pForceWindowRaise)(HWND);
+    DWORD  (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
+    void   (*pReleaseDC)(HWND,HDC);
+    BOOL   (*pScrollDC)(HDC, INT, INT, const RECT *, const RECT *, HRGN, LPRECT);
+    void   (*pSetFocus)(HWND);
+    HWND   (*pSetParent)(HWND,HWND);
+    BOOL   (*pSetWindowPos)(WINDOWPOS *);
+    int    (*pSetWindowRgn)(HWND,HRGN,BOOL);
+    void   (*pSetWindowIcon)(HWND,UINT,HICON);
+    void   (*pSetWindowStyle)(HWND,DWORD);
+    BOOL   (*pSetWindowText)(HWND,LPCWSTR);
+    BOOL   (*pShowWindow)(HWND,INT);
+    void   (*pSysCommandSizeMove)(HWND,WPARAM);
+} USER_DRIVER;
+
+extern USER_DRIVER USER_Driver;
+
+extern HMODULE user32_module;
+extern BYTE InputKeyStateTable[256];
+extern BYTE AsyncKeyStateTable[256];
+extern DWORD USER16_AlertableWait;
+
+extern BOOL CLIPBOARD_ReleaseOwner(void);
+extern BOOL FOCUS_MouseActivate( HWND hwnd );
+extern BOOL HOOK_IsHooked( INT id );
+extern void SYSCOLOR_Init(void);
+extern HPEN SYSCOLOR_GetPen( INT index );
+extern void SYSMETRICS_Init(void);
+extern INT SYSMETRICS_Set( INT index, INT value );
+extern void USER_CheckNotLock(void);
+extern BOOL USER_IsExitingThread( DWORD tid );
+
+/* HANDLE16 <-> HANDLE conversions */
+#define HCURSOR_16(h32)    (LOWORD(h32))
+#define HICON_16(h32)      (LOWORD(h32))
+#define HINSTANCE_16(h32)  (LOWORD(h32))
+
+#define HCURSOR_32(h16)    ((HCURSOR)(ULONG_PTR)(h16))
+#define HICON_32(h16)      ((HICON)(ULONG_PTR)(h16))
+#define HINSTANCE_32(h16)  ((HINSTANCE)(ULONG_PTR)(h16))
+#define HMODULE_32(h16)    ((HMODULE)(ULONG_PTR)(h16))
+
+#endif /* __WINE_USER_PRIVATE_H */
diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c
index 3f73e69..170f67b 100644
--- a/dlls/user/wnd16.c
+++ b/dlls/user/wnd16.c
@@ -20,7 +20,7 @@
 
 #include "wine/winuser16.h"
 #include "wownt32.h"
-#include "user.h"
+#include "user_private.h"
 #include "win.h"
 #include "winproc.h"
 #include "stackframe.h"
diff --git a/dlls/x11drv/x11drv.h b/dlls/x11drv/x11drv.h
index 8ae74f2..7d15953 100644
--- a/dlls/x11drv/x11drv.h
+++ b/dlls/x11drv/x11drv.h
@@ -40,7 +40,6 @@
 
 #include "windef.h"
 #include "winbase.h"
-#include "user.h"
 #include "win.h"
 #include "ddrawi.h"
 #include "thread.h"
diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c
index 07dfdd1..aa1c784 100644
--- a/dlls/x11drv/x11drv_main.c
+++ b/dlls/x11drv/x11drv_main.c
@@ -59,7 +59,6 @@
 #include "wine/winbase16.h"
 #include "winreg.h"
 
-#include "user.h"
 #include "win.h"
 #include "x11drv.h"
 #include "xvidmode.h"