Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Windows widgets (built-in window classes) |
| 3 | * |
| 4 | * Copyright 1993 Alexandre Julliard |
| 5 | */ |
| 6 | |
| 7 | static char Copyright[] = "Copyright Alexandre Julliard, 1993"; |
| 8 | |
Alexandre Julliard | fb9a919 | 1994-03-01 19:48:04 +0000 | [diff] [blame] | 9 | #include "win.h" |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 10 | #include "button.h" |
| 11 | #include "static.h" |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 12 | #include "desktop.h" |
| 13 | #include "mdi.h" |
| 14 | #include "gdi.h" |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 15 | |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 16 | LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ); |
| 17 | LONG ListBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam ); |
| 18 | LONG ComboBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam ); |
Alexandre Julliard | 5819953 | 1994-04-21 01:20:00 +0000 | [diff] [blame] | 19 | LONG EditWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ); |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 20 | LONG PopupMenuWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam ); |
Alexandre Julliard | fb9a919 | 1994-03-01 19:48:04 +0000 | [diff] [blame] | 21 | LONG DesktopWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam ); |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 22 | LONG MDIClientWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam ); |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 23 | |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 24 | |
Alexandre Julliard | 0e60778 | 1993-11-03 19:23:37 +0000 | [diff] [blame] | 25 | static WNDCLASS WIDGETS_BuiltinClasses[] = |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 26 | { |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 27 | { CS_GLOBALCLASS | CS_PARENTDC, ButtonWndProc, 0, sizeof(BUTTONINFO), |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 28 | 0, 0, 0, 0, NULL, "BUTTON" }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 29 | { CS_GLOBALCLASS | CS_PARENTDC, StaticWndProc, 0, sizeof(STATICINFO), |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 30 | 0, 0, 0, 0, NULL, "STATIC" }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 31 | { CS_GLOBALCLASS | CS_PARENTDC, ScrollBarWndProc, 0, 8, |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 32 | 0, 0, 0, 0, NULL, "SCROLLBAR" }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 33 | { CS_GLOBALCLASS | CS_PARENTDC, ListBoxWndProc, 0, 8, |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 34 | 0, 0, 0, 0, NULL, "LISTBOX" }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 35 | { CS_GLOBALCLASS | CS_PARENTDC, ComboBoxWndProc, 0, 8, |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 36 | 0, 0, 0, 0, NULL, "COMBOBOX" }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 37 | { CS_GLOBALCLASS | CS_PARENTDC, EditWndProc, 0, 4, |
Alexandre Julliard | 5819953 | 1994-04-21 01:20:00 +0000 | [diff] [blame] | 38 | 0, 0, 0, 0, NULL, "EDIT" }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 39 | { CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc, 0, 8, |
Alexandre Julliard | f720725 | 1994-07-23 07:57:48 +0000 | [diff] [blame] | 40 | 0, 0, 0, 0, NULL, POPUPMENU_CLASS_NAME }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 41 | { CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO), |
Alexandre Julliard | fb9a919 | 1994-03-01 19:48:04 +0000 | [diff] [blame] | 42 | 0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 43 | { CS_GLOBALCLASS | CS_SAVEBITS, DefDlgProc, 0, DLGWINDOWEXTRA, |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 44 | 0, 0, 0, 0, NULL, DIALOG_CLASS_NAME }, |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame^] | 45 | { CS_GLOBALCLASS, MDIClientWndProc, 0, sizeof(MDICLIENTINFO), |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 46 | 0, 0, 0, STOCK_LTGRAY_BRUSH, NULL, "MDICLIENT" } |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 47 | }; |
| 48 | |
Alexandre Julliard | 0e60778 | 1993-11-03 19:23:37 +0000 | [diff] [blame] | 49 | #define NB_BUILTIN_CLASSES \ |
| 50 | (sizeof(WIDGETS_BuiltinClasses)/sizeof(WIDGETS_BuiltinClasses[0])) |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 51 | |
| 52 | |
| 53 | /*********************************************************************** |
| 54 | * WIDGETS_Init |
| 55 | * |
| 56 | * Initialize the built-in window classes. |
| 57 | */ |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 58 | BOOL WIDGETS_Init(void) |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 59 | { |
| 60 | int i; |
Alexandre Julliard | 940d58c | 1994-09-16 09:24:37 +0000 | [diff] [blame] | 61 | WNDCLASS *class = WIDGETS_BuiltinClasses; |
| 62 | |
| 63 | for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++) |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 64 | { |
Alexandre Julliard | 940d58c | 1994-09-16 09:24:37 +0000 | [diff] [blame] | 65 | class->hCursor = LoadCursor( 0, IDC_ARROW ); |
| 66 | if (!RegisterClass( class )) return FALSE; |
Alexandre Julliard | 75a839a | 1993-07-15 11:13:45 +0000 | [diff] [blame] | 67 | } |
| 68 | return TRUE; |
| 69 | } |