dbghelp: Provide a default value for DYLD_FALLBACK_LIBRARY_PATH, which is closer...
[wine.git] / dlls / user32 / controls.h
blob69bc94c489901417fa3bdc2ce6dd086e0b4affae
1 /*
2 * User controls definitions
4 * Copyright 2000 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_CONTROLS_H
22 #define __WINE_CONTROLS_H
24 #include "winuser.h"
26 /* Built-in class names (see _Undocumented_Windows_ p.418) */
27 #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
28 #define DESKTOP_CLASS_ATOM MAKEINTATOM(32769) /* Desktop */
29 #define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
30 #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
31 #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
33 enum builtin_winprocs
35 /* dual A/W procs */
36 WINPROC_BUTTON = 0,
37 WINPROC_COMBO,
38 WINPROC_DEFWND,
39 WINPROC_DIALOG,
40 WINPROC_EDIT,
41 WINPROC_LISTBOX,
42 WINPROC_MDICLIENT,
43 WINPROC_SCROLLBAR,
44 WINPROC_STATIC,
45 WINPROC_IME,
46 /* unicode-only procs */
47 WINPROC_DESKTOP,
48 WINPROC_ICONTITLE,
49 WINPROC_MENU,
50 WINPROC_MESSAGE,
51 NB_BUILTIN_WINPROCS,
52 NB_BUILTIN_AW_WINPROCS = WINPROC_DESKTOP
55 #define WINPROC_HANDLE (~0u >> 16)
56 #define BUILTIN_WINPROC(index) ((WNDPROC)(ULONG_PTR)((index) | (WINPROC_HANDLE << 16)))
58 /* Built-in class descriptor */
59 struct builtin_class_descr
61 LPCWSTR name; /* class name */
62 UINT style; /* class style */
63 enum builtin_winprocs proc;
64 INT extra; /* window extra bytes */
65 ULONG_PTR cursor; /* cursor id */
66 HBRUSH brush; /* brush or system color */
69 extern const struct builtin_class_descr BUTTON_builtin_class DECLSPEC_HIDDEN;
70 extern const struct builtin_class_descr COMBO_builtin_class DECLSPEC_HIDDEN;
71 extern const struct builtin_class_descr COMBOLBOX_builtin_class DECLSPEC_HIDDEN;
72 extern const struct builtin_class_descr DIALOG_builtin_class DECLSPEC_HIDDEN;
73 extern const struct builtin_class_descr DESKTOP_builtin_class DECLSPEC_HIDDEN;
74 extern const struct builtin_class_descr EDIT_builtin_class DECLSPEC_HIDDEN;
75 extern const struct builtin_class_descr ICONTITLE_builtin_class DECLSPEC_HIDDEN;
76 extern const struct builtin_class_descr LISTBOX_builtin_class DECLSPEC_HIDDEN;
77 extern const struct builtin_class_descr MDICLIENT_builtin_class DECLSPEC_HIDDEN;
78 extern const struct builtin_class_descr MENU_builtin_class DECLSPEC_HIDDEN;
79 extern const struct builtin_class_descr MESSAGE_builtin_class DECLSPEC_HIDDEN;
80 extern const struct builtin_class_descr SCROLL_builtin_class DECLSPEC_HIDDEN;
81 extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN;
82 extern const struct builtin_class_descr IME_builtin_class DECLSPEC_HIDDEN;
84 extern LRESULT WINAPI ImeWndProcA(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
85 extern LRESULT WINAPI ImeWndProcW(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
86 extern LRESULT WINAPI DesktopWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
87 extern LRESULT WINAPI IconTitleWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
88 extern LRESULT WINAPI PopupMenuWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
89 extern LRESULT WINAPI MessageWndProc(HWND,UINT,WPARAM,LPARAM) DECLSPEC_HIDDEN;
91 /* Wow handlers */
93 /* the structures must match the corresponding ones in user.exe */
94 struct wow_handlers16
96 LRESULT (*button_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
97 LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
98 LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
99 LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
100 LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
101 LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
102 LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
103 DWORD (*wait_message)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
104 HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL);
105 LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
106 LRESULT (*call_dialog_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
107 void (*free_icon_param)(ULONG_PTR);
110 struct wow_handlers32
112 LRESULT (*button_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
113 LRESULT (*combo_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
114 LRESULT (*edit_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
115 LRESULT (*listbox_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
116 LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
117 LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
118 LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
119 DWORD (*wait_message)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
120 HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL);
121 HWND (*get_win_handle)(HWND);
122 WNDPROC (*alloc_winproc)(WNDPROC,BOOL);
123 struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL);
124 INT (*dialog_box_loop)(HWND,HWND);
125 ULONG_PTR (*get_icon_param)(HICON);
126 ULONG_PTR (*set_icon_param)(HICON,ULONG_PTR);
129 extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN;
131 extern LRESULT ButtonWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
132 extern LRESULT ComboWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
133 extern LRESULT EditWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
134 extern LRESULT ListBoxWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
135 extern LRESULT MDIClientWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
136 extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
137 extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
139 extern ULONG_PTR get_icon_param( HICON handle ) DECLSPEC_HIDDEN;
140 extern ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param ) DECLSPEC_HIDDEN;
142 /* Class functions */
143 struct tagCLASS; /* opaque structure */
144 struct tagWND;
145 extern ATOM get_int_atom_value( LPCWSTR name ) DECLSPEC_HIDDEN;
146 extern void register_builtin_classes(void) DECLSPEC_HIDDEN;
147 extern void register_desktop_class(void) DECLSPEC_HIDDEN;
148 extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN;
149 extern struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
150 extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
152 /* defwnd proc */
153 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
155 /* desktop */
156 extern BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern ) DECLSPEC_HIDDEN;
158 /* icon title */
159 extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN;
161 /* menu controls */
162 extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
163 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
164 INT orgX, INT orgY ) DECLSPEC_HIDDEN;
165 extern BOOL MENU_SetMenu(HWND, HMENU) DECLSPEC_HIDDEN;
166 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDEN;
167 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar ) DECLSPEC_HIDDEN;
168 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd ) DECLSPEC_HIDDEN;
169 extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN;
171 /* nonclient area */
172 extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN;
173 extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
174 extern LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wParam, RECT *winRect ) DECLSPEC_HIDDEN;
175 extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
176 extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
177 extern LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
178 extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN;
179 extern LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
180 extern LRESULT NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
181 extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ) DECLSPEC_HIDDEN;
182 extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ) DECLSPEC_HIDDEN;
184 /* scrollbar */
185 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior ) DECLSPEC_HIDDEN;
186 extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt ) DECLSPEC_HIDDEN;
188 /* combo box */
190 #define ID_CB_LISTBOX 1000
191 #define ID_CB_EDIT 1001
193 /* internal flags */
194 #define CBF_DROPPED 0x0001
195 #define CBF_BUTTONDOWN 0x0002
196 #define CBF_NOROLLUP 0x0004
197 #define CBF_MEASUREITEM 0x0008
198 #define CBF_FOCUSED 0x0010
199 #define CBF_CAPTURE 0x0020
200 #define CBF_EDIT 0x0040
201 #define CBF_NORESIZE 0x0080
202 #define CBF_NOTIFY 0x0100
203 #define CBF_NOREDRAW 0x0200
204 #define CBF_SELCHANGE 0x0400
205 #define CBF_NOEDITNOTIFY 0x1000
206 #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
207 #define CBF_BEENFOCUSED 0x4000 /* has it ever had focus */
208 #define CBF_EUI 0x8000
210 /* combo state struct */
211 typedef struct
213 HWND self;
214 HWND owner;
215 UINT dwStyle;
216 HWND hWndEdit;
217 HWND hWndLBox;
218 UINT wState;
219 HFONT hFont;
220 RECT textRect;
221 RECT buttonRect;
222 RECT droppedRect;
223 INT droppedIndex;
224 INT fixedOwnerDrawHeight;
225 INT droppedWidth; /* last two are not used unless set */
226 INT editHeight; /* explicitly */
227 } HEADCOMBO,*LPHEADCOMBO;
229 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL ) DECLSPEC_HIDDEN;
231 /* Dialog info structure (note: shared with user.exe) */
232 typedef struct tagDIALOGINFO
234 HWND hwndFocus; /* Current control with focus */
235 HFONT hUserFont; /* Dialog font */
236 HMENU hMenu; /* Dialog menu */
237 UINT xBaseUnit; /* Dialog units (depends on the font) */
238 UINT yBaseUnit;
239 INT idResult; /* EndDialog() result / default pushbutton ID */
240 UINT flags; /* EndDialog() called for this dialog */
241 } DIALOGINFO;
243 #define DF_END 0x0001
244 #define DF_OWNERENABLED 0x0002
246 extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN;
247 extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN;
249 HRGN set_control_clipping( HDC hdc, const RECT *rect ) DECLSPEC_HIDDEN;
251 #endif /* __WINE_CONTROLS_H */