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 void CLASS_AddWindow( struct tagCLASS *class, struct tagWND *win, BOOL unicode ) DECLSPEC_HIDDEN;
67 extern void CLASS_FreeModuleClasses( HMODULE16 hModule ) DECLSPEC_HIDDEN;
70 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
73 extern BOOL DESKTOP_SetPattern( LPCWSTR pattern ) DECLSPEC_HIDDEN;
76 extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN;
79 extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
80 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
81 INT orgX, INT orgY ) DECLSPEC_HIDDEN;
82 extern BOOL MENU_SetMenu(HWND, HMENU) DECLSPEC_HIDDEN;
83 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDEN;
84 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar ) DECLSPEC_HIDDEN;
85 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
86 HWND hwnd, BOOL suppress_draw ) DECLSPEC_HIDDEN;
87 extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget ) DECLSPEC_HIDDEN;
90 extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN;
91 extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam ) DECLSPEC_HIDDEN;
92 extern LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) DECLSPEC_HIDDEN;
93 extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
94 extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
95 extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN;
96 extern LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
97 extern LRESULT NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
98 extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ) DECLSPEC_HIDDEN;
99 extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ) DECLSPEC_HIDDEN;
102 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior ) DECLSPEC_HIDDEN;
103 extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt ) DECLSPEC_HIDDEN;
104 extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
105 int hMin, int hMax, int hPos ) DECLSPEC_HIDDEN;
109 #define ID_CB_LISTBOX 1000
110 #define ID_CB_EDIT 1001
113 #define CBF_DROPPED 0x0001
114 #define CBF_BUTTONDOWN 0x0002
115 #define CBF_NOROLLUP 0x0004
116 #define CBF_MEASUREITEM 0x0008
117 #define CBF_FOCUSED 0x0010
118 #define CBF_CAPTURE 0x0020
119 #define CBF_EDIT 0x0040
120 #define CBF_NORESIZE 0x0080
121 #define CBF_NOTIFY 0x0100
122 #define CBF_NOREDRAW 0x0200
123 #define CBF_SELCHANGE 0x0400
124 #define CBF_NOEDITNOTIFY 0x1000
125 #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
126 #define CBF_EUI 0x8000
128 /* combo state struct */
142 INT fixedOwnerDrawHeight;
143 INT droppedWidth; /* last two are not used unless set */
144 INT editHeight; /* explicitly */
145 } HEADCOMBO,*LPHEADCOMBO;
147 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL ) DECLSPEC_HIDDEN;
149 /* Dialog info structure */
152 HWND hwndFocus; /* Current control with focus */
153 HFONT hUserFont; /* Dialog font */
154 HMENU hMenu; /* Dialog menu */
155 UINT xBaseUnit; /* Dialog units (depends on the font) */
157 INT idResult; /* EndDialog() result / default pushbutton ID */
158 UINT flags; /* EndDialog() called for this dialog */
159 HGLOBAL16 hDialogHeap;
162 #define DF_END 0x0001
163 #define DF_OWNERENABLED 0x0002
165 /* offset of DIALOGINFO ptr in dialog extra bytes */
166 #define DWLP_WINE_DIALOGINFO (DWLP_USER+sizeof(ULONG_PTR))
168 extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN;
169 extern void DIALOG_EnableOwner( HWND hOwner ) DECLSPEC_HIDDEN;
170 extern BOOL DIALOG_DisableOwner( HWND hOwner ) DECLSPEC_HIDDEN;
171 extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN;
173 #endif /* __WINE_CONTROLS_H */