2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
28 } BUILTIN_CLASS_INFO16;
30 static const BUILTIN_CLASS_INFO16 WIDGETS_BuiltinClasses16[] =
32 { CS_GLOBALCLASS | CS_PARENTDC,
33 sizeof(STATICINFO), 0, "StaticWndProc", "STATIC" },
35 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
36 8, 0, "ListBoxWndProc", "LISTBOX" },
38 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
39 8, 0, "ComboBoxWndProc", "COMBOBOX" },
40 { CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
41 8, 0, "ComboLBoxWndProc", "COMBOLBOX" },
42 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
43 sizeof(DWORD), 0, "EditWndProc", "EDIT" },
44 { CS_GLOBALCLASS | CS_SAVEBITS,
45 sizeof(HMENU32), 0, "PopupMenuWndProc", POPUPMENU_CLASS_NAME },
46 { CS_GLOBALCLASS | CS_SAVEBITS,
47 DLGWINDOWEXTRA, 0, "DefDlgProc", DIALOG_CLASS_NAME },
48 { CS_GLOBALCLASS, sizeof(MDICLIENTINFO),
49 STOCK_LTGRAY_BRUSH, "MDIClientWndProc", "MDICLIENT" }
52 #define NB_BUILTIN_CLASSES16 \
53 (sizeof(WIDGETS_BuiltinClasses16)/sizeof(WIDGETS_BuiltinClasses16[0]))
56 static WNDCLASS32A WIDGETS_BuiltinClasses32[] =
58 { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
59 ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0, 0, 0, 0, "BUTTON" },
61 { CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
62 ListBoxWndProc32, 0, sizeof(void *), 0, 0, 0, 0, 0, "LISTBOX" },
64 { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
65 ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, 0, 0, 0, "SCROLLBAR"},
66 { CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
67 0, 0, 0, 0, 0, DESKTOP_CLASS_NAME }
70 #define NB_BUILTIN_CLASSES32 \
71 (sizeof(WIDGETS_BuiltinClasses32)/sizeof(WIDGETS_BuiltinClasses32[0]))
74 static WNDCLASS32A WIDGETS_CommonControls32[] =
76 { CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW, StatusWindowProc, 0,
77 sizeof(STATUSWINDOWINFO), 0, 0, 0, 0, 0, STATUSCLASSNAME32A },
80 #define NB_COMMON_CONTROLS32 \
81 (sizeof(WIDGETS_CommonControls32)/sizeof(WIDGETS_CommonControls32[0]))
84 /***********************************************************************
87 * Initialize the built-in window classes.
89 BOOL WIDGETS_Init(void)
93 const BUILTIN_CLASS_INFO16 *info16 = WIDGETS_BuiltinClasses16;
95 WNDCLASS32A *class32 = WIDGETS_BuiltinClasses32;
97 if (!(name = SEGPTR_ALLOC( 20 * sizeof(char) ))) return FALSE;
99 /* Create 16-bit classes */
101 class16.cbClsExtra = 0;
102 class16.hInstance = 0;
104 class16.hCursor = LoadCursor16( 0, IDC_ARROW );
105 class16.lpszMenuName = (SEGPTR)0;
106 class16.lpszClassName = SEGPTR_GET(name);
107 for (i = 0; i < NB_BUILTIN_CLASSES16; i++, info16++)
109 class16.style = info16->style;
110 class16.lpfnWndProc = (WNDPROC16)MODULE_GetWndProcEntry16( info16->procName );
111 class16.cbWndExtra = info16->wndExtra;
112 class16.hbrBackground = info16->background;
113 strcpy( name, info16->className );
114 if (!RegisterClass16( &class16 )) return FALSE;
117 /* Create 32-bit classes */
119 for (i = 0; i < NB_BUILTIN_CLASSES32; i++, class32++)
121 /* Just to make sure the string is > 0x10000 */
122 strcpy( name, (char *)class32->lpszClassName );
123 class32->lpszClassName = name;
124 class32->hCursor = LoadCursor16( 0, IDC_ARROW );
125 if (!RegisterClass32A( class32 )) return FALSE;
133 /***********************************************************************
134 * InitCommonControls (COMCTL32.15)
136 void InitCommonControls(void)
140 WNDCLASS32A *class32 = WIDGETS_CommonControls32;
142 for (i = 0; i < NB_COMMON_CONTROLS32; i++, class32++)
144 /* Just to make sure the string is > 0x10000 */
145 strcpy( name, (char *)class32->lpszClassName );
146 class32->lpszClassName = name;
147 class32->hCursor = LoadCursor16( 0, IDC_ARROW );
148 RegisterClass32A( class32 );