Release 950918
[wine/multimedia.git] / controls / widgets.c
blob34d678ada4f8ae9a0de5bddc448bc63274244fce
1 /*
2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
5 */
7 #include "win.h"
8 #include "button.h"
9 #include "static.h"
10 #include "scroll.h"
11 #include "desktop.h"
12 #include "mdi.h"
13 #include "gdi.h"
14 #include "user.h"
15 #include "selectors.h"
16 #include "stackframe.h"
17 #include "alias.h"
18 #include "relay32.h"
20 static WNDCLASS WIDGETS_BuiltinClasses[] =
22 { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ButtonWndProc", 0,
23 sizeof(BUTTONINFO), 0, 0, 0, 0, 0, (SEGPTR)"BUTTON" },
24 { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"StaticWndProc", 0,
25 sizeof(STATICINFO), 0, 0, 0, 0, 0, (SEGPTR)"STATIC" },
26 { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ScrollBarWndProc", 0,
27 sizeof(SCROLLINFO), 0, 0, 0, 0, 0, (SEGPTR)"SCROLLBAR" },
28 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ListBoxWndProc", 0,
29 8, 0, 0, 0, 0, 0, (SEGPTR)"LISTBOX" },
30 { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ComboBoxWndProc", 0, 8,
31 0, 0, 0, 0, 0, (SEGPTR)"COMBOBOX" },
32 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ComboLBoxWndProc",
33 0, 8, 0, 0, 0, 0, 0, (SEGPTR)"COMBOLBOX" },
34 { CS_GLOBALCLASS, (WNDPROC)"EditWndProc", 0, sizeof(DWORD),
35 0, 0, 0, 0, 0, (SEGPTR)"EDIT" },
36 { CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"PopupMenuWndProc", 0, 8,
37 0, 0, 0, 0, 0, (SEGPTR)POPUPMENU_CLASS_NAME },
38 { CS_GLOBALCLASS, (WNDPROC)"DesktopWndProc", 0, sizeof(DESKTOPINFO),
39 0, 0, 0, 0, 0, (SEGPTR)DESKTOP_CLASS_NAME },
40 { CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"DefDlgProc", 0, DLGWINDOWEXTRA,
41 0, 0, 0, 0, 0, (SEGPTR)DIALOG_CLASS_NAME },
42 { CS_GLOBALCLASS, (WNDPROC)"MDIClientWndProc", 0, sizeof(MDICLIENTINFO),
43 0, 0, 0, STOCK_LTGRAY_BRUSH, 0, (SEGPTR)"MDICLIENT" }
46 #define NB_BUILTIN_CLASSES \
47 (sizeof(WIDGETS_BuiltinClasses)/sizeof(WIDGETS_BuiltinClasses[0]))
50 /***********************************************************************
51 * WIDGETS_Init
53 * Initialize the built-in window classes.
55 BOOL WIDGETS_Init(void)
57 int i;
58 char name[20];
59 WNDCLASS *class = WIDGETS_BuiltinClasses;
61 for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++)
63 DWORD WineProc,Win16Proc,Win32Proc;
64 /* currently, there is no way to get the 'real' pointer at run time */
65 WineProc=0;
66 Win16Proc = GetWndProcEntry16( (char *)class->lpfnWndProc );
67 Win32Proc = (DWORD)RELAY32_GetEntryPoint(
68 "WINPROCS32",(char *)class->lpfnWndProc, 0);
69 /* Register the alias so we don't pass Win16 pointers to Win32 apps */
70 ALIAS_RegisterAlias(WineProc,Win16Proc,Win32Proc);
72 strcpy( name, (char *)class->lpszClassName );
73 class->lpszClassName = MAKE_SEGPTR(name);
74 class->hCursor = LoadCursor( 0, IDC_ARROW );
75 class->lpfnWndProc = GetWndProcEntry16( (char *)class->lpfnWndProc );
76 if (!RegisterClass( class )) return FALSE;
78 return TRUE;