2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
21 /* Built-in classes */
23 static WNDCLASSA WIDGETS_BuiltinClasses
[BIC32_NB_CLASSES
] =
26 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
27 ButtonWndProc
, 0, sizeof(BUTTONINFO
), 0, 0,
28 (HCURSOR
)IDC_ARROWA
, 0, 0, "Button" },
30 { CS_GLOBALCLASS
| CS_DBLCLKS
/*| CS_PARENTDC*/,
31 EditWndProc
, 0, sizeof(void *), 0, 0,
32 (HCURSOR
)IDC_IBEAMA
, 0, 0, "Edit" },
34 { CS_GLOBALCLASS
| CS_DBLCLKS
/*| CS_PARENTDC*/,
35 ListBoxWndProc
, 0, sizeof(void *), 0, 0,
36 (HCURSOR
)IDC_ARROWA
, 0, 0, "ListBox" },
38 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
39 ComboWndProc
, 0, sizeof(void *), 0, 0,
40 (HCURSOR
)IDC_ARROWA
, 0, 0, "ComboBox" },
42 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_SAVEBITS
, ComboLBWndProc
,
43 0, sizeof(void *), 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, "ComboLBox" },
45 { CS_GLOBALCLASS
| CS_SAVEBITS
, PopupMenuWndProc
, 0, sizeof(HMENU
),
46 0, 0, (HCURSOR
)IDC_ARROWA
, NULL_BRUSH
, 0, POPUPMENU_CLASS_NAME
},
48 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_PARENTDC
, StaticWndProc
,
49 0, sizeof(STATICINFO
), 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, "Static" },
51 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
52 ScrollBarWndProc
, 0, sizeof(SCROLLBAR_INFO
), 0, 0,
53 (HCURSOR
)IDC_ARROWA
, 0, 0, "ScrollBar"},
55 { CS_GLOBALCLASS
, MDIClientWndProc
,
56 0, sizeof(MDICLIENTINFO
), 0, 0, (HCURSOR
)IDC_ARROWA
, STOCK_LTGRAY_BRUSH
, 0, "MDIClient" },
58 { CS_GLOBALCLASS
, DesktopWndProc
, 0, sizeof(DESKTOP
),
59 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, DESKTOP_CLASS_NAME
},
61 { CS_GLOBALCLASS
| CS_SAVEBITS
, DefDlgProcA
, 0, DLGWINDOWEXTRA
,
62 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, DIALOG_CLASS_NAME
},
64 { CS_GLOBALCLASS
, IconTitleWndProc
, 0, 0,
65 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, ICONTITLE_CLASS_NAME
}
68 static ATOM bicAtomTable
[BIC32_NB_CLASSES
];
70 /***********************************************************************
73 * Initialize the built-in window classes.
75 BOOL
WIDGETS_Init(void)
78 WNDCLASSA
*cls
= WIDGETS_BuiltinClasses
;
80 /* Create builtin classes */
82 for (i
= 0; i
< BIC32_NB_CLASSES
; i
++, cls
++)
85 /* Just to make sure the string is > 0x10000 */
86 strcpy( name
, (char *)cls
->lpszClassName
);
87 cls
->lpszClassName
= name
;
88 cls
->hCursor
= LoadCursorA( 0, (LPCSTR
)cls
->hCursor
);
89 if (!(bicAtomTable
[i
] = RegisterClassA( cls
))) return FALSE
;
96 /***********************************************************************
99 * Check whether pWnd is a built-in control or not.
101 BOOL
WIDGETS_IsControl( WND
* pWnd
, BUILTIN_CLASS32 cls
)
103 assert( cls
< BIC32_NB_CLASSES
);
104 return (GetClassWord(pWnd
->hwndSelf
, GCW_ATOM
) == bicAtomTable
[cls
]);