2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
27 } BUILTIN_CLASS_INFO16
;
29 static const BUILTIN_CLASS_INFO16 WIDGETS_BuiltinClasses16
[] =
31 { CS_GLOBALCLASS
| CS_PARENTDC
,
32 sizeof(STATICINFO
), 0, "StaticWndProc", "STATIC" },
33 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
34 sizeof(SCROLLINFO
), 0, "ScrollBarWndProc", "SCROLLBAR" },
35 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
36 8, 0, "ListBoxWndProc", "LISTBOX" },
37 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
38 8, 0, "ComboBoxWndProc", "COMBOBOX" },
39 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_SAVEBITS
,
40 8, 0, "ComboLBoxWndProc", "COMBOLBOX" },
41 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
42 sizeof(DWORD
), 0, "EditWndProc", "EDIT" },
43 { CS_GLOBALCLASS
| CS_SAVEBITS
,
44 sizeof(HMENU32
), 0, "PopupMenuWndProc", POPUPMENU_CLASS_NAME
},
45 { CS_GLOBALCLASS
| CS_SAVEBITS
,
46 DLGWINDOWEXTRA
, 0, "DefDlgProc", DIALOG_CLASS_NAME
},
47 { CS_GLOBALCLASS
, sizeof(MDICLIENTINFO
),
48 STOCK_LTGRAY_BRUSH
, "MDIClientWndProc", "MDICLIENT" }
51 #define NB_BUILTIN_CLASSES16 \
52 (sizeof(WIDGETS_BuiltinClasses16)/sizeof(WIDGETS_BuiltinClasses16[0]))
55 static WNDCLASS32A WIDGETS_BuiltinClasses32
[] =
57 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
58 ButtonWndProc
, 0, sizeof(BUTTONINFO
), 0, 0, 0, 0, 0, "BUTTON" },
59 { CS_GLOBALCLASS
, DesktopWndProc
, 0, sizeof(DESKTOPINFO
),
60 0, 0, 0, 0, 0, DESKTOP_CLASS_NAME
}
63 #define NB_BUILTIN_CLASSES32 \
64 (sizeof(WIDGETS_BuiltinClasses32)/sizeof(WIDGETS_BuiltinClasses32[0]))
67 static WNDCLASS32A WIDGETS_CommonControls32
[] =
69 { CS_GLOBALCLASS
| CS_VREDRAW
| CS_HREDRAW
, StatusWindowProc
, 0,
70 sizeof(STATUSWINDOWINFO
), 0, 0, 0, 0, 0, STATUSCLASSNAME32A
},
73 #define NB_COMMON_CONTROLS32 \
74 (sizeof(WIDGETS_CommonControls32)/sizeof(WIDGETS_CommonControls32[0]))
77 /***********************************************************************
80 * Initialize the built-in window classes.
82 BOOL
WIDGETS_Init(void)
86 const BUILTIN_CLASS_INFO16
*info16
= WIDGETS_BuiltinClasses16
;
88 WNDCLASS32A
*class32
= WIDGETS_BuiltinClasses32
;
90 if (!(name
= SEGPTR_ALLOC( 20 * sizeof(char) ))) return FALSE
;
92 /* Create 16-bit classes */
94 class16
.cbClsExtra
= 0;
95 class16
.hInstance
= 0;
97 class16
.hCursor
= LoadCursor16( 0, IDC_ARROW
);
98 class16
.lpszMenuName
= (SEGPTR
)0;
99 class16
.lpszClassName
= SEGPTR_GET(name
);
100 for (i
= 0; i
< NB_BUILTIN_CLASSES16
; i
++, info16
++)
102 class16
.style
= info16
->style
;
103 class16
.lpfnWndProc
= (WNDPROC16
)MODULE_GetWndProcEntry16( info16
->procName
);
104 class16
.cbWndExtra
= info16
->wndExtra
;
105 class16
.hbrBackground
= info16
->background
;
106 strcpy( name
, info16
->className
);
107 if (!RegisterClass16( &class16
)) return FALSE
;
110 /* Create 32-bit classes */
112 for (i
= 0; i
< NB_BUILTIN_CLASSES32
; i
++, class32
++)
114 /* Just to make sure the string is > 0x10000 */
115 strcpy( name
, (char *)class32
->lpszClassName
);
116 class32
->lpszClassName
= name
;
117 class32
->hCursor
= LoadCursor16( 0, IDC_ARROW
);
118 if (!RegisterClass32A( class32
)) return FALSE
;
126 /***********************************************************************
127 * InitCommonControls (COMCTL32.15)
129 void InitCommonControls(void)
133 WNDCLASS32A
*class32
= WIDGETS_CommonControls32
;
135 for (i
= 0; i
< NB_COMMON_CONTROLS32
; i
++, class32
++)
137 /* Just to make sure the string is > 0x10000 */
138 strcpy( name
, (char *)class32
->lpszClassName
);
139 class32
->lpszClassName
= name
;
140 class32
->hCursor
= LoadCursor16( 0, IDC_ARROW
);
141 RegisterClass32A( class32
);