2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
20 #include "wine/unicode.h"
22 /* Built-in classes */
24 static const char bi_class_nameA[BIC32_NB_CLASSES][10] =
40 static const WCHAR bi_class_nameW[BIC32_NB_CLASSES][10] =
42 {'B','u','t','t','o','n',0},
44 {'L','i','s','t','B','o','x',0},
45 {'C','o','m','b','o','B','o','x',0},
46 {'C','o','m','b','o','L','B','o','x',0},
47 {'#','3','2','7','6','8',0},
48 {'S','t','a','t','i','c',0},
49 {'S','c','r','o','l','l','B','a','r',0},
50 {'M','D','I','C','l','i','e','n','t',0},
51 {'#','3','2','7','6','9',0},
52 {'#','3','2','7','7','0',0},
53 {'#','3','2','7','7','2',0}
64 static BUILTINCLASS WIDGETS_BuiltinClasses[BIC32_NB_CLASSES] =
68 { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
69 ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0,
70 (HCURSOR)IDC_ARROWW, 0, 0, (LPCSTR)bi_class_nameW[0] }}},
73 { CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
74 EditWndProc, 0, sizeof(void *), 0, 0,
75 (HCURSOR)IDC_IBEAMA, 0, 0, bi_class_nameA[1] }}},
78 { CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
79 ListBoxWndProc, 0, sizeof(void *), 0, 0,
80 (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[2] }}},
83 { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
84 ComboWndProc, 0, sizeof(void *), 0, 0,
85 (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[3] }}},
88 { CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS, ComboLBWndProc,
89 0, sizeof(void *), 0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[4] }}},
92 { CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc, 0, sizeof(HMENU),
93 0, 0, (HCURSOR)IDC_ARROWA, NULL_BRUSH, 0, bi_class_nameA[5] }}},
96 { CS_GLOBALCLASS | CS_DBLCLKS | CS_PARENTDC, StaticWndProc,
97 0, sizeof(STATICINFO), 0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[6] }}},
100 { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
101 ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0,
102 (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[7] }}},
103 /* BIC32_MDICLIENT */
105 { CS_GLOBALCLASS, MDIClientWndProc,
106 0, sizeof(MDICLIENTINFO), 0, 0, (HCURSOR)IDC_ARROWA, STOCK_LTGRAY_BRUSH, 0, bi_class_nameA[8] }}},
109 { CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOP),
110 0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[9] }}},
113 { CS_GLOBALCLASS | CS_SAVEBITS, DefDlgProcA, 0, DLGWINDOWEXTRA,
114 0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[10] }}},
115 /* BIC32_ICONTITLE */
117 { CS_GLOBALCLASS, IconTitleWndProc, 0, 0,
118 0, 0, (HCURSOR)IDC_ARROWA, 0, 0, bi_class_nameA[11] }}}
121 static ATOM bicAtomTable[BIC32_NB_CLASSES];
123 /***********************************************************************
126 * Initialize the built-in window classes.
128 BOOL WIDGETS_Init(void)
131 BUILTINCLASS *cls = WIDGETS_BuiltinClasses;
133 /* Create builtin classes */
135 for (i = 0; i < BIC32_NB_CLASSES; i++, cls++)
140 /* Just to make sure the string is > 0x10000 */
141 strcpyW( nameW, (WCHAR *)cls->wnd_class.W.lpszClassName );
142 cls->wnd_class.W.lpszClassName = nameW;
143 cls->wnd_class.W.hCursor = LoadCursorW( 0, (LPCWSTR)cls->wnd_class.W.hCursor );
144 if (!(bicAtomTable[i] = RegisterClassW( &(cls->wnd_class.W) ))) return FALSE;
149 /* Just to make sure the string is > 0x10000 */
150 strcpy( name, (char *)cls->wnd_class.A.lpszClassName );
151 cls->wnd_class.A.lpszClassName = name;
152 cls->wnd_class.A.hCursor = LoadCursorA( 0, (LPCSTR)cls->wnd_class.A.hCursor );
153 if (!(bicAtomTable[i] = RegisterClassA( &(cls->wnd_class.A) ))) return FALSE;
161 /***********************************************************************
162 * WIDGETS_IsControl32
164 * Check whether pWnd is a built-in control or not.
166 BOOL WIDGETS_IsControl( WND* pWnd, BUILTIN_CLASS32 cls )
168 assert( cls < BIC32_NB_CLASSES );
169 return (GetClassWord(pWnd->hwndSelf, GCW_ATOM) == bicAtomTable[cls]);