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_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
23 (WNDPROC
)"ButtonWndProc", 0, sizeof(BUTTONINFO
),
24 0, 0, 0, 0, 0, (SEGPTR
)"BUTTON" },
25 { CS_GLOBALCLASS
| CS_PARENTDC
,
26 (WNDPROC
)"StaticWndProc", 0, sizeof(STATICINFO
),
27 0, 0, 0, 0, 0, (SEGPTR
)"STATIC" },
28 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
29 (WNDPROC
)"ScrollBarWndProc", 0, sizeof(SCROLLINFO
),
30 0, 0, 0, 0, 0, (SEGPTR
)"SCROLLBAR" },
31 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
32 (WNDPROC
)"ListBoxWndProc", 0, 8,
33 0, 0, 0, 0, 0, (SEGPTR
)"LISTBOX" },
34 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
35 (WNDPROC
)"ComboBoxWndProc", 0, 8,
36 0, 0, 0, 0, 0, (SEGPTR
)"COMBOBOX" },
37 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_SAVEBITS
,
38 (WNDPROC
)"ComboLBoxWndProc", 0, 8,
39 0, 0, 0, 0, 0, (SEGPTR
)"COMBOLBOX" },
40 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
41 (WNDPROC
)"EditWndProc", 0, sizeof(DWORD
),
42 0, 0, 0, 0, 0, (SEGPTR
)"EDIT" },
43 { CS_GLOBALCLASS
| CS_SAVEBITS
, (WNDPROC
)"PopupMenuWndProc", 0, 8,
44 0, 0, 0, 0, 0, (SEGPTR
)POPUPMENU_CLASS_NAME
},
45 { CS_GLOBALCLASS
, (WNDPROC
)"DesktopWndProc", 0, sizeof(DESKTOPINFO
),
46 0, 0, 0, 0, 0, (SEGPTR
)DESKTOP_CLASS_NAME
},
47 { CS_GLOBALCLASS
| CS_SAVEBITS
, (WNDPROC
)"DefDlgProc", 0, DLGWINDOWEXTRA
,
48 0, 0, 0, 0, 0, (SEGPTR
)DIALOG_CLASS_NAME
},
49 { CS_GLOBALCLASS
, (WNDPROC
)"MDIClientWndProc", 0, sizeof(MDICLIENTINFO
),
50 0, 0, 0, STOCK_LTGRAY_BRUSH
, 0, (SEGPTR
)"MDICLIENT" }
53 #define NB_BUILTIN_CLASSES \
54 (sizeof(WIDGETS_BuiltinClasses)/sizeof(WIDGETS_BuiltinClasses[0]))
57 /***********************************************************************
60 * Initialize the built-in window classes.
62 BOOL
WIDGETS_Init(void)
66 WNDCLASS
*class = WIDGETS_BuiltinClasses
;
68 for (i
= 0; i
< NB_BUILTIN_CLASSES
; i
++, class++)
70 DWORD WineProc
,Win16Proc
,Win32Proc
;
72 /* currently, there is no way to get the 'real' pointer at run time */
74 Win16Proc
= (DWORD
)GetWndProcEntry16( (char *)class->lpfnWndProc
);
75 dll
= RELAY32_GetBuiltinDLL("WINPROCS32");
76 Win32Proc
= (DWORD
)RELAY32_GetEntryPoint(
77 dll
,(char *)class->lpfnWndProc
, 0);
78 /* Register the alias so we don't pass Win16 pointers to Win32 apps */
79 ALIAS_RegisterAlias(WineProc
,Win16Proc
,Win32Proc
);
81 strcpy( name
, (char *)class->lpszClassName
);
82 class->lpszClassName
= MAKE_SEGPTR(name
);
83 class->hCursor
= LoadCursor( 0, IDC_ARROW
);
84 class->lpfnWndProc
= GetWndProcEntry16( (char *)class->lpfnWndProc
);
85 if (!RegisterClass( class )) return FALSE
;