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 "wine/winbase16.h"
27 /* Built-in class names (see _Undocumented_Windows_ p.418) */
28 #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
29 #define DESKTOP_CLASS_ATOM MAKEINTATOM(32769) /* Desktop */
30 #define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
31 #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
32 #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
34 /* Built-in class descriptor */
35 struct builtin_class_descr
37 LPCWSTR name; /* class name */
38 UINT style; /* class style */
39 WNDPROC procA; /* ASCII window procedure */
40 WNDPROC procW; /* Unicode window procedure */
41 INT extra; /* window extra bytes */
42 ULONG_PTR cursor; /* cursor id */
43 HBRUSH brush; /* brush or system color */
46 extern const struct builtin_class_descr BUTTON_builtin_class DECLSPEC_HIDDEN;
47 extern const struct builtin_class_descr COMBO_builtin_class DECLSPEC_HIDDEN;
48 extern const struct builtin_class_descr COMBOLBOX_builtin_class DECLSPEC_HIDDEN;
49 extern const struct builtin_class_descr DIALOG_builtin_class DECLSPEC_HIDDEN;
50 extern const struct builtin_class_descr DESKTOP_builtin_class DECLSPEC_HIDDEN;
51 extern const struct builtin_class_descr EDIT_builtin_class DECLSPEC_HIDDEN;
52 extern const struct builtin_class_descr ICONTITLE_builtin_class DECLSPEC_HIDDEN;
53 extern const struct builtin_class_descr LISTBOX_builtin_class DECLSPEC_HIDDEN;
54 extern const struct builtin_class_descr MDICLIENT_builtin_class DECLSPEC_HIDDEN;
55 extern const struct builtin_class_descr MENU_builtin_class DECLSPEC_HIDDEN;
56 extern const struct builtin_class_descr SCROLL_builtin_class DECLSPEC_HIDDEN;
57 extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN;
59 extern WNDPROC EDIT_winproc_handle DECLSPEC_HIDDEN;
62 struct tagCLASS; /* opaque structure */
64 extern ATOM get_int_atom_value( LPCWSTR name ) DECLSPEC_HIDDEN;
65 extern void CLASS_RegisterBuiltinClasses(void) DECLSPEC_HIDDEN;
66 extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN;
67 extern struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
68 extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
69 extern void CLASS_FreeModuleClasses( HMODULE16 hModule ) DECLSPEC_HIDDEN;
72 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
75 extern BOOL DESKTOP_SetPattern( LPCWSTR pattern ) DECLSPEC_HIDDEN;
78 extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN;
81 extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
82 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
83 INT orgX, INT orgY ) DECLSPEC_HIDDEN;
84 extern BOOL MENU_SetMenu(HWND, HMENU) DECLSPEC_HIDDEN;
85 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDEN;
86 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar ) DECLSPEC_HIDDEN;
87 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
88 HWND hwnd, BOOL suppress_draw ) DECLSPEC_HIDDEN;
89 extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget ) DECLSPEC_HIDDEN;
92 extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN;
93 extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
94 extern LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) DECLSPEC_HIDDEN;
95 extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
96 extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
97 extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN;
98 extern LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
99 extern LRESULT NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
100 extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ) DECLSPEC_HIDDEN;
101 extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ) DECLSPEC_HIDDEN;
104 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior ) DECLSPEC_HIDDEN;
105 extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt ) DECLSPEC_HIDDEN;
106 extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
107 int hMin, int hMax, int hPos ) DECLSPEC_HIDDEN;
111 #define ID_CB_LISTBOX 1000
112 #define ID_CB_EDIT 1001
115 #define CBF_DROPPED 0x0001
116 #define CBF_BUTTONDOWN 0x0002
117 #define CBF_NOROLLUP 0x0004
118 #define CBF_MEASUREITEM 0x0008
119 #define CBF_FOCUSED 0x0010
120 #define CBF_CAPTURE 0x0020
121 #define CBF_EDIT 0x0040
122 #define CBF_NORESIZE 0x0080
123 #define CBF_NOTIFY 0x0100
124 #define CBF_NOREDRAW 0x0200
125 #define CBF_SELCHANGE 0x0400
126 #define CBF_NOEDITNOTIFY 0x1000
127 #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
128 #define CBF_EUI 0x8000
130 /* combo state struct */
144 INT fixedOwnerDrawHeight;
145 INT droppedWidth; /* last two are not used unless set */
146 INT editHeight; /* explicitly */
147 } HEADCOMBO,*LPHEADCOMBO;
149 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL ) DECLSPEC_HIDDEN;
151 /* Dialog info structure */
154 HWND hwndFocus; /* Current control with focus */
155 HFONT hUserFont; /* Dialog font */
156 HMENU hMenu; /* Dialog menu */
157 UINT xBaseUnit; /* Dialog units (depends on the font) */
159 INT idResult; /* EndDialog() result / default pushbutton ID */
160 UINT flags; /* EndDialog() called for this dialog */
161 HGLOBAL16 hDialogHeap;
164 #define DF_END 0x0001
165 #define DF_OWNERENABLED 0x0002
167 /* offset of DIALOGINFO ptr in dialog extra bytes */
168 #define DWLP_WINE_DIALOGINFO (DWLP_USER+sizeof(ULONG_PTR))
170 extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN;
171 extern void DIALOG_EnableOwner( HWND hOwner ) DECLSPEC_HIDDEN;
172 extern BOOL DIALOG_DisableOwner( HWND hOwner ) DECLSPEC_HIDDEN;
173 extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN;
175 #endif /* __WINE_CONTROLS_H */