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
25 #include "../win32u/ntuser_private.h"
27 /* Built-in class descriptor */
28 struct builtin_class_descr
30 LPCWSTR name
; /* class name */
31 UINT style
; /* class style */
32 enum builtin_winprocs proc
;
33 INT extra
; /* window extra bytes */
34 ULONG_PTR cursor
; /* cursor id */
35 HBRUSH brush
; /* brush or system color */
38 extern const struct builtin_class_descr BUTTON_builtin_class DECLSPEC_HIDDEN
;
39 extern const struct builtin_class_descr COMBO_builtin_class DECLSPEC_HIDDEN
;
40 extern const struct builtin_class_descr COMBOLBOX_builtin_class DECLSPEC_HIDDEN
;
41 extern const struct builtin_class_descr DIALOG_builtin_class DECLSPEC_HIDDEN
;
42 extern const struct builtin_class_descr DESKTOP_builtin_class DECLSPEC_HIDDEN
;
43 extern const struct builtin_class_descr EDIT_builtin_class DECLSPEC_HIDDEN
;
44 extern const struct builtin_class_descr ICONTITLE_builtin_class DECLSPEC_HIDDEN
;
45 extern const struct builtin_class_descr LISTBOX_builtin_class DECLSPEC_HIDDEN
;
46 extern const struct builtin_class_descr MDICLIENT_builtin_class DECLSPEC_HIDDEN
;
47 extern const struct builtin_class_descr MENU_builtin_class DECLSPEC_HIDDEN
;
48 extern const struct builtin_class_descr MESSAGE_builtin_class DECLSPEC_HIDDEN
;
49 extern const struct builtin_class_descr SCROLL_builtin_class DECLSPEC_HIDDEN
;
50 extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN
;
51 extern const struct builtin_class_descr IME_builtin_class DECLSPEC_HIDDEN
;
53 extern LRESULT WINAPI
ImeWndProcA(HWND
,UINT
,WPARAM
,LPARAM
) DECLSPEC_HIDDEN
;
54 extern LRESULT WINAPI
ImeWndProcW(HWND
,UINT
,WPARAM
,LPARAM
) DECLSPEC_HIDDEN
;
55 extern LRESULT WINAPI
DesktopWndProc(HWND
,UINT
,WPARAM
,LPARAM
) DECLSPEC_HIDDEN
;
56 extern LRESULT WINAPI
IconTitleWndProc(HWND
,UINT
,WPARAM
,LPARAM
) DECLSPEC_HIDDEN
;
57 extern LRESULT WINAPI
PopupMenuWndProc(HWND
,UINT
,WPARAM
,LPARAM
) DECLSPEC_HIDDEN
;
58 extern LRESULT WINAPI
MessageWndProc(HWND
,UINT
,WPARAM
,LPARAM
) DECLSPEC_HIDDEN
;
62 /* the structures must match the corresponding ones in user.exe */
65 LRESULT (*button_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
66 LRESULT (*combo_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
67 LRESULT (*edit_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
68 LRESULT (*listbox_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
69 LRESULT (*mdiclient_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
70 LRESULT (*scrollbar_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
71 LRESULT (*static_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
72 HWND (*create_window
)(CREATESTRUCTW
*,LPCWSTR
,HINSTANCE
,BOOL
);
73 LRESULT (*call_window_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,LRESULT
*,void*);
74 LRESULT (*call_dialog_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,LRESULT
*,void*);
79 LRESULT (*button_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
80 LRESULT (*combo_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
81 LRESULT (*edit_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
82 LRESULT (*listbox_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
83 LRESULT (*mdiclient_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
84 LRESULT (*scrollbar_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
85 LRESULT (*static_proc
)(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
);
86 HWND (*create_window
)(CREATESTRUCTW
*,LPCWSTR
,HINSTANCE
,BOOL
);
87 HWND (*get_win_handle
)(HWND
);
88 WNDPROC (*alloc_winproc
)(WNDPROC
,BOOL
);
89 struct tagDIALOGINFO
*(*get_dialog_info
)(HWND
,BOOL
);
90 INT (*dialog_box_loop
)(HWND
,HWND
);
93 extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN
;
95 extern LRESULT
ButtonWndProc_common(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
) DECLSPEC_HIDDEN
;
96 extern LRESULT
ComboWndProc_common(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
) DECLSPEC_HIDDEN
;
97 extern LRESULT
EditWndProc_common(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
) DECLSPEC_HIDDEN
;
98 extern LRESULT
ListBoxWndProc_common(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
) DECLSPEC_HIDDEN
;
99 extern LRESULT
MDIClientWndProc_common(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
) DECLSPEC_HIDDEN
;
100 extern LRESULT
ScrollBarWndProc_common(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
) DECLSPEC_HIDDEN
;
101 extern LRESULT
StaticWndProc_common(HWND
,UINT
,WPARAM
,LPARAM
,BOOL
) DECLSPEC_HIDDEN
;
103 /* Class functions */
104 struct tagCLASS
; /* opaque structure */
106 extern ATOM
get_int_atom_value( UNICODE_STRING
*name
) DECLSPEC_HIDDEN
;
107 extern void register_desktop_class(void) DECLSPEC_HIDDEN
;
110 extern HBRUSH
DEFWND_ControlColor( HDC hDC
, UINT ctlType
) DECLSPEC_HIDDEN
;
113 extern BOOL
update_wallpaper( const WCHAR
*wallpaper
, const WCHAR
*pattern
) DECLSPEC_HIDDEN
;
116 extern HWND
MENU_IsMenuActive(void) DECLSPEC_HIDDEN
;
117 extern UINT
MENU_GetMenuBarHeight( HWND hwnd
, UINT menubarWidth
,
118 INT orgX
, INT orgY
) DECLSPEC_HIDDEN
;
119 extern void MENU_TrackMouseMenuBar( HWND hwnd
, INT ht
, POINT pt
) DECLSPEC_HIDDEN
;
120 extern void MENU_TrackKbdMenuBar( HWND hwnd
, UINT wParam
, WCHAR wChar
) DECLSPEC_HIDDEN
;
121 extern UINT
MENU_DrawMenuBar( HDC hDC
, LPRECT lprect
, HWND hwnd
) DECLSPEC_HIDDEN
;
122 extern void MENU_EndMenu(HWND
) DECLSPEC_HIDDEN
;
123 extern HMENU
MENU_GetSysMenu( HWND hWnd
, HMENU hPopupMenu
) DECLSPEC_HIDDEN
;
126 extern LRESULT
NC_HandleNCPaint( HWND hwnd
, HRGN clip
) DECLSPEC_HIDDEN
;
127 extern LRESULT
NC_HandleNCActivate( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
128 extern void NC_HandleNCCalcSize( HWND hwnd
, WPARAM wParam
, RECT
*winRect
) DECLSPEC_HIDDEN
;
129 extern LRESULT
NC_HandleNCHitTest( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
130 extern LRESULT
NC_HandleNCLButtonDown( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
131 extern LRESULT
NC_HandleNCMouseMove( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
132 extern LRESULT
NC_HandleNCMouseLeave( HWND hwnd
) DECLSPEC_HIDDEN
;
133 extern LRESULT
NC_HandleNCRButtonDown( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
134 extern LRESULT
NC_HandleNCLButtonDblClk( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
135 extern LRESULT
NC_HandleSysCommand( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
136 extern LRESULT
NC_HandleSetCursor( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
137 extern BOOL
NC_DrawSysButton( HWND hwnd
, HDC hdc
, BOOL down
) DECLSPEC_HIDDEN
;
138 extern void NC_GetSysPopupPos( HWND hwnd
, RECT
* rect
) DECLSPEC_HIDDEN
;
142 extern void SCROLL_DrawNCScrollBar( HWND hwnd
, HDC hdc
, BOOL draw_horizontal
, BOOL draw_vertical
) DECLSPEC_HIDDEN
;
143 extern void SCROLL_DrawScrollBar( HWND hwnd
, HDC hdc
, INT nBar
, enum SCROLL_HITTEST hit_test
,
144 const struct SCROLL_TRACKING_INFO
*tracking_info
, BOOL arrows
,
145 BOOL interior
) DECLSPEC_HIDDEN
;
146 extern void SCROLL_HandleScrollEvent( HWND hwnd
, INT nBar
, UINT msg
, POINT pt
) DECLSPEC_HIDDEN
;
147 extern void SCROLL_TrackScrollBar( HWND hwnd
, INT scrollbar
, POINT pt
) DECLSPEC_HIDDEN
;
151 #define ID_CB_LISTBOX 1000
152 #define ID_CB_EDIT 1001
155 #define CBF_DROPPED 0x0001
156 #define CBF_BUTTONDOWN 0x0002
157 #define CBF_NOROLLUP 0x0004
158 #define CBF_MEASUREITEM 0x0008
159 #define CBF_FOCUSED 0x0010
160 #define CBF_CAPTURE 0x0020
161 #define CBF_EDIT 0x0040
162 #define CBF_NORESIZE 0x0080
163 #define CBF_NOTIFY 0x0100
164 #define CBF_NOREDRAW 0x0200
165 #define CBF_SELCHANGE 0x0400
166 #define CBF_NOEDITNOTIFY 0x1000
167 #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
168 #define CBF_BEENFOCUSED 0x4000 /* has it ever had focus */
169 #define CBF_EUI 0x8000
171 /* combo state struct */
185 INT fixedOwnerDrawHeight
;
186 INT droppedWidth
; /* not used unless set explicitly */
188 } HEADCOMBO
,*LPHEADCOMBO
;
190 extern BOOL
COMBO_FlipListbox( LPHEADCOMBO
, BOOL
, BOOL
) DECLSPEC_HIDDEN
;
192 /* Dialog info structure (note: shared with user.exe) */
193 typedef struct tagDIALOGINFO
195 HWND hwndFocus
; /* Current control with focus */
196 HFONT hUserFont
; /* Dialog font */
197 HMENU hMenu
; /* Dialog menu */
198 UINT xBaseUnit
; /* Dialog units (depends on the font) */
200 INT idResult
; /* EndDialog() result / default pushbutton ID */
201 UINT flags
; /* EndDialog() called for this dialog */
204 #define DF_END 0x0001
206 extern DIALOGINFO
*DIALOG_get_info( HWND hwnd
, BOOL create
) DECLSPEC_HIDDEN
;
207 extern INT
DIALOG_DoDialogBox( HWND hwnd
, HWND owner
) DECLSPEC_HIDDEN
;
209 HRGN
set_control_clipping( HDC hdc
, const RECT
*rect
) DECLSPEC_HIDDEN
;
211 #endif /* __WINE_CONTROLS_H */