2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
22 /* Built-in classes */
24 static WNDCLASSA WIDGETS_BuiltinClasses
[BIC32_NB_CLASSES
] =
27 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
28 ButtonWndProc
, 0, sizeof(BUTTONINFO
), 0, 0,
29 (HCURSOR
)IDC_ARROWA
, 0, 0, "Button" },
31 { CS_GLOBALCLASS
| CS_DBLCLKS
/*| CS_PARENTDC*/,
32 EditWndProc
, 0, sizeof(void *), 0, 0,
33 (HCURSOR
)IDC_IBEAMA
, 0, 0, "Edit" },
35 { CS_GLOBALCLASS
| CS_DBLCLKS
/*| CS_PARENTDC*/,
36 ListBoxWndProc
, 0, sizeof(void *), 0, 0,
37 (HCURSOR
)IDC_ARROWA
, 0, 0, "ListBox" },
39 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
40 ComboWndProc
, 0, sizeof(void *), 0, 0,
41 (HCURSOR
)IDC_ARROWA
, 0, 0, "ComboBox" },
43 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_SAVEBITS
, ComboLBWndProc
,
44 0, sizeof(void *), 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, "ComboLBox" },
46 { CS_GLOBALCLASS
| CS_SAVEBITS
, PopupMenuWndProc
, 0, sizeof(HMENU
),
47 0, 0, (HCURSOR
)IDC_ARROWA
, NULL_BRUSH
, 0, POPUPMENU_CLASS_NAME
},
49 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_PARENTDC
, StaticWndProc
,
50 0, sizeof(STATICINFO
), 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, "Static" },
52 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
53 ScrollBarWndProc
, 0, sizeof(SCROLLBAR_INFO
), 0, 0,
54 (HCURSOR
)IDC_ARROWA
, 0, 0, "ScrollBar"},
56 { CS_GLOBALCLASS
, MDIClientWndProc
,
57 0, sizeof(MDICLIENTINFO
), 0, 0, (HCURSOR
)IDC_ARROWA
, STOCK_LTGRAY_BRUSH
, 0, "MDIClient" },
59 { CS_GLOBALCLASS
, DesktopWndProc
, 0, sizeof(DESKTOP
),
60 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, DESKTOP_CLASS_NAME
},
62 { CS_GLOBALCLASS
| CS_SAVEBITS
, DefDlgProcA
, 0, DLGWINDOWEXTRA
,
63 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, DIALOG_CLASS_NAME
},
65 { CS_GLOBALCLASS
, IconTitleWndProc
, 0, 0,
66 0, 0, (HCURSOR
)IDC_ARROWA
, 0, 0, ICONTITLE_CLASS_NAME
}
69 static ATOM bicAtomTable
[BIC32_NB_CLASSES
];
71 /***********************************************************************
74 * Initialize the built-in window classes.
76 BOOL
WIDGETS_Init(void)
79 WNDCLASSA
*cls
= WIDGETS_BuiltinClasses
;
81 /* Create builtin classes */
83 for (i
= 0; i
< BIC32_NB_CLASSES
; i
++, cls
++)
86 /* Just to make sure the string is > 0x10000 */
87 strcpy( name
, (char *)cls
->lpszClassName
);
88 cls
->lpszClassName
= name
;
89 cls
->hCursor
= LoadCursorA( 0, (LPCSTR
)cls
->hCursor
);
90 if (!(bicAtomTable
[i
] = RegisterClassA( cls
))) return FALSE
;
97 /***********************************************************************
100 * Check whether pWnd is a built-in control or not.
102 BOOL
WIDGETS_IsControl( WND
* pWnd
, BUILTIN_CLASS32 cls
)
104 assert( cls
< BIC32_NB_CLASSES
);
105 return (GetClassWord(pWnd
->hwndSelf
, GCW_ATOM
) == bicAtomTable
[cls
]);