2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
15 #include "selectors.h"
16 #include "stackframe.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 /***********************************************************************
53 * Initialize the built-in window classes.
55 BOOL
WIDGETS_Init(void)
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 */
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
;