2 * Windows widgets (built-in window classes)
4 * Copyright 1993 Alexandre Julliard
19 /* Window procedures */
21 extern LRESULT WINAPI
EditWndProc( HWND32 hwnd
, UINT32 msg
,
22 WPARAM32 wParam
, LPARAM lParam
);
23 extern LRESULT WINAPI
ComboWndProc( HWND32 hwnd
, UINT32 msg
,
24 WPARAM32 wParam
, LPARAM lParam
);
25 extern LRESULT WINAPI
ComboLBWndProc( HWND32 hwnd
, UINT32 msg
,
26 WPARAM32 wParam
, LPARAM lParam
);
27 extern LRESULT WINAPI
ListBoxWndProc( HWND32 hwnd
, UINT32 msg
,
28 WPARAM32 wParam
, LPARAM lParam
);
29 extern LRESULT WINAPI
PopupMenuWndProc( HWND32 hwnd
, UINT32 msg
,
30 WPARAM32 wParam
, LPARAM lParam
);
31 extern LRESULT WINAPI
IconTitleWndProc( HWND32 hwnd
, UINT32 msg
,
32 WPARAM32 wParam
, LPARAM lParam
);
34 /* Built-in classes */
36 static WNDCLASS32A WIDGETS_BuiltinClasses
[BIC32_NB_CLASSES
] =
39 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
40 ButtonWndProc
, 0, sizeof(BUTTONINFO
), 0, 0,
41 (HCURSOR32
)IDC_ARROW32A
, 0, 0, "Button" },
43 { CS_GLOBALCLASS
| CS_DBLCLKS
/*| CS_PARENTDC*/,
44 EditWndProc
, 0, sizeof(void *), 0, 0,
45 (HCURSOR32
)IDC_IBEAM32A
, 0, 0, "Edit" },
47 { CS_GLOBALCLASS
| CS_DBLCLKS
/*| CS_PARENTDC*/,
48 ListBoxWndProc
, 0, sizeof(void *), 0, 0,
49 (HCURSOR32
)IDC_ARROW32A
, 0, 0, "ListBox" },
51 { CS_GLOBALCLASS
| CS_PARENTDC
| CS_DBLCLKS
,
52 ComboWndProc
, 0, sizeof(void *), 0, 0,
53 (HCURSOR32
)IDC_ARROW32A
, 0, 0, "ComboBox" },
55 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_SAVEBITS
, ComboLBWndProc
,
56 0, sizeof(void *), 0, 0, (HCURSOR32
)IDC_ARROW32A
, 0, 0, "ComboLBox" },
58 { CS_GLOBALCLASS
| CS_SAVEBITS
, PopupMenuWndProc
, 0, sizeof(HMENU32
),
59 0, 0, (HCURSOR32
)IDC_ARROW32A
, NULL_BRUSH
, 0, POPUPMENU_CLASS_NAME
},
61 { CS_GLOBALCLASS
| CS_PARENTDC
, StaticWndProc
,
62 0, sizeof(STATICINFO
), 0, 0, (HCURSOR32
)IDC_ARROW32A
, 0, 0, "Static" },
64 { CS_GLOBALCLASS
| CS_DBLCLKS
| CS_VREDRAW
| CS_HREDRAW
| CS_PARENTDC
,
65 ScrollBarWndProc
, 0, sizeof(SCROLLBAR_INFO
), 0, 0,
66 (HCURSOR32
)IDC_ARROW32A
, 0, 0, "ScrollBar"},
68 { CS_GLOBALCLASS
, MDIClientWndProc
,
69 0, sizeof(MDICLIENTINFO
), 0, 0, 0, STOCK_LTGRAY_BRUSH
, 0, "MDIClient" },
71 { CS_GLOBALCLASS
, DesktopWndProc
, 0, sizeof(DESKTOPINFO
),
72 0, 0, (HCURSOR32
)IDC_ARROW32A
, 0, 0, DESKTOP_CLASS_NAME
},
74 { CS_GLOBALCLASS
| CS_SAVEBITS
, DefDlgProc32A
, 0, DLGWINDOWEXTRA
,
75 0, 0, (HCURSOR32
)IDC_ARROW32A
, 0, 0, DIALOG_CLASS_NAME
},
77 { CS_GLOBALCLASS
, IconTitleWndProc
, 0, 0,
78 0, 0, (HCURSOR32
)IDC_ARROW32A
, 0, 0, ICONTITLE_CLASS_NAME
}
81 static ATOM bicAtomTable
[BIC32_NB_CLASSES
];
83 /***********************************************************************
86 * Initialize the built-in window classes.
88 BOOL32
WIDGETS_Init(void)
91 WNDCLASS32A
*cls
= WIDGETS_BuiltinClasses
;
93 /* Create builtin classes */
95 for (i
= 0; i
< BIC32_NB_CLASSES
; i
++, cls
++)
98 /* Just to make sure the string is > 0x10000 */
99 strcpy( name
, (char *)cls
->lpszClassName
);
100 cls
->lpszClassName
= name
;
101 cls
->hCursor
= LoadCursor32A( 0, (LPCSTR
)cls
->hCursor
);
102 if (!(bicAtomTable
[i
] = RegisterClass32A( cls
))) return FALSE
;
109 /***********************************************************************
110 * WIDGETS_IsControl32
112 * Check whether pWnd is a built-in control or not.
114 BOOL32
WIDGETS_IsControl32( WND
* pWnd
, BUILTIN_CLASS32 cls
)
116 assert( cls
< BIC32_NB_CLASSES
);
117 return (pWnd
->class->atomName
== bicAtomTable
[cls
]);