Moved most builtin controls structures into their respective C file.
Created new controls.h file private to user32.dll and moved remaining
builtin controls definitions there.
diff --git a/controls/menu.c b/controls/menu.c
index 0b10c9a..f825a38 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -26,7 +26,7 @@
#include "win.h"
#include "task.h"
#include "heap.h"
-#include "menu.h"
+#include "controls.h"
#include "nonclient.h"
#include "user.h"
#include "message.h"
@@ -176,6 +176,23 @@
/* Flag set by EndMenu() to force an exit from menu tracking */
static BOOL fEndMenu = FALSE;
+static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
+
+
+/*********************************************************************
+ * menu class descriptor
+ */
+const struct builtin_class_descr MENU_builtin_class =
+{
+ POPUPMENU_CLASS_ATOM, /* name */
+ CS_GLOBALCLASS | CS_SAVEBITS, /* style */
+ NULL, /* procA (winproc is Unicode only) */
+ PopupMenuWndProc, /* procW */
+ sizeof(HMENU), /* extra */
+ IDC_ARROWA, /* cursor */
+ COLOR_MENU+1 /* brush */
+};
+
/***********************************************************************
* debug_print_menuitem
@@ -3163,12 +3180,8 @@
*
* NOTE: Windows has totally different (and undocumented) popup wndproc.
*/
-LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
- LPARAM lParam )
-{
- WND* wndPtr = WIN_FindWndPtr(hwnd);
- LRESULT retvalue;
-
+static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
TRACE("hwnd=0x%04x msg=0x%04x wp=0x%04x lp=0x%08lx\n",
hwnd, message, wParam, lParam);
@@ -3176,15 +3189,13 @@
{
case WM_CREATE:
{
- CREATESTRUCTA *cs = (CREATESTRUCTA*)lParam;
- SetWindowLongA( hwnd, 0, (LONG)cs->lpCreateParams );
- retvalue = 0;
- goto END;
+ CREATESTRUCTW *cs = (CREATESTRUCTW*)lParam;
+ SetWindowLongW( hwnd, 0, (LONG)cs->lpCreateParams );
+ return 0;
}
case WM_MOUSEACTIVATE: /* We don't want to be activated */
- retvalue = MA_NOACTIVATE;
- goto END;
+ return MA_NOACTIVATE;
case WM_PAINT:
{
@@ -3193,12 +3204,10 @@
MENU_DrawPopupMenu( hwnd, ps.hdc,
(HMENU)GetWindowLongA( hwnd, 0 ) );
EndPaint( hwnd, &ps );
- retvalue = 0;
- goto END;
+ return 0;
}
case WM_ERASEBKGND:
- retvalue = 1;
- goto END;
+ return 1;
case WM_DESTROY:
@@ -3224,31 +3233,23 @@
if( wParam )
{
- if( !(*(HMENU*)wndPtr->wExtra) )
- ERR("no menu to display\n");
+ if (!GetWindowLongW( hwnd, 0 )) ERR("no menu to display\n");
}
else
- *(HMENU*)wndPtr->wExtra = 0;
+ SetWindowLongW( hwnd, 0, 0 );
break;
case MM_SETMENUHANDLE:
-
- *(HMENU*)wndPtr->wExtra = (HMENU)wParam;
+ SetWindowLongW( hwnd, 0, wParam );
break;
case MM_GETMENUHANDLE:
-
- retvalue = *(HMENU*)wndPtr->wExtra;
- goto END;
+ return GetWindowLongW( hwnd, 0 );
default:
- retvalue = DefWindowProcA( hwnd, message, wParam, lParam );
- goto END;
+ return DefWindowProcW( hwnd, message, wParam, lParam );
}
- retvalue = 0;
-END:
- WIN_ReleaseWndPtr(wndPtr);
- return retvalue;
+ return 0;
}