Added an unknown VxD error code.
[wine] / dlls / user / controls.h
1 /*
2  * User controls definitions
3  *
4  * Copyright 2000 Alexandre Julliard
5  */
6
7 #ifndef __WINE_CONTROLS_H
8 #define __WINE_CONTROLS_H
9
10 #include "winuser.h"
11 #include "winproc.h"
12
13 struct tagWND;
14
15 /* Built-in class names (see _Undocumented_Windows_ p.418) */
16 #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768)  /* PopupMenu */
17 #define DESKTOP_CLASS_ATOM   MAKEINTATOM(32769)  /* Desktop */
18 #define DIALOG_CLASS_ATOM    MAKEINTATOM(32770)  /* Dialog */
19 #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771)  /* WinSwitch */
20 #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772)  /* IconTitle */
21
22 /* Built-in class descriptor */
23 struct builtin_class_descr
24 {
25     LPCSTR  name;    /* class name */
26     UINT    style;   /* class style */
27     WNDPROC procA;   /* ASCII window procedure */
28     WNDPROC procW;   /* Unicode window procedure */
29     INT     extra;   /* window extra bytes */
30     LPCSTR  cursor;  /* cursor name */
31     HBRUSH  brush;   /* brush or system color */
32 };
33
34
35 /* desktop */
36 extern BOOL DESKTOP_SetPattern( LPCSTR pattern );
37
38 /* icon title */
39 extern HWND ICONTITLE_Create( struct tagWND * );
40
41 /* menu controls */
42 extern BOOL MENU_Init(void);
43 extern BOOL MENU_IsMenuActive(void);
44 extern HMENU MENU_GetSysMenu(HWND hWndOwner, HMENU hSysPopup);
45 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
46                                      INT orgX, INT orgY );
47 extern void MENU_TrackMouseMenuBar( struct tagWND *wnd, INT ht, POINT pt );
48 extern void MENU_TrackKbdMenuBar( struct tagWND *wnd, UINT wParam, INT vkey );
49 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
50                                 HWND hwnd, BOOL suppress_draw );
51 extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget );
52
53 /* scrollbar */
54 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior );
55 extern void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt );
56 extern INT SCROLL_SetNCSbState( struct tagWND *wndPtr, int vMin, int vMax, int vPos,
57                                 int hMin, int hMax, int hPos );
58
59 /* combo box */
60
61 #define ID_CB_LISTBOX           1000
62 #define ID_CB_EDIT              1001
63
64 /* internal flags */
65 #define CBF_DROPPED             0x0001
66 #define CBF_BUTTONDOWN          0x0002
67 #define CBF_NOROLLUP            0x0004
68 #define CBF_MEASUREITEM         0x0008
69 #define CBF_FOCUSED             0x0010
70 #define CBF_CAPTURE             0x0020
71 #define CBF_EDIT                0x0040
72 #define CBF_NORESIZE            0x0080
73 #define CBF_NOTIFY              0x0100
74 #define CBF_NOREDRAW            0x0200
75 #define CBF_SELCHANGE           0x0400
76 #define CBF_NOEDITNOTIFY        0x1000
77 #define CBF_NOLBSELECT          0x2000  /* do not change current selection */
78 #define CBF_EUI                 0x8000
79
80 /* combo state struct */
81 typedef struct
82 {
83    struct tagWND *self;
84    HWND           owner;
85    UINT           dwStyle;
86    HWND           hWndEdit;
87    HWND           hWndLBox;
88    UINT           wState;
89    HFONT          hFont;
90    RECT           textRect;
91    RECT           buttonRect;
92    RECT           droppedRect;
93    INT            droppedIndex;
94    INT            fixedOwnerDrawHeight;
95    INT            droppedWidth;   /* last two are not used unless set */
96    INT            editHeight;     /* explicitly */
97 } HEADCOMBO,*LPHEADCOMBO;
98
99 /* Note, that CBS_DROPDOWNLIST style is actually (CBS_SIMPLE | CBS_DROPDOWN) */
100 #define CB_GETTYPE( lphc )    ((lphc)->dwStyle & (CBS_DROPDOWNLIST))
101 #define CB_DISABLED( lphc )   ((lphc)->self->dwStyle & WS_DISABLED)
102 #define CB_OWNERDRAWN( lphc ) ((lphc)->dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
103 #define CB_HASSTRINGS( lphc ) ((lphc)->dwStyle & CBS_HASSTRINGS)
104 #define CB_HWND( lphc )       ((lphc)->self->hwndSelf)
105
106 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL );
107
108 /* Dialog info structure.
109  * This structure is stored into the window extra bytes (cbWndExtra).
110  * sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30).
111  */
112 #include "pshpack1.h"
113
114 typedef struct
115 {
116     INT         msgResult;   /* 00 Last message result */
117     HWINDOWPROC dlgProc;     /* 04 Dialog procedure */
118     LONG        userInfo;    /* 08 User information (for DWL_USER) */
119
120     /* implementation-dependent part */
121
122     HWND16      hwndFocus;   /* 0c Current control with focus */
123     HFONT16     hUserFont;   /* 0e Dialog font */
124     HMENU16     hMenu;       /* 10 Dialog menu */
125     WORD        xBaseUnit;   /* 12 Dialog units (depends on the font) */
126     WORD        yBaseUnit;   /* 14 */
127     INT         idResult;    /* 16 EndDialog() result / default pushbutton ID */
128     UINT16      flags;       /* 1a EndDialog() called for this dialog */
129     HGLOBAL16   hDialogHeap; /* 1c */
130 } DIALOGINFO;
131
132 #include "poppack.h"
133
134 #define DF_END  0x0001
135 #define DF_OWNERENABLED 0x0002
136
137 extern BOOL DIALOG_Init(void);
138
139 #endif  /* __WINE_CONTROLS_H */