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 void MENU_TrackMouseMenuBar( HWND hwnd
, INT ht
, POINT pt
) DECLSPEC_HIDDEN
;
117 extern void MENU_TrackKbdMenuBar( HWND hwnd
, UINT wParam
, WCHAR wChar
) DECLSPEC_HIDDEN
;
118 extern void MENU_EndMenu(HWND
) DECLSPEC_HIDDEN
;
119 extern HMENU
MENU_GetSysMenu( HWND hWnd
, HMENU hPopupMenu
) DECLSPEC_HIDDEN
;
122 extern LRESULT
NC_HandleNCMouseMove( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
123 extern LRESULT
NC_HandleNCMouseLeave( HWND hwnd
) DECLSPEC_HIDDEN
;
124 extern LRESULT
NC_HandleNCLButtonDblClk( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
125 extern LRESULT
NC_HandleSysCommand( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
126 extern LRESULT
NC_HandleSetCursor( HWND hwnd
, WPARAM wParam
, LPARAM lParam
) DECLSPEC_HIDDEN
;
130 extern void SCROLL_DrawNCScrollBar( HWND hwnd
, HDC hdc
, BOOL draw_horizontal
, BOOL draw_vertical
) DECLSPEC_HIDDEN
;
131 extern void SCROLL_DrawScrollBar( HWND hwnd
, HDC hdc
, INT nBar
, enum SCROLL_HITTEST hit_test
,
132 const struct SCROLL_TRACKING_INFO
*tracking_info
, BOOL arrows
,
133 BOOL interior
) DECLSPEC_HIDDEN
;
134 extern void SCROLL_HandleScrollEvent( HWND hwnd
, INT nBar
, UINT msg
, POINT pt
) DECLSPEC_HIDDEN
;
135 extern void SCROLL_TrackScrollBar( HWND hwnd
, INT scrollbar
, POINT pt
) DECLSPEC_HIDDEN
;
139 #define ID_CB_LISTBOX 1000
140 #define ID_CB_EDIT 1001
143 #define CBF_DROPPED 0x0001
144 #define CBF_BUTTONDOWN 0x0002
145 #define CBF_NOROLLUP 0x0004
146 #define CBF_MEASUREITEM 0x0008
147 #define CBF_FOCUSED 0x0010
148 #define CBF_CAPTURE 0x0020
149 #define CBF_EDIT 0x0040
150 #define CBF_NORESIZE 0x0080
151 #define CBF_NOTIFY 0x0100
152 #define CBF_NOREDRAW 0x0200
153 #define CBF_SELCHANGE 0x0400
154 #define CBF_NOEDITNOTIFY 0x1000
155 #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
156 #define CBF_BEENFOCUSED 0x4000 /* has it ever had focus */
157 #define CBF_EUI 0x8000
159 /* combo state struct */
173 INT fixedOwnerDrawHeight
;
174 INT droppedWidth
; /* not used unless set explicitly */
176 } HEADCOMBO
,*LPHEADCOMBO
;
178 extern BOOL
COMBO_FlipListbox( LPHEADCOMBO
, BOOL
, BOOL
) DECLSPEC_HIDDEN
;
180 /* Dialog info structure (note: shared with user.exe) */
181 typedef struct tagDIALOGINFO
183 HWND hwndFocus
; /* Current control with focus */
184 HFONT hUserFont
; /* Dialog font */
185 HMENU hMenu
; /* Dialog menu */
186 UINT xBaseUnit
; /* Dialog units (depends on the font) */
188 INT idResult
; /* EndDialog() result / default pushbutton ID */
189 UINT flags
; /* EndDialog() called for this dialog */
192 #define DF_END 0x0001
194 extern DIALOGINFO
*DIALOG_get_info( HWND hwnd
, BOOL create
) DECLSPEC_HIDDEN
;
195 extern INT
DIALOG_DoDialogBox( HWND hwnd
, HWND owner
) DECLSPEC_HIDDEN
;
197 HRGN
set_control_clipping( HDC hdc
, const RECT
*rect
) DECLSPEC_HIDDEN
;
199 #endif /* __WINE_CONTROLS_H */