push 556f62bab943c37bb6cbad95a6ecb3d73e04a93f
[wine/hacks.git] / dlls / user32 / controls.h
blobf51a3d9ded62251ec86ea4bdd8461795b5724aa7
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"
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 MESSAGE_builtin_class DECLSPEC_HIDDEN;
57 extern const struct builtin_class_descr SCROLL_builtin_class DECLSPEC_HIDDEN;
58 extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN;
60 extern WNDPROC EDIT_winproc_handle DECLSPEC_HIDDEN;
62 /* Class functions */
63 struct tagCLASS; /* opaque structure */
64 struct tagWND;
65 extern ATOM get_int_atom_value( LPCWSTR name ) DECLSPEC_HIDDEN;
66 extern void CLASS_RegisterBuiltinClasses(void) DECLSPEC_HIDDEN;
67 extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN;
68 extern struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
69 extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
70 extern void CLASS_FreeModuleClasses( HMODULE16 hModule ) DECLSPEC_HIDDEN;
72 /* defwnd proc */
73 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
75 /* desktop */
76 extern BOOL DESKTOP_SetPattern( LPCWSTR pattern ) DECLSPEC_HIDDEN;
78 /* icon title */
79 extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN;
81 /* menu controls */
82 extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN;
83 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
84 INT orgX, INT orgY ) DECLSPEC_HIDDEN;
85 extern BOOL MENU_SetMenu(HWND, HMENU) DECLSPEC_HIDDEN;
86 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDEN;
87 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar ) DECLSPEC_HIDDEN;
88 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
89 HWND hwnd, BOOL suppress_draw ) DECLSPEC_HIDDEN;
90 extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget ) DECLSPEC_HIDDEN;
91 extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN;
93 /* nonclient area */
94 extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN;
95 extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
96 extern LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) DECLSPEC_HIDDEN;
97 extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
98 extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
99 extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN;
100 extern LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
101 extern LRESULT NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
102 extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ) DECLSPEC_HIDDEN;
103 extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ) DECLSPEC_HIDDEN;
105 /* scrollbar */
106 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior ) DECLSPEC_HIDDEN;
107 extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt ) DECLSPEC_HIDDEN;
108 extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
109 int hMin, int hMax, int hPos ) DECLSPEC_HIDDEN;
111 /* combo box */
113 #define ID_CB_LISTBOX 1000
114 #define ID_CB_EDIT 1001
116 /* internal flags */
117 #define CBF_DROPPED 0x0001
118 #define CBF_BUTTONDOWN 0x0002
119 #define CBF_NOROLLUP 0x0004
120 #define CBF_MEASUREITEM 0x0008
121 #define CBF_FOCUSED 0x0010
122 #define CBF_CAPTURE 0x0020
123 #define CBF_EDIT 0x0040
124 #define CBF_NORESIZE 0x0080
125 #define CBF_NOTIFY 0x0100
126 #define CBF_NOREDRAW 0x0200
127 #define CBF_SELCHANGE 0x0400
128 #define CBF_NOEDITNOTIFY 0x1000
129 #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
130 #define CBF_EUI 0x8000
132 /* combo state struct */
133 typedef struct
135 HWND self;
136 HWND owner;
137 UINT dwStyle;
138 HWND hWndEdit;
139 HWND hWndLBox;
140 UINT wState;
141 HFONT hFont;
142 RECT textRect;
143 RECT buttonRect;
144 RECT droppedRect;
145 INT droppedIndex;
146 INT fixedOwnerDrawHeight;
147 INT droppedWidth; /* last two are not used unless set */
148 INT editHeight; /* explicitly */
149 } HEADCOMBO,*LPHEADCOMBO;
151 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL ) DECLSPEC_HIDDEN;
153 /* Dialog info structure */
154 typedef struct tagDIALOGINFO
156 HWND hwndFocus; /* Current control with focus */
157 HFONT hUserFont; /* Dialog font */
158 HMENU hMenu; /* Dialog menu */
159 UINT xBaseUnit; /* Dialog units (depends on the font) */
160 UINT yBaseUnit;
161 INT idResult; /* EndDialog() result / default pushbutton ID */
162 UINT flags; /* EndDialog() called for this dialog */
163 HGLOBAL16 hDialogHeap;
164 } DIALOGINFO;
166 #define DF_END 0x0001
167 #define DF_OWNERENABLED 0x0002
169 extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN;
170 extern void DIALOG_EnableOwner( HWND hOwner ) DECLSPEC_HIDDEN;
171 extern BOOL DIALOG_DisableOwner( HWND hOwner ) DECLSPEC_HIDDEN;
172 extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN;
174 #endif /* __WINE_CONTROLS_H */