xref: /reactos/dll/win32/comctl32/comctl32.h (revision ea6e7740)
1 /******************************************************************************
2  *
3  * Common definitions (resource ids and global variables)
4  *
5  * Copyright 1999 Thuy Nguyen
6  * Copyright 1999 Eric Kohl
7  * Copyright 2002 Dimitrie O. Paun
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #ifndef __WINE_COMCTL32_H
25 #define __WINE_COMCTL32_H
26 
27 #ifndef RC_INVOKED
28 #include <stdarg.h>
29 #endif
30 
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "winuser.h"
35 #include "winnls.h"
36 #include "commctrl.h"
37 #include "windowsx.h"
38 
39 #ifdef __REACTOS__
40 // This is really ComCtl32 v5.82, the last one not supporting SxS
41 #undef  COMCTL32_VERSION // Undefines what the PSDK gave to us
42 #define COMCTL32_VERSION        5
43 #define COMCTL32_VERSION_MINOR 82
44 #endif
45 
46 extern HMODULE COMCTL32_hModule DECLSPEC_HIDDEN;
47 extern HBRUSH  COMCTL32_hPattern55AABrush DECLSPEC_HIDDEN;
48 
49 /* Property sheet / Wizard */
50 #define IDD_PROPSHEET 1006
51 #define IDD_WIZARD    1020
52 
53 #define IDC_TABCONTROL   12320
54 #define IDC_APPLY_BUTTON 12321
55 #define IDC_BACK_BUTTON  12323
56 #define IDC_NEXT_BUTTON  12324
57 #define IDC_FINISH_BUTTON 12325
58 #define IDC_SUNKEN_LINE   12326
59 #define IDC_SUNKEN_LINEHEADER 12327
60 
61 #define IDS_CLOSE	  4160
62 
63 /* Toolbar customization dialog */
64 #define IDD_TBCUSTOMIZE     200
65 
66 #define IDC_AVAILBTN_LBOX   201
67 #define IDC_RESET_BTN       202
68 #define IDC_TOOLBARBTN_LBOX 203
69 #define IDC_REMOVE_BTN      204
70 #define IDC_HELP_BTN        205
71 #define IDC_MOVEUP_BTN      206
72 #define IDC_MOVEDN_BTN      207
73 
74 #define IDS_SEPARATOR      1024
75 
76 /* Toolbar imagelist bitmaps */
77 #define IDB_STD_SMALL       120
78 #define IDB_STD_LARGE       121
79 #define IDB_VIEW_SMALL      124
80 #define IDB_VIEW_LARGE      125
81 #define IDB_HIST_SMALL      130
82 #define IDB_HIST_LARGE      131
83 
84 #define IDM_TODAY                      4163
85 #define IDM_GOTODAY                    4164
86 
87 /* Treeview Checkboxes */
88 
89 #define IDT_CHECK        401
90 
91 
92 /* Cursors */
93 #define IDC_MOVEBUTTON                  102
94 #define IDC_COPY                        104
95 #define IDC_DIVIDER                     106
96 #define IDC_DIVIDEROPEN                 107
97 
98 
99 /* DragList resources */
100 #define IDI_DRAGARROW                   501
101 
102 /* HOTKEY internal strings */
103 #define HKY_NONE                        2048
104 
105 /* Tooltip icons */
106 #define IDI_TT_INFO_SM                   22
107 #define IDI_TT_WARN_SM                   25
108 #define IDI_TT_ERROR_SM                  28
109 
110 /* Taskdialog strings */
111 #define IDS_BUTTON_YES    3000
112 #define IDS_BUTTON_NO     3001
113 #define IDS_BUTTON_RETRY  3002
114 #define IDS_BUTTON_OK     3003
115 #define IDS_BUTTON_CANCEL 3004
116 #define IDS_BUTTON_CLOSE  3005
117 
118 #ifndef __REACTOS__
119 #define WM_SYSTIMER     0x0118
120 #endif
121 
122 enum combobox_state_flags
123 {
124     CBF_DROPPED      = 0x0001,
125     CBF_BUTTONDOWN   = 0x0002,
126     CBF_NOROLLUP     = 0x0004,
127     CBF_MEASUREITEM  = 0x0008,
128     CBF_FOCUSED      = 0x0010,
129     CBF_CAPTURE      = 0x0020,
130     CBF_EDIT         = 0x0040,
131     CBF_NORESIZE     = 0x0080,
132     CBF_NOTIFY       = 0x0100,
133     CBF_NOREDRAW     = 0x0200,
134     CBF_SELCHANGE    = 0x0400,
135     CBF_HOT          = 0x0800,
136     CBF_NOEDITNOTIFY = 0x1000,
137     CBF_NOLBSELECT   = 0x2000, /* do not change current selection */
138     CBF_BEENFOCUSED  = 0x4000, /* has it ever had focus           */
139     CBF_EUI          = 0x8000,
140 };
141 
142 typedef struct
143 {
144    HWND           self;
145    HWND           owner;
146    UINT           dwStyle;
147    HWND           hWndEdit;
148    HWND           hWndLBox;
149    UINT           wState;
150    HFONT          hFont;
151    RECT           textRect;
152    RECT           buttonRect;
153    RECT           droppedRect;
154    INT            droppedIndex;
155    INT            fixedOwnerDrawHeight;
156    INT            droppedWidth;   /* last two are not used unless set */
157    INT            editHeight;     /* explicitly */
158    INT            visibleItems;
159 } HEADCOMBO, *LPHEADCOMBO;
160 
161 extern BOOL COMBO_FlipListbox(HEADCOMBO *lphc, BOOL ok, BOOL bRedrawButton) DECLSPEC_HIDDEN;
162 
163 typedef struct
164 {
165     COLORREF clrBtnHighlight;       /* COLOR_BTNHIGHLIGHT                  */
166     COLORREF clrBtnShadow;          /* COLOR_BTNSHADOW                     */
167     COLORREF clrBtnText;            /* COLOR_BTNTEXT                       */
168     COLORREF clrBtnFace;            /* COLOR_BTNFACE                       */
169     COLORREF clrHighlight;          /* COLOR_HIGHLIGHT                     */
170     COLORREF clrHighlightText;      /* COLOR_HIGHLIGHTTEXT                 */
171     COLORREF clrHotTrackingColor;   /* COLOR_HOTLIGHT                      */
172     COLORREF clr3dHilight;          /* COLOR_3DHILIGHT                     */
173     COLORREF clr3dShadow;           /* COLOR_3DSHADOW                      */
174     COLORREF clr3dDkShadow;         /* COLOR_3DDKSHADOW                    */
175     COLORREF clr3dFace;             /* COLOR_3DFACE                        */
176     COLORREF clrWindow;             /* COLOR_WINDOW                        */
177     COLORREF clrWindowText;         /* COLOR_WINDOWTEXT                    */
178     COLORREF clrGrayText;           /* COLOR_GREYTEXT                      */
179     COLORREF clrActiveCaption;      /* COLOR_ACTIVECAPTION                 */
180     COLORREF clrInfoBk;             /* COLOR_INFOBK                        */
181     COLORREF clrInfoText;           /* COLOR_INFOTEXT                      */
182 } COMCTL32_SysColor;
183 
184 extern COMCTL32_SysColor  comctl32_color DECLSPEC_HIDDEN;
185 
186 /* Internal function */
187 HWND COMCTL32_CreateToolTip (HWND) DECLSPEC_HIDDEN;
188 VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN;
189 void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal) DECLSPEC_HIDDEN;
190 void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground) DECLSPEC_HIDDEN;
191 void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm) DECLSPEC_HIDDEN;
192 BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN;
193 INT  Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN;
194 INT  Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN;
195 BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN;
196 BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc) DECLSPEC_HIDDEN;
197 
198 #ifndef __REACTOS__
199 #define COMCTL32_VERSION_MINOR 81
200 #endif
201 
202 /* Our internal stack structure of the window procedures to subclass */
203 typedef struct _SUBCLASSPROCS {
204     SUBCLASSPROC subproc;
205     UINT_PTR id;
206     DWORD_PTR ref;
207     struct _SUBCLASSPROCS *next;
208 } SUBCLASSPROCS, *LPSUBCLASSPROCS;
209 
210 typedef struct
211 {
212    SUBCLASSPROCS *SubclassProcs;
213    SUBCLASSPROCS *stackpos;
214    WNDPROC origproc;
215    int running;
216 } SUBCLASS_INFO, *LPSUBCLASS_INFO;
217 
218 /* undocumented functions */
219 
220 LPVOID WINAPI Alloc (DWORD) __WINE_ALLOC_SIZE(1);
221 LPVOID WINAPI ReAlloc (LPVOID, DWORD) __WINE_ALLOC_SIZE(2);
222 BOOL   WINAPI Free (LPVOID);
223 DWORD  WINAPI GetSize (LPVOID);
224 
225 INT  WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
226 INT  WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
227 
228 LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet);
229 BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2);
230 
231 HRGN set_control_clipping(HDC hdc, const RECT *rect) DECLSPEC_HIDDEN;
232 
233 extern void ANIMATE_Register(void) DECLSPEC_HIDDEN;
234 extern void ANIMATE_Unregister(void) DECLSPEC_HIDDEN;
235 extern void BUTTON_Register(void) DECLSPEC_HIDDEN;
236 extern void COMBO_Register(void) DECLSPEC_HIDDEN;
237 extern void COMBOEX_Register(void) DECLSPEC_HIDDEN;
238 extern void COMBOEX_Unregister(void) DECLSPEC_HIDDEN;
239 extern void COMBOLBOX_Register(void) DECLSPEC_HIDDEN;
240 extern void DATETIME_Register(void) DECLSPEC_HIDDEN;
241 extern void DATETIME_Unregister(void) DECLSPEC_HIDDEN;
242 extern void EDIT_Register(void) DECLSPEC_HIDDEN;
243 extern void FLATSB_Register(void) DECLSPEC_HIDDEN;
244 extern void FLATSB_Unregister(void) DECLSPEC_HIDDEN;
245 extern void HEADER_Register(void) DECLSPEC_HIDDEN;
246 extern void HEADER_Unregister(void) DECLSPEC_HIDDEN;
247 extern void HOTKEY_Register(void) DECLSPEC_HIDDEN;
248 extern void HOTKEY_Unregister(void) DECLSPEC_HIDDEN;
249 extern void IPADDRESS_Register(void) DECLSPEC_HIDDEN;
250 extern void IPADDRESS_Unregister(void) DECLSPEC_HIDDEN;
251 extern void LISTBOX_Register(void) DECLSPEC_HIDDEN;
252 extern void LISTVIEW_Register(void) DECLSPEC_HIDDEN;
253 extern void LISTVIEW_Unregister(void) DECLSPEC_HIDDEN;
254 extern void MONTHCAL_Register(void) DECLSPEC_HIDDEN;
255 extern void MONTHCAL_Unregister(void) DECLSPEC_HIDDEN;
256 extern void NATIVEFONT_Register(void) DECLSPEC_HIDDEN;
257 extern void NATIVEFONT_Unregister(void) DECLSPEC_HIDDEN;
258 extern void PAGER_Register(void) DECLSPEC_HIDDEN;
259 extern void PAGER_Unregister(void) DECLSPEC_HIDDEN;
260 extern void PROGRESS_Register(void) DECLSPEC_HIDDEN;
261 extern void PROGRESS_Unregister(void) DECLSPEC_HIDDEN;
262 extern void REBAR_Register(void) DECLSPEC_HIDDEN;
263 extern void REBAR_Unregister(void) DECLSPEC_HIDDEN;
264 extern void STATIC_Register(void) DECLSPEC_HIDDEN;
265 extern void STATUS_Register(void) DECLSPEC_HIDDEN;
266 extern void STATUS_Unregister(void) DECLSPEC_HIDDEN;
267 extern void SYSLINK_Register(void) DECLSPEC_HIDDEN;
268 extern void SYSLINK_Unregister(void) DECLSPEC_HIDDEN;
269 extern void TAB_Register(void) DECLSPEC_HIDDEN;
270 extern void TAB_Unregister(void) DECLSPEC_HIDDEN;
271 extern void TOOLBAR_Register(void) DECLSPEC_HIDDEN;
272 extern void TOOLBAR_Unregister(void) DECLSPEC_HIDDEN;
273 extern void TOOLTIPS_Register(void) DECLSPEC_HIDDEN;
274 extern void TOOLTIPS_Unregister(void) DECLSPEC_HIDDEN;
275 extern void TRACKBAR_Register(void) DECLSPEC_HIDDEN;
276 extern void TRACKBAR_Unregister(void) DECLSPEC_HIDDEN;
277 extern void TREEVIEW_Register(void) DECLSPEC_HIDDEN;
278 extern void TREEVIEW_Unregister(void) DECLSPEC_HIDDEN;
279 extern void UPDOWN_Register(void) DECLSPEC_HIDDEN;
280 extern void UPDOWN_Unregister(void) DECLSPEC_HIDDEN;
281 #ifdef __REACTOS__
282 extern void BUTTON_Unregister(void) DECLSPEC_HIDDEN;
283 extern void COMBO_Unregister(void) DECLSPEC_HIDDEN;
284 extern void COMBOLBOX_Unregister(void) DECLSPEC_HIDDEN;
285 extern void EDIT_Unregister(void) DECLSPEC_HIDDEN;
286 extern void LISTBOX_Unregister(void) DECLSPEC_HIDDEN;
287 extern void STATIC_Unregister(void) DECLSPEC_HIDDEN;
288 extern void TOOLBARv6_Register(void) DECLSPEC_HIDDEN;
289 extern void TOOLBARv6_Unregister(void) DECLSPEC_HIDDEN;
290 #endif /* __REACTOS__ */
291 
292 int MONTHCAL_MonthLength(int month, int year) DECLSPEC_HIDDEN;
293 int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace) DECLSPEC_HIDDEN;
294 LONG MONTHCAL_CompareSystemTime(const SYSTEMTIME *first, const SYSTEMTIME *second) DECLSPEC_HIDDEN;
295 #ifdef __REACTOS__
296 extern void THEMING_Initialize(HANDLE hActCtx5, HANDLE hActCtx6) DECLSPEC_HIDDEN;
297 #else
298 extern void THEMING_Initialize(void) DECLSPEC_HIDDEN;
299 #endif
300 extern void THEMING_Uninitialize(void) DECLSPEC_HIDDEN;
301 extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN;
302 extern void THEMING_SetSubclassData(HWND, ULONG_PTR) DECLSPEC_HIDDEN;
303 
304 #endif  /* __WINE_COMCTL32_H */
305