Solaris C/C++ compile fix.
[wine] / include / commctrl.h
1 /*
2  * Common controls definitions
3  */
4
5 #ifndef __WINE_COMMCTRL_H
6 #define __WINE_COMMCTRL_H
7
8 #include "windef.h"
9 #include "winbase.h"
10 #include "winuser.h"
11 #include "imagelist.h"
12 #include "prsht.h"
13
14 /* c++ likes nameless unions whereas c doesnt */
15 /* (used in property sheet structures)        */
16 #if defined(__cplusplus) && !defined(NONAMELESSUNION)
17 #define DUMMYUNIONNAME
18 #define DUMMYUNIONNAME1
19 #define DUMMYUNIONNAME2
20 #define DUMMYUNIONNAME3
21 #define DUMMYUNIONNAME4
22 #define DUMMYUNIONNAME5
23 #else /* defined(__cplusplus) && !defined(NONAMELESSUNION) */
24 #define DUMMYUNIONNAME   u
25 #define DUMMYUNIONNAME1  u1
26 #define DUMMYUNIONNAME2  u2
27 #define DUMMYUNIONNAME3  u3
28 #define DUMMYUNIONNAME4  u4
29 #define DUMMYUNIONNAME5  u5
30 #endif /* defined(__cplusplus) && !defined(NONAMELESSUNION) */
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 BOOL WINAPI ShowHideMenuCtl (HWND, UINT, LPINT);
37 VOID WINAPI GetEffectiveClientRect (HWND, LPRECT, LPINT);
38 VOID WINAPI InitCommonControls (VOID);
39
40 typedef struct tagINITCOMMONCONTROLSEX {
41     DWORD dwSize;
42     DWORD dwICC;
43 } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
44
45 BOOL WINAPI InitCommonControlsEx (LPINITCOMMONCONTROLSEX);
46
47 #define ICC_LISTVIEW_CLASSES   0x00000001  /* listview, header */
48 #define ICC_TREEVIEW_CLASSES   0x00000002  /* treeview, tooltips */
49 #define ICC_BAR_CLASSES        0x00000004  /* toolbar, statusbar, trackbar, tooltips */
50 #define ICC_TAB_CLASSES        0x00000008  /* tab, tooltips */
51 #define ICC_UPDOWN_CLASS       0x00000010  /* updown */
52 #define ICC_PROGRESS_CLASS     0x00000020  /* progress */
53 #define ICC_HOTKEY_CLASS       0x00000040  /* hotkey */
54 #define ICC_ANIMATE_CLASS      0x00000080  /* animate */
55 #define ICC_WIN95_CLASSES      0x000000FF
56 #define ICC_DATE_CLASSES       0x00000100  /* month picker, date picker, time picker, updown */
57 #define ICC_USEREX_CLASSES     0x00000200  /* comboex */
58 #define ICC_COOL_CLASSES       0x00000400  /* rebar (coolbar) */
59 #define ICC_INTERNET_CLASSES   0x00000800  /* IP address, ... */
60 #define ICC_PAGESCROLLER_CLASS 0x00001000  /* page scroller */
61 #define ICC_NATIVEFNTCTL_CLASS 0x00002000  /* native font control ???*/
62
63
64 /* common control styles */
65 #define CCS_TOP             0x00000001L
66 #define CCS_NOMOVEY         0x00000002L
67 #define CCS_BOTTOM          0x00000003L
68 #define CCS_NORESIZE        0x00000004L
69 #define CCS_NOPARENTALIGN   0x00000008L
70 #define CCS_ADJUSTABLE      0x00000020L
71 #define CCS_NODIVIDER       0x00000040L
72 #define CCS_VERT            0x00000080L
73 #define CCS_LEFT            (CCS_VERT|CCS_TOP)
74 #define CCS_RIGHT           (CCS_VERT|CCS_BOTTOM)
75 #define CCS_NOMOVEX         (CCS_VERT|CCS_NOMOVEY)
76
77
78 /* common control shared messages */
79 #define CCM_FIRST            0x2000
80
81 #define CCM_SETBKCOLOR       (CCM_FIRST+1)     /* lParam = bkColor */
82 #define CCM_SETCOLORSCHEME   (CCM_FIRST+2)
83 #define CCM_GETCOLORSCHEME   (CCM_FIRST+3)
84 #define CCM_GETDROPTARGET    (CCM_FIRST+4)
85 #define CCM_SETUNICODEFORMAT (CCM_FIRST+5)
86 #define CCM_GETUNICODEFORMAT (CCM_FIRST+6)
87
88
89 /* common notification codes (WM_NOTIFY)*/
90 #define NM_FIRST                (0U-  0U)
91 #define NM_LAST                 (0U- 99U)
92 #define NM_OUTOFMEMORY          (NM_FIRST-1)
93 #define NM_CLICK                (NM_FIRST-2)
94 #define NM_DBLCLK               (NM_FIRST-3)
95 #define NM_RETURN               (NM_FIRST-4)
96 #define NM_RCLICK               (NM_FIRST-5)
97 #define NM_RDBLCLK              (NM_FIRST-6)
98 #define NM_SETFOCUS             (NM_FIRST-7)
99 #define NM_KILLFOCUS            (NM_FIRST-8)
100 #define NM_CUSTOMDRAW           (NM_FIRST-12)
101 #define NM_HOVER                (NM_FIRST-13)
102 #define NM_NCHITTEST            (NM_FIRST-14)
103 #define NM_KEYDOWN              (NM_FIRST-15)
104 #define NM_RELEASEDCAPTURE      (NM_FIRST-16)
105 #define NM_SETCURSOR            (NM_FIRST-17)
106 #define NM_CHAR                 (NM_FIRST-18)
107 #define NM_TOOLTIPSCREATED      (NM_FIRST-19)
108 #define NM_UPDOWN                NMUPDOWN
109
110 /* callback constants */
111 #define LPSTR_TEXTCALLBACKA    ((LPSTR)-1L)
112 #define LPSTR_TEXTCALLBACKW    ((LPWSTR)-1L)
113 #define LPSTR_TEXTCALLBACK WINELIB_NAME_AW(LPSTR_TEXTCALLBACK)
114
115 #define I_IMAGECALLBACK          (-1)
116 #define I_INDENTCALLBACK         (-1)
117 #define I_CHILDRENCALLBACK       (-1)
118
119
120 /* owner drawn types */
121 #define ODT_HEADER      100
122 #define ODT_TAB         101
123 #define ODT_LISTVIEW    102
124
125 /* common notification structures */
126 typedef struct tagNMTOOLTIPSCREATED
127 {
128     NMHDR  hdr;
129     HWND hwndToolTips;
130 } NMTOOLTIPSCREATED, *LPNMTOOLTIPSCREATED;
131
132
133 #ifndef CCSIZEOF_STRUCT
134 #define CCSIZEOF_STRUCT(name, member) \
135     (((INT)((LPBYTE)(&((name*)0)->member)-((LPBYTE)((name*)0))))+ \
136     sizeof(((name*)0)->member))
137 #endif
138
139
140 /* This is only for Winelib applications. DON't use it wine itself!!! */
141 #define SNDMSG WINELIB_NAME_AW(SendMessage)
142
143
144
145 /* Custom Draw messages */
146
147 #define CDRF_DODEFAULT          0x0
148 #define CDRF_NEWFONT            0x00000002
149 #define CDRF_SKIPDEFAULT        0x00000004
150 #define CDRF_NOTIFYPOSTPAINT    0x00000010
151 #define CDRF_NOTIFYITEMDRAW     0x00000020
152 #define CDRF_NOTIFYSUBITEMDRAW  0x00000020
153 #define CDRF_NOTIFYPOSTERASE    0x00000040
154 #define CDRF_NOTIFYITEMERASE    0x00000080      /*  obsolete ??? */
155
156
157 /* drawstage flags */
158
159 #define CDDS_PREPAINT           1
160 #define CDDS_POSTPAINT          2
161 #define CDDS_PREERASE           3
162 #define CDDS_POSTERASE          4
163
164 #define CDDS_ITEM                               0x00010000
165 #define CDDS_ITEMPREPAINT               (CDDS_ITEM | CDDS_PREPAINT)
166 #define CDDS_ITEMPOSTPAINT              (CDDS_ITEM | CDDS_POSTPAINT)
167 #define CDDS_ITEMPREERASE               (CDDS_ITEM | CDDS_PREERASE)
168 #define CDDS_ITEMPOSTERASE              (CDDS_ITEM | CDDS_POSTERASE)
169 #define CDDS_SUBITEM            0x00020000
170
171 /* itemState flags */
172
173 #define CDIS_SELECTED           0x0001
174 #define CDIS_GRAYED                     0x0002
175 #define CDIS_DISABLED           0x0004
176 #define CDIS_CHECKED            0x0008
177 #define CDIS_FOCUS                      0x0010
178 #define CDIS_DEFAULT            0x0020
179 #define CDIS_HOT                        0x0040
180 #define CDIS_MARKED         0x0080
181 #define CDIS_INDETERMINATE  0x0100
182
183
184 typedef struct tagNMCUSTOMDRAWINFO
185 {
186         NMHDR   hdr;
187         DWORD   dwDrawStage;
188         HDC     hdc;
189         RECT    rc;
190         DWORD   dwItemSpec; 
191         UINT    uItemState;
192         LPARAM  lItemlParam;
193 } NMCUSTOMDRAW, *LPNMCUSTOMDRAW;
194
195 typedef struct tagNMTTCUSTOMDRAW
196 {
197     NMCUSTOMDRAW nmcd;
198     UINT       uDrawFlags;
199 } NMTTCUSTOMDRAW, *LPNMTTCUSTOMDRAW;
200
201
202
203
204 /* StatusWindow */
205
206 #define STATUSCLASSNAME16       "msctls_statusbar"
207 #define STATUSCLASSNAMEA        "msctls_statusbar32"
208 /* Does not work. gcc creates 4 byte wide strings.
209  * #define STATUSCLASSNAME32W   L"msctls_statusbar32"
210  */
211 static const WCHAR      _scn32w[] = {
212 'm','s','c','t','l','s','_','s','t','a','t','u','s','b','a','r','3','2',0
213 };
214 #define STATUSCLASSNAMEW        _scn32w
215 #define STATUSCLASSNAME         WINELIB_NAME_AW(STATUSCLASSNAME)
216
217 #define SBT_NOBORDERS           0x0100
218 #define SBT_POPOUT              0x0200
219 #define SBT_RTLREADING          0x0400  /* not supported */
220 #define SBT_TOOLTIPS            0x0800
221 #define SBT_OWNERDRAW           0x1000
222
223 #define SBARS_SIZEGRIP          0x0100
224
225 #define SB_SETTEXTA             (WM_USER+1)
226 #define SB_SETTEXTW             (WM_USER+11)
227 #define SB_SETTEXT              WINELIB_NAME_AW(SB_SETTEXT)
228 #define SB_GETTEXTA             (WM_USER+2)
229 #define SB_GETTEXTW             (WM_USER+13)
230 #define SB_GETTEXT              WINELIB_NAME_AW(SB_GETTEXT)
231 #define SB_GETTEXTLENGTHA       (WM_USER+3)
232 #define SB_GETTEXTLENGTHW       (WM_USER+12)
233 #define SB_GETTEXTLENGTH        WINELIB_NAME_AW(SB_GETTEXTLENGTH)
234 #define SB_SETPARTS             (WM_USER+4)
235 #define SB_GETPARTS             (WM_USER+6)
236 #define SB_GETBORDERS           (WM_USER+7)
237 #define SB_SETMINHEIGHT         (WM_USER+8)
238 #define SB_SIMPLE               (WM_USER+9)
239 #define SB_GETRECT              (WM_USER+10)
240 #define SB_ISSIMPLE             (WM_USER+14)
241 #define SB_SETICON              (WM_USER+15)
242 #define SB_SETTIPTEXTA  (WM_USER+16)
243 #define SB_SETTIPTEXTW  (WM_USER+17)
244 #define SB_SETTIPTEXT           WINELIB_NAME_AW(SB_SETTIPTEXT)
245 #define SB_GETTIPTEXTA  (WM_USER+18)
246 #define SB_GETTIPTEXTW  (WM_USER+19)
247 #define SB_GETTIPTEXT           WINELIB_NAME_AW(SB_GETTIPTEXT)
248 #define SB_GETICON              (WM_USER+20)
249 #define SB_SETBKCOLOR           CCM_SETBKCOLOR   /* lParam = bkColor */
250 #define SB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
251 #define SB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
252
253 #define SBN_FIRST               (0U-880U)
254 #define SBN_LAST                (0U-899U)
255 #define SBN_SIMPLEMODECHANGE    (SBN_FIRST-0)
256
257 HWND WINAPI CreateStatusWindowA (INT, LPCSTR, HWND, UINT);
258 HWND WINAPI CreateStatusWindowW (INT, LPCWSTR, HWND, UINT);
259 #define CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow)
260 VOID WINAPI DrawStatusTextA (HDC, LPRECT, LPCSTR, UINT);
261 VOID WINAPI DrawStatusTextW (HDC, LPRECT, LPCWSTR, UINT);
262 #define DrawStatusText WINELIB_NAME_AW(DrawStatusText)
263 VOID WINAPI MenuHelp (UINT, WPARAM, LPARAM, HMENU,
264                       HINSTANCE, HWND, LPUINT);
265
266 /**************************************************************************
267  *  Drag List control
268  */
269
270 typedef struct tagDRAGLISTINFO
271 {
272     UINT  uNotification;
273     HWND  hWnd;
274     POINT ptCursor;
275 } DRAGLISTINFO, *LPDRAGLISTINFO;
276
277 #define DL_BEGINDRAG            (WM_USER+133)
278 #define DL_DRAGGING             (WM_USER+134)
279 #define DL_DROPPED              (WM_USER+135)
280 #define DL_CANCELDRAG           (WM_USER+136)
281
282 #define DL_CURSORSET            0
283 #define DL_STOPCURSOR           1
284 #define DL_COPYCURSOR           2
285 #define DL_MOVECURSOR           3
286
287 #define DRAGLISTMSGSTRING       TEXT("commctrl_DragListMsg")
288
289 BOOL WINAPI MakeDragList (HWND);
290 VOID   WINAPI DrawInsert (HWND, HWND, INT);
291 INT  WINAPI LBItemFromPt (HWND, POINT, BOOL);
292
293   
294 /* UpDown */
295
296 #define UPDOWN_CLASS16          "msctls_updown"
297 #define UPDOWN_CLASSA         "msctls_updown32"
298 #define UPDOWN_CLASSW         L"msctls_updown32"
299 #define UPDOWN_CLASS            WINELIB_NAME_AW(UPDOWN_CLASS)
300
301 typedef struct tagUDACCEL
302 {
303     UINT nSec;
304     UINT nInc;
305 } UDACCEL;
306
307 #define UD_MAXVAL          0x7fff
308 #define UD_MINVAL          0x8001
309
310 #define UDS_WRAP           0x0001
311 #define UDS_SETBUDDYINT    0x0002
312 #define UDS_ALIGNRIGHT     0x0004
313 #define UDS_ALIGNLEFT      0x0008
314 #define UDS_AUTOBUDDY      0x0010
315 #define UDS_ARROWKEYS      0x0020
316 #define UDS_HORZ           0x0040
317 #define UDS_NOTHOUSANDS    0x0080
318
319 #define UDN_FIRST          (0U-721)
320 #define UDN_LAST           (0U-740)
321 #define UDN_DELTAPOS       (UDN_FIRST-1)
322
323 #define UDM_SETRANGE       (WM_USER+101)
324 #define UDM_GETRANGE       (WM_USER+102)
325 #define UDM_SETPOS         (WM_USER+103)
326 #define UDM_GETPOS         (WM_USER+104)
327 #define UDM_SETBUDDY       (WM_USER+105)
328 #define UDM_GETBUDDY       (WM_USER+106)
329 #define UDM_SETACCEL       (WM_USER+107)
330 #define UDM_GETACCEL       (WM_USER+108)
331 #define UDM_SETBASE        (WM_USER+109)
332 #define UDM_GETBASE        (WM_USER+110)
333 #define UDM_SETRANGE32     (WM_USER+111)
334 #define UDM_GETRANGE32     (WM_USER+112)
335
336 HWND WINAPI CreateUpDownControl (DWORD, INT, INT, INT, INT,
337                                    HWND, INT, HINSTANCE, HWND,
338                                    INT, INT, INT);
339
340 /* Progress Bar */
341
342 #define PROGRESS_CLASSA   "msctls_progress32"
343 #define PROGRESS_CLASSW  L"msctls_progress32"
344 #define PROGRESS_CLASS16    "msctls_progress"
345 #define PROGRESS_CLASS      WINELIB_NAME_AW(PROGRESS_CLASS)
346
347 #define PBM_SETRANGE        (WM_USER+1)
348 #define PBM_SETPOS          (WM_USER+2)
349 #define PBM_DELTAPOS        (WM_USER+3)
350 #define PBM_SETSTEP         (WM_USER+4)
351 #define PBM_STEPIT          (WM_USER+5)
352 #define PBM_SETRANGE32      (WM_USER+6)
353 #define PBM_GETRANGE        (WM_USER+7)
354 #define PBM_GETPOS          (WM_USER+8)
355 #define PBM_SETBARCOLOR     (WM_USER+9)
356 #define PBM_SETBKCOLOR      CCM_SETBKCOLOR
357
358 #define PBS_SMOOTH          0x01
359 #define PBS_VERTICAL        0x04
360
361 typedef struct
362 {
363     INT iLow;
364     INT iHigh;
365 } PBRANGE, *PPBRANGE;
366
367
368 /* ImageList */
369 /*
370 #if !defined(__WINE__) || !defined(__WINE_IMAGELIST_C)
371 struct _IMAGELIST;
372 typedef struct _IMAGELIST *HIMAGELIST;
373 #endif */  /* __WINE__ */
374
375 #define CLR_NONE         0xFFFFFFFF
376 #define CLR_DEFAULT      0xFF000000
377 #define CLR_HILIGHT      CLR_DEFAULT
378
379 #define ILC_MASK         0x0001
380 #define ILC_COLOR        0x0000
381 #define ILC_COLORDDB     0x00FE
382 #define ILC_COLOR4       0x0004
383 #define ILC_COLOR8       0x0008
384 #define ILC_COLOR16      0x0010
385 #define ILC_COLOR24      0x0018
386 #define ILC_COLOR32      0x0020
387 #define ILC_PALETTE      0x0800  /* no longer supported by M$ */
388
389 #define ILD_NORMAL       0x0000
390 #define ILD_TRANSPARENT  0x0001
391 #define ILD_BLEND25      0x0002
392 #define ILD_BLEND50      0x0004
393 #define ILD_MASK         0x0010
394 #define ILD_IMAGE        0x0020
395 #define ILD_ROP          0x0040
396 #define ILD_OVERLAYMASK  0x0F00
397
398 #define ILD_SELECTED     ILD_BLEND50
399 #define ILD_FOCUS        ILD_BLEND25
400 #define ILD_BLEND        ILD_BLEND50
401
402 #define INDEXTOOVERLAYMASK(i)  ((i)<<8)
403
404 #define ILCF_MOVE        (0x00000000)
405 #define ILCF_SWAP        (0x00000001)
406
407
408 typedef struct _IMAGEINFO
409 {
410     HBITMAP hbmImage;
411     HBITMAP hbmMask;
412     INT     Unused1;
413     INT     Unused2;
414     RECT    rcImage;
415 } IMAGEINFO;
416
417
418 typedef struct _IMAGELISTDRAWPARAMS
419 {
420     DWORD       cbSize;
421     HIMAGELIST  himl;
422     INT       i;
423     HDC       hdcDst;
424     INT       x;
425     INT       y;
426     INT       cx;
427     INT       cy;
428     INT       xBitmap;  /* x offest from the upperleft of bitmap */
429     INT       yBitmap;  /* y offset from the upperleft of bitmap */
430     COLORREF    rgbBk;
431     COLORREF    rgbFg;
432     UINT      fStyle;
433     DWORD       dwRop;
434 } IMAGELISTDRAWPARAMS, *LPIMAGELISTDRAWPARAMS;
435
436  
437 INT      WINAPI ImageList_Add(HIMAGELIST,HBITMAP,HBITMAP);
438 INT      WINAPI ImageList_AddIcon (HIMAGELIST, HICON);
439 INT      WINAPI ImageList_AddMasked(HIMAGELIST,HBITMAP,COLORREF);
440 BOOL     WINAPI ImageList_BeginDrag(HIMAGELIST,INT,INT,INT);
441 BOOL     WINAPI ImageList_Copy(HIMAGELIST,INT,HIMAGELIST,INT,INT);
442 HIMAGELIST WINAPI ImageList_Create(INT,INT,UINT,INT,INT);
443 BOOL     WINAPI ImageList_Destroy(HIMAGELIST);
444 BOOL     WINAPI ImageList_DragEnter(HWND,INT,INT);
445 BOOL     WINAPI ImageList_DragLeave(HWND); 
446 BOOL     WINAPI ImageList_DragMove(INT,INT);
447 BOOL     WINAPI ImageList_DragShowNolock (BOOL);
448 BOOL     WINAPI ImageList_Draw(HIMAGELIST,INT,HDC,INT,INT,UINT);
449 BOOL     WINAPI ImageList_DrawEx(HIMAGELIST,INT,HDC,INT,INT,INT,
450                                    INT,COLORREF,COLORREF,UINT);
451 BOOL     WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS*); 
452 HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST);
453 BOOL     WINAPI ImageList_EndDrag(VOID);
454 COLORREF   WINAPI ImageList_GetBkColor(HIMAGELIST);
455 HIMAGELIST WINAPI ImageList_GetDragImage(POINT*,POINT*);
456 HICON    WINAPI ImageList_GetIcon(HIMAGELIST,INT,UINT);
457 BOOL     WINAPI ImageList_GetIconSize(HIMAGELIST,INT*,INT*);
458 INT      WINAPI ImageList_GetImageCount(HIMAGELIST);
459 BOOL     WINAPI ImageList_GetImageInfo(HIMAGELIST,INT,IMAGEINFO*);
460 BOOL     WINAPI ImageList_GetImageRect(HIMAGELIST,INT,LPRECT);
461 HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE,LPCSTR,INT,INT,
462                                          COLORREF,UINT,UINT);
463 HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE,LPCWSTR,INT,INT,
464                                          COLORREF,UINT,UINT);
465 #define    ImageList_LoadImage WINELIB_NAME_AW(ImageList_LoadImage)
466 HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST,INT,HIMAGELIST,INT,INT,INT);
467 #ifdef __IStream_INTREFACE_DEFINED__
468 HIMAGELIST WINAPI ImageList_Read(LPSTREAM);
469 #endif
470 BOOL     WINAPI ImageList_Remove(HIMAGELIST,INT);
471 BOOL     WINAPI ImageList_Replace(HIMAGELIST,INT,HBITMAP,HBITMAP);
472 INT      WINAPI ImageList_ReplaceIcon(HIMAGELIST,INT,HICON);
473 COLORREF   WINAPI ImageList_SetBkColor(HIMAGELIST,COLORREF);
474 BOOL     WINAPI ImageList_SetDragCursorImage(HIMAGELIST,INT,INT,INT);
475
476 BOOL     WINAPI ImageList_SetIconSize(HIMAGELIST,INT,INT);
477 BOOL     WINAPI ImageList_SetImageCount(HIMAGELIST,INT);
478 BOOL     WINAPI ImageList_SetOverlayImage(HIMAGELIST,INT,INT);
479 #ifdef __IStream_INTREFACE_DEFINED__
480 BOOL     WINAPI ImageList_Write(HIMAGELIST, LPSTREAM);
481 #endif
482
483 #ifndef __WINE__
484 #define ImageList_AddIcon(himl,hicon) ImageList_ReplaceIcon(himl,-1,hicon)
485 #endif
486 #define ImageList_ExtractIcon(hi,himl,i) ImageList_GetIcon(himl,i,0)
487 #define ImageList_LoadBitmap(hi,lpbmp,cx,cGrow,crMask) \
488   ImageList_LoadImage(hi,lpbmp,cx,cGrow,crMask,IMAGE_BITMAP,0)
489 #define ImageList_RemoveAll(himl) ImageList_Remove(himl,-1)
490
491
492 /* Flat Scrollbar control */
493
494 #define FLATSB_CLASS16        "flatsb_class"
495 #define FLATSB_CLASSA       "flatsb_class32"
496 #define FLATSB_CLASSW       L"flatsb_class32"
497 #define FLATSB_CLASS          WINELIB_NAME_AW(FLATSB_CLASS)
498
499 #define WSB_PROP_CYVSCROLL     0x00000001L
500 #define WSB_PROP_CXHSCROLL     0x00000002L
501 #define WSB_PROP_CYHSCROLL     0x00000004L
502 #define WSB_PROP_CXVSCROLL     0x00000008L
503 #define WSB_PROP_CXHTHUMB      0x00000010L
504 #define WSB_PROP_CYVTHUMB      0x00000020L
505 #define WSB_PROP_VBKGCOLOR     0x00000040L
506 #define WSB_PROP_HBKGCOLOR     0x00000080L
507 #define WSB_PROP_VSTYLE        0x00000100L
508 #define WSB_PROP_HSTYLE        0x00000200L
509 #define WSB_PROP_WINSTYLE      0x00000400L
510 #define WSB_PROP_PALETTE       0x00000800L
511 #define WSB_PROP_MASK          0x00000FFFL
512
513 #define FSB_REGULAR_MODE       0
514 #define FSB_ENCARTA_MODE       1
515 #define FSB_FLAT_MODE          2
516
517
518 BOOL  WINAPI FlatSB_EnableScrollBar(HWND, INT, UINT);
519 BOOL  WINAPI FlatSB_ShowScrollBar(HWND, INT, BOOL);
520 BOOL  WINAPI FlatSB_GetScrollRange(HWND, INT, LPINT, LPINT);
521 BOOL  WINAPI FlatSB_GetScrollInfo(HWND, INT, LPSCROLLINFO);
522 INT   WINAPI FlatSB_GetScrollPos(HWND, INT);
523 BOOL  WINAPI FlatSB_GetScrollProp(HWND, INT, LPINT);
524 INT   WINAPI FlatSB_SetScrollPos(HWND, INT, INT, BOOL);
525 INT   WINAPI FlatSB_SetScrollInfo(HWND, INT, LPSCROLLINFO, BOOL);
526 INT   WINAPI FlatSB_SetScrollRange(HWND, INT, INT, INT, BOOL);
527 BOOL  WINAPI FlatSB_SetScrollProp(HWND, UINT, INT, BOOL);
528 BOOL  WINAPI InitializeFlatSB(HWND);
529 HRESULT WINAPI UninitializeFlatSB(HWND);
530
531
532 /* Header control */
533
534 #define WC_HEADER16             "SysHeader" 
535 #define WC_HEADERA              "SysHeader32" 
536 #define WC_HEADERW              L"SysHeader32" 
537 #define WC_HEADER               WINELIB_NAME_AW(WC_HEADER)
538  
539 #define HDS_HORZ                0x0000 
540 #define HDS_BUTTONS             0x0002 
541 #define HDS_HOTTRACK            0x0004 
542 #define HDS_HIDDEN              0x0008 
543 #define HDS_DRAGDROP            0x0040 
544 #define HDS_FULLDRAG            0x0080 
545
546 #define HDI_WIDTH               0x0001
547 #define HDI_HEIGHT              HDI_WIDTH
548 #define HDI_TEXT                0x0002
549 #define HDI_FORMAT              0x0004
550 #define HDI_LPARAM              0x0008
551 #define HDI_BITMAP              0x0010
552 #define HDI_IMAGE               0x0020
553 #define HDI_DI_SETITEM          0x0040
554 #define HDI_ORDER               0x0080
555
556 #define HDF_LEFT                0x0000
557 #define HDF_RIGHT               0x0001
558 #define HDF_CENTER              0x0002
559 #define HDF_JUSTIFYMASK         0x0003
560
561 #define HDF_IMAGE               0x0800
562 #define HDF_BITMAP_ON_RIGHT     0x1000
563 #define HDF_BITMAP              0x2000
564 #define HDF_STRING              0x4000
565 #define HDF_OWNERDRAW           0x8000
566
567 #define HHT_NOWHERE             0x0001
568 #define HHT_ONHEADER            0x0002
569 #define HHT_ONDIVIDER           0x0004
570 #define HHT_ONDIVOPEN           0x0008
571 #define HHT_ABOVE               0x0100
572 #define HHT_BELOW               0x0200
573 #define HHT_TORIGHT             0x0400
574 #define HHT_TOLEFT              0x0800
575
576 #define HDM_FIRST               0x1200
577 #define HDM_GETITEMCOUNT        (HDM_FIRST+0)
578 #define HDM_INSERTITEMA       (HDM_FIRST+1)
579 #define HDM_INSERTITEMW       (HDM_FIRST+10)
580 #define HDM_INSERTITEM          WINELIB_NAME_AW(HDM_INSERTITEM)
581 #define HDM_DELETEITEM          (HDM_FIRST+2)
582 #define HDM_GETITEMA          (HDM_FIRST+3)
583 #define HDM_GETITEMW          (HDM_FIRST+11)
584 #define HDM_GETITEM             WINELIB_NAME_AW(HDM_GETITEM)
585 #define HDM_SETITEMA          (HDM_FIRST+4)
586 #define HDM_SETITEMW          (HDM_FIRST+12)
587 #define HDM_SETITEM             WINELIB_NAME_AW(HDM_SETITEM)
588 #define HDM_LAYOUT              (HDM_FIRST+5)
589 #define HDM_HITTEST             (HDM_FIRST+6)
590 #define HDM_GETITEMRECT         (HDM_FIRST+7)
591 #define HDM_SETIMAGELIST        (HDM_FIRST+8)
592 #define HDM_GETIMAGELIST        (HDM_FIRST+9)
593
594 #define HDM_ORDERTOINDEX        (HDM_FIRST+15)
595 #define HDM_CREATEDRAGIMAGE     (HDM_FIRST+16)
596 #define HDM_GETORDERARRAY       (HDM_FIRST+17)
597 #define HDM_SETORDERARRAY       (HDM_FIRST+18)
598 #define HDM_SETHOTDIVIDER       (HDM_FIRST+19)
599 #define HDM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
600 #define HDM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
601
602 #define HDN_FIRST               (0U-300U)
603 #define HDN_LAST                (0U-399U)
604 #define HDN_ITEMCHANGINGA     (HDN_FIRST-0)
605 #define HDN_ITEMCHANGINGW     (HDN_FIRST-20)
606 #define HDN_ITEMCHANGING WINELIB_NAME_AW(HDN_ITEMCHANGING)
607 #define HDN_ITEMCHANGEDA      (HDN_FIRST-1)
608 #define HDN_ITEMCHANGEDW      (HDN_FIRST-21)
609 #define HDN_ITEMCHANGED WINELIB_NAME_AW(HDN_ITEMCHANGED)
610 #define HDN_ITEMCLICKA        (HDN_FIRST-2)
611 #define HDN_ITEMCLICKW        (HDN_FIRST-22)
612 #define HDN_ITEMCLICK WINELIB_NAME_AW(HDN_ITEMCLICK)
613 #define HDN_ITEMDBLCLICKA     (HDN_FIRST-3)
614 #define HDN_ITEMDBLCLICKW     (HDN_FIRST-23)
615 #define HDN_ITEMDBLCLICK WINELIB_NAME_AW(HDN_ITEMDBLCLICK)
616 #define HDN_DIVIDERDBLCLICKA  (HDN_FIRST-5)
617 #define HDN_DIVIDERDBLCLICKW  (HDN_FIRST-25)
618 #define HDN_DIVIDERDBLCLICK WINELIB_NAME_AW(HDN_DIVIDERDBLCLICK)
619 #define HDN_BEGINTRACKA       (HDN_FIRST-6)
620 #define HDN_BEGINTRACKW       (HDN_FIRST-26)
621 #define HDN_BEGINTRACK WINELIB_NAME_AW(HDN_BEGINTRACK)
622 #define HDN_ENDTRACKA         (HDN_FIRST-7)
623 #define HDN_ENDTRACKW         (HDN_FIRST-27)
624 #define HDN_ENDTRACK WINELIB_NAME_AW(HDN_ENDTRACK)
625 #define HDN_TRACKA            (HDN_FIRST-8)
626 #define HDN_TRACKW            (HDN_FIRST-28)
627 #define HDN_TRACK WINELIB_NAME_AW(HDN_TRACK)
628 #define HDN_GETDISPINFOA      (HDN_FIRST-9)
629 #define HDN_GETDISPINFOW      (HDN_FIRST-29)
630 #define HDN_GETDISPINFO WINELIB_NAME_AW(HDN_GETDISPINFO)
631 #define HDN_BEGINDRACK          (HDN_FIRST-10)
632 #define HDN_ENDDRACK            (HDN_FIRST-11)
633
634 typedef struct _HD_LAYOUT
635 {
636     RECT      *prc;
637     WINDOWPOS *pwpos;
638 } HDLAYOUT, *LPHDLAYOUT;
639
640 #define HD_LAYOUT   HDLAYOUT
641
642 typedef struct _HD_ITEMA
643 {
644     UINT    mask;
645     INT     cxy;
646     LPSTR     pszText;
647     HBITMAP hbm;
648     INT     cchTextMax;
649     INT     fmt;
650     LPARAM    lParam;
651     INT     iImage;
652     INT     iOrder;
653 } HDITEMA, *LPHDITEMA;
654
655 typedef struct _HD_ITEMW
656 {
657     UINT    mask;
658     INT     cxy;
659     LPWSTR    pszText;
660     HBITMAP hbm;
661     INT     cchTextMax;
662     INT     fmt;
663     LPARAM    lParam;
664     INT     iImage;
665     INT     iOrder;
666 } HDITEMW, *LPHDITEMW;
667
668 #define HDITEM   WINELIB_NAME_AW(HDITEM)
669 #define LPHDITEM WINELIB_NAME_AW(LPHDITEM)
670 #define HD_ITEM  HDITEM
671
672 #define HDITEM_V1_SIZEA CCSIZEOF_STRUCT(HDITEMA, lParam)
673 #define HDITEM_V1_SIZEW CCSIZEOF_STRUCT(HDITEMW, lParam)
674 #define HDITEM_V1_SIZE WINELIB_NAME_AW(HDITEM_V1_SIZE)
675
676 typedef struct _HD_HITTESTINFO
677 {
678     POINT pt;
679     UINT  flags;
680     INT   iItem;
681 } HDHITTESTINFO, *LPHDHITTESTINFO;
682
683 #define HD_HITTESTINFO   HDHITTESTINFO
684
685 typedef struct tagNMHEADERA
686 {
687     NMHDR     hdr;
688     INT     iItem;
689     INT     iButton;
690     HDITEMA *pitem;
691 } NMHEADERA, *LPNMHEADERA;
692
693 typedef struct tagNMHEADERW
694 {
695     NMHDR     hdr;
696     INT     iItem;
697     INT     iButton;
698     HDITEMW *pitem;
699 } NMHEADERW, *LPNMHEADERW;
700
701 #define NMHEADER                WINELIB_NAME_AW(NMHEADER)
702 #define LPNMHEADER              WINELIB_NAME_AW(LPNMHEADER)
703 #define HD_NOTIFY               NMHEADER
704
705 typedef struct tagNMHDDISPINFOA
706 {
707     NMHDR     hdr;
708     INT     iItem;
709     UINT    mask;
710     LPSTR     pszText;
711     INT     cchTextMax;
712     INT     iImage;
713     LPARAM    lParam;
714 } NMHDDISPINFOA, *LPNMHDDISPINFOA;
715
716 typedef struct tagNMHDDISPINFOW
717 {
718     NMHDR     hdr;
719     INT     iItem;
720     UINT    mask;
721     LPWSTR    pszText;
722     INT     cchTextMax;
723     INT     iImage;
724     LPARAM    lParam;
725 } NMHDDISPINFOW, *LPNMHDDISPINFOW;
726
727 #define NMHDDISPINFO            WINELIB_NAME_AW(NMHDDISPINFO)
728 #define LPNMHDDISPINFO          WINELIB_NAME_AW(LPNMHDDISPINFO)
729
730 #define Header_GetItemCount(hwndHD) \
731   (INT)SendMessageA((hwndHD),HDM_GETITEMCOUNT,0,0L)
732 #define Header_InsertItemA(hwndHD,i,phdi) \
733   (INT)SendMessageA((hwndHD),HDM_INSERTITEMA,(WPARAM)(INT)(i),(LPARAM)(const HDITEMA*)(phdi))
734 #define Header_InsertItemW(hwndHD,i,phdi) \
735   (INT)SendMessageW((hwndHD),HDM_INSERTITEMW,(WPARAM)(INT)(i),(LPARAM)(const HDITEMW*)(phdi))
736 #define Header_InsertItem WINELIB_NAME_AW(Header_InsertItem)
737 #define Header_DeleteItem(hwndHD,i) \
738   (BOOL)SendMessageA((hwndHD),HDM_DELETEITEM,(WPARAM)(INT)(i),0L)
739 #define Header_GetItemA(hwndHD,i,phdi) \
740   (BOOL)SendMessageA((hwndHD),HDM_GETITEMA,(WPARAM)(INT)(i),(LPARAM)(HDITEMA*)(phdi))
741 #define Header_GetItemW(hwndHD,i,phdi) \
742   (BOOL)SendMessageW((hwndHD),HDM_GETITEMW,(WPARAM)(INT)(i),(LPARAM)(HDITEMW*)(phdi))
743 #define Header_GetItem WINELIB_NAME_AW(Header_GetItem)
744 #define Header_SetItemA(hwndHD,i,phdi) \
745   (BOOL)SendMessageA((hwndHD),HDM_SETITEMA,(WPARAM)(INT)(i),(LPARAM)(const HDITEMA*)(phdi))
746 #define Header_SetItemW(hwndHD,i,phdi) \
747   (BOOL)SendMessageW((hwndHD),HDM_SETITEMW,(WPARAM)(INT)(i),(LPARAM)(const HDITEMW*)(phdi))
748 #define Header_SetItem WINELIB_NAME_AW(Header_SetItem)
749 #define Header_Layout(hwndHD,playout) \
750   (BOOL)SendMessageA((hwndHD),HDM_LAYOUT,0,(LPARAM)(LPHDLAYOUT)(playout))
751 #define Header_GetItemRect(hwnd,iItem,lprc) \
752   (BOOL)SendMessageA((hwnd),HDM_GETITEMRECT,(WPARAM)iItem,(LPARAM)lprc)
753 #define Header_SetImageList(hwnd,himl) \
754   (HIMAGELIST)SendMessageA((hwnd),HDM_SETIMAGELIST,0,(LPARAM)himl)
755 #define Header_GetImageList(hwnd) \
756   (HIMAGELIST)SendMessageA((hwnd),HDM_GETIMAGELIST,0,0)
757 #define Header_OrderToIndex(hwnd,i) \
758   (INT)SendMessageA((hwnd),HDM_ORDERTOINDEX,(WPARAM)i,0)
759 #define Header_CreateDragImage(hwnd,i) \
760   (HIMAGELIST)SendMessageA((hwnd),HDM_CREATEDRAGIMAGE,(WPARAM)i,0)
761 #define Header_GetOrderArray(hwnd,iCount,lpi) \
762   (BOOL)SendMessageA((hwnd),HDM_GETORDERARRAY,(WPARAM)iCount,(LPARAM)lpi)
763 #define Header_SetOrderArray(hwnd,iCount,lpi) \
764   (BOOL)SendMessageA((hwnd),HDM_SETORDERARRAY,(WPARAM)iCount,(LPARAM)lpi)
765 #define Header_SetHotDivider(hwnd,fPos,dw) \
766   (INT)SendMessageA((hwnd),HDM_SETHOTDIVIDER,(WPARAM)fPos,(LPARAM)dw)
767 #define Header_SetUnicodeFormat(hwnd,fUnicode) \
768   (BOOL)SendMessageA((hwnd),HDM_SETUNICODEFORMAT,(WPARAM)(fUnicode),0)
769 #define Header_GetUnicodeFormat(hwnd) \
770   (BOOL)SendMessageA((hwnd),HDM_GETUNICODEFORMAT,0,0)
771
772
773 /* Toolbar */
774
775 #define TOOLBARCLASSNAME16      "ToolbarWindow" 
776 #define TOOLBARCLASSNAMEW     "ToolbarWindow32" 
777 #define TOOLBARCLASSNAMEA     "ToolbarWindow32" 
778 #define TOOLBARCLASSNAME WINELIB_NAME_AW(TOOLBARCLASSNAME)
779
780 #define CMB_MASKED              0x02 
781  
782 #define TBSTATE_CHECKED         0x01 
783 #define TBSTATE_PRESSED         0x02 
784 #define TBSTATE_ENABLED         0x04 
785 #define TBSTATE_HIDDEN          0x08 
786 #define TBSTATE_INDETERMINATE   0x10 
787 #define TBSTATE_WRAP            0x20 
788 #define TBSTATE_ELLIPSES        0x40
789 #define TBSTATE_MARKED          0x80 
790  
791 #define TBSTYLE_BUTTON          0x00 
792 #define TBSTYLE_SEP             0x01 
793 #define TBSTYLE_CHECK           0x02 
794 #define TBSTYLE_GROUP           0x04 
795 #define TBSTYLE_CHECKGROUP      (TBSTYLE_GROUP | TBSTYLE_CHECK) 
796 #define TBSTYLE_DROPDOWN        0x08 
797  
798 #define TBSTYLE_TOOLTIPS        0x0100 
799 #define TBSTYLE_WRAPABLE        0x0200 
800 #define TBSTYLE_ALTDRAG         0x0400 
801 #define TBSTYLE_FLAT            0x0800 
802 #define TBSTYLE_LIST            0x1000 
803 #define TBSTYLE_CUSTOMERASE     0x2000 
804
805 #define TBIF_IMAGE              0x00000001
806 #define TBIF_TEXT               0x00000002
807 #define TBIF_STATE              0x00000004
808 #define TBIF_STYLE              0x00000008
809 #define TBIF_LPARAM             0x00000010
810 #define TBIF_COMMAND            0x00000020
811 #define TBIF_SIZE               0x00000040
812
813 #define TBBF_LARGE              0x0001 
814
815 #define TB_ENABLEBUTTON          (WM_USER+1)
816 #define TB_CHECKBUTTON           (WM_USER+2)
817 #define TB_PRESSBUTTON           (WM_USER+3)
818 #define TB_HIDEBUTTON            (WM_USER+4)
819 #define TB_INDETERMINATE         (WM_USER+5)
820 #define TB_ISBUTTONENABLED       (WM_USER+9) 
821 #define TB_ISBUTTONCHECKED       (WM_USER+10) 
822 #define TB_ISBUTTONPRESSED       (WM_USER+11) 
823 #define TB_ISBUTTONHIDDEN        (WM_USER+12) 
824 #define TB_ISBUTTONINDETERMINATE (WM_USER+13)
825 #define TB_ISBUTTONHIGHLIGHTED   (WM_USER+14)
826 #define TB_SETSTATE              (WM_USER+17)
827 #define TB_GETSTATE              (WM_USER+18)
828 #define TB_ADDBITMAP             (WM_USER+19)
829 #define TB_ADDBUTTONSA         (WM_USER+20)
830 #define TB_ADDBUTTONSW         (WM_USER+68)
831 #define TB_ADDBUTTONS WINELIB_NAME_AW(TB_ADDBUTTONS)
832 #define TB_HITTEST               (WM_USER+69)
833 #define TB_INSERTBUTTONA       (WM_USER+21)
834 #define TB_INSERTBUTTONW       (WM_USER+67)
835 #define TB_INSERTBUTTON WINELIB_NAME_AW(TB_INSERTBUTTON)
836 #define TB_DELETEBUTTON          (WM_USER+22)
837 #define TB_GETBUTTON             (WM_USER+23)
838 #define TB_BUTTONCOUNT           (WM_USER+24)
839 #define TB_COMMANDTOINDEX        (WM_USER+25)
840 #define TB_SAVERESTOREA        (WM_USER+26)
841 #define TB_SAVERESTOREW        (WM_USER+76)
842 #define TB_SAVERESTORE WINELIB_NAME_AW(TB_SAVERESTORE)
843 #define TB_CUSTOMIZE             (WM_USER+27)
844 #define TB_ADDSTRINGA          (WM_USER+28) 
845 #define TB_ADDSTRINGW          (WM_USER+77) 
846 #define TB_ADDSTRING WINELIB_NAME_AW(TB_ADDSTRING)
847 #define TB_GETITEMRECT           (WM_USER+29)
848 #define TB_BUTTONSTRUCTSIZE      (WM_USER+30)
849 #define TB_SETBUTTONSIZE         (WM_USER+31)
850 #define TB_SETBITMAPSIZE         (WM_USER+32)
851 #define TB_AUTOSIZE              (WM_USER+33)
852 #define TB_GETTOOLTIPS           (WM_USER+35)
853 #define TB_SETTOOLTIPS           (WM_USER+36)
854 #define TB_SETPARENT             (WM_USER+37)
855 #define TB_SETROWS               (WM_USER+39)
856 #define TB_GETROWS               (WM_USER+40)
857 #define TB_GETBITMAPFLAGS        (WM_USER+41)
858 #define TB_SETCMDID              (WM_USER+42)
859 #define TB_CHANGEBITMAP          (WM_USER+43)
860 #define TB_GETBITMAP             (WM_USER+44)
861 #define TB_GETBUTTONTEXTA      (WM_USER+45)
862 #define TB_GETBUTTONTEXTW      (WM_USER+75)
863 #define TB_GETBUTTONTEXT WINELIB_NAME_AW(TB_GETBUTTONTEXT)
864 #define TB_REPLACEBITMAP         (WM_USER+46)
865 #define TB_SETINDENT             (WM_USER+47)
866 #define TB_SETIMAGELIST          (WM_USER+48)
867 #define TB_GETIMAGELIST          (WM_USER+49)
868 #define TB_LOADIMAGES            (WM_USER+50)
869 #define TB_GETRECT               (WM_USER+51) /* wParam is the Cmd instead of index */
870 #define TB_SETHOTIMAGELIST       (WM_USER+52)
871 #define TB_GETHOTIMAGELIST       (WM_USER+53)
872 #define TB_SETDISABLEDIMAGELIST  (WM_USER+54)
873 #define TB_GETDISABLEDIMAGELIST  (WM_USER+55)
874 #define TB_SETSTYLE              (WM_USER+56)
875 #define TB_GETSTYLE              (WM_USER+57)
876 #define TB_GETBUTTONSIZE         (WM_USER+58)
877 #define TB_SETBUTTONWIDTH        (WM_USER+59)
878 #define TB_SETMAXTEXTROWS        (WM_USER+60)
879 #define TB_GETTEXTROWS           (WM_USER+61)
880 #define TB_GETOBJECT             (WM_USER+62)
881 #define TB_GETBUTTONINFOW      (WM_USER+63)
882 #define TB_GETBUTTONINFOA      (WM_USER+65)
883 #define TB_GETBUTTONINFO WINELIB_NAME_AW(TB_GETBUTTONINFO)
884 #define TB_SETBUTTONINFOW      (WM_USER+64)
885 #define TB_SETBUTTONINFOA      (WM_USER+66)
886 #define TB_SETBUTTONINFO WINELIB_NAME_AW(TB_SETBUTTONINFO)
887 #define TB_SETDRAWTEXTFLAGS      (WM_USER+70)
888 #define TB_GETHOTITEM            (WM_USER+71)
889 #define TB_SETHOTITEM            (WM_USER+72)
890 #define TB_SETANCHORHIGHLIGHT    (WM_USER+73)
891 #define TB_GETANCHORHIGHLIGHT    (WM_USER+74)
892 #define TB_MAPACCELERATORA     (WM_USER+78)
893 #define TB_MAPACCELERATORW     (WM_USER+90)
894 #define TB_MAPACCELERATOR WINELIB_NAME_AW(TB_MAPACCELERATOR)
895 #define TB_GETINSERTMARK         (WM_USER+79)
896 #define TB_SETINSERTMARK         (WM_USER+80)
897 #define TB_INSERTMARKHITTEST     (WM_USER+81)
898 #define TB_MOVEBUTTON            (WM_USER+82)
899 #define TB_GETMAXSIZE            (WM_USER+83)
900 #define TB_SETEXTENDEDSTYLE      (WM_USER+84)
901 #define TB_GETEXTENDEDSTYLE      (WM_USER+85)
902 #define TB_GETPADDING            (WM_USER+86)
903 #define TB_SETPADDING            (WM_USER+87)
904 #define TB_SETINSERTMARKCOLOR    (WM_USER+88)
905 #define TB_GETINSERTMARKCOLOR    (WM_USER+89)
906 #define TB_SETCOLORSCHEME        CCM_SETCOLORSCHEME
907 #define TB_GETCOLORSCHEME        CCM_GETCOLORSCHEME
908 #define TB_SETUNICODEFORMAT      CCM_SETUNICODEFORMAT
909 #define TB_GETUNICODEFORMAT      CCM_GETUNICODEFORMAT
910
911 #define TBN_FIRST               (0U-700U)
912 #define TBN_LAST                (0U-720U)
913 #define TBN_GETBUTTONINFOA    (TBN_FIRST-0)
914 #define TBN_GETBUTTONINFOW    (TBN_FIRST-20)
915 #define TBN_GETBUTTONINFO WINELIB_NAME_AW(TBN_GETBUTTONINFO)
916 #define TBN_BEGINDRAG           (TBN_FIRST-1)
917 #define TBN_ENDDRAG             (TBN_FIRST-2)
918 #define TBN_BEGINADJUST         (TBN_FIRST-3)
919 #define TBN_ENDADJUST           (TBN_FIRST-4)
920 #define TBN_RESET               (TBN_FIRST-5)
921 #define TBN_QUERYINSERT         (TBN_FIRST-6)
922 #define TBN_QUERYDELETE         (TBN_FIRST-7)
923 #define TBN_TOOLBARCHANGE       (TBN_FIRST-8)
924 #define TBN_CUSTHELP            (TBN_FIRST-9)
925 #define TBN_DROPDOWN            (TBN_FIRST-10)
926 #define TBN_GETOBJECT           (TBN_FIRST-12)
927 #define TBN_HOTITEMCHANGE       (TBN_FIRST-13)
928 #define TBN_DRAGOUT             (TBN_FIRST-14)
929 #define TBN_DELETINGBUTTON      (TBN_FIRST-15)
930 #define TBN_GETDISPINFOA        (TBN_FIRST-16)
931 #define TBN_GETDISPINFOW        (TBN_FIRST-17)
932 #define TBN_GETDISPINFO         WINELIB_NAME_AW(TBN_GETDISPINFO)
933 #define TBN_GETINFOTIPA       (TBN_FIRST-18)
934 #define TBN_GETINFOTIPW       (TBN_FIRST-19)
935 #define TBN_GETINFOTIP WINELIB_NAME_AW(TBN_GETINFOTIP)
936
937
938 /* This is just for old CreateToolbar. */
939 /* Don't use it in new programs. */
940 typedef struct _OLDTBBUTTON {
941     INT iBitmap;
942     INT idCommand;
943     BYTE  fsState;
944     BYTE  fsStyle;
945     BYTE  bReserved[2];
946     DWORD dwData;
947 } OLDTBBUTTON, *POLDTBBUTTON, *LPOLDTBBUTTON;
948 typedef const OLDTBBUTTON *LPCOLDTBBUTTON;
949
950
951 typedef struct _TBBUTTON {
952     INT iBitmap;
953     INT idCommand;
954     BYTE  fsState;
955     BYTE  fsStyle;
956     BYTE  bReserved[2];
957     DWORD dwData;
958     INT iString;
959 } TBBUTTON, *PTBBUTTON, *LPTBBUTTON;
960 typedef const TBBUTTON *LPCTBBUTTON;
961
962
963 typedef struct _COLORMAP {
964     COLORREF from;
965     COLORREF to;
966 } COLORMAP, *LPCOLORMAP;
967
968 typedef struct tagTBADDBITMAP {
969     HINSTANCE hInst;
970     UINT      nID;
971 } TBADDBITMAP, *LPTBADDBITMAP;
972
973 #define HINST_COMMCTRL         ((HINSTANCE)-1)
974 #define IDB_STD_SMALL_COLOR     0
975 #define IDB_STD_LARGE_COLOR     1
976 #define IDB_VIEW_SMALL_COLOR    4
977 #define IDB_VIEW_LARGE_COLOR    5
978 #define IDB_HIST_SMALL_COLOR    8
979 #define IDB_HIST_LARGE_COLOR    9
980
981 #define STD_CUT                 0
982 #define STD_COPY                1
983 #define STD_PASTE               2
984 #define STD_UNDO                3
985 #define STD_REDOW               4
986 #define STD_DELETE              5
987 #define STD_FILENEW             6
988 #define STD_FILEOPEN            7
989 #define STD_FILESAVE            8
990 #define STD_PRINTPRE            9
991 #define STD_PROPERTIES          10
992 #define STD_HELP                11
993 #define STD_FIND                12
994 #define STD_REPLACE             13
995 #define STD_PRINT               14
996
997 #define VIEW_LARGEICONS         0
998 #define VIEW_SMALLICONS         1
999 #define VIEW_LIST               2
1000 #define VIEW_DETAILS            3
1001 #define VIEW_SORTNAME           4
1002 #define VIEW_SORTSIZE           5
1003 #define VIEW_SORTDATE           6
1004 #define VIEW_SORTTYPE           7
1005 #define VIEW_PARENTFOLDER       8
1006 #define VIEW_NETCONNECT         9
1007 #define VIEW_NETDISCONNECT      10
1008 #define VIEW_NEWFOLDER          11
1009
1010 typedef struct tagTBSAVEPARAMSA {
1011     HKEY   hkr;
1012     LPCSTR pszSubKey;
1013     LPCSTR pszValueName;
1014 } TBSAVEPARAMSA, *LPTBSAVEPARAMSA;
1015
1016 typedef struct tagTBSAVEPARAMSW {
1017     HKEY   hkr;
1018     LPCWSTR pszSubKey;
1019     LPCWSTR pszValueName;
1020 } TBSAVEPARAMSAW, *LPTBSAVEPARAMSAW;
1021
1022 #define TBSAVEPARAMS   WINELIB_NAME_AW(TBSAVEPARAMS)
1023 #define LPTBSAVEPARAMS WINELIB_NAME_AW(LPTBSAVEPARAMS)
1024
1025 typedef struct
1026 {
1027     UINT cbSize;
1028     DWORD  dwMask;
1029     INT  idCommand;
1030     INT  iImage;
1031     BYTE   fsState;
1032     BYTE   fsStyle;
1033     WORD   cx;
1034     DWORD  lParam;
1035     LPSTR  pszText;
1036     INT  cchText;
1037 } TBBUTTONINFOA, *LPTBBUTTONINFOA;
1038
1039 typedef struct
1040 {
1041     UINT cbSize;
1042     DWORD  dwMask;
1043     INT  idCommand;
1044     INT  iImage;
1045     BYTE   fsState;
1046     BYTE   fsStyle;
1047     WORD   cx;
1048     DWORD  lParam;
1049     LPWSTR pszText;
1050     INT  cchText;
1051 } TBBUTTONINFOW, *LPTBBUTTONINFOW;
1052
1053 #define TBBUTTONINFO   WINELIB_NAME_AW(TBBUTTONINFO)
1054 #define LPTBBUTTONINFO WINELIB_NAME_AW(LPTBBUTTONINFO)
1055
1056 typedef struct tagNMTBGETINFOTIPA
1057 {
1058     NMHDR  hdr;
1059     LPSTR  pszText;
1060     INT  cchTextMax;
1061     INT  iItem;
1062     LPARAM lParam;
1063 } NMTBGETINFOTIPA, *LPNMTBGETINFOTIPA;
1064
1065 typedef struct tagNMTBGETINFOTIPW
1066 {
1067     NMHDR  hdr;
1068     LPWSTR pszText;
1069     INT  cchTextMax;
1070     INT  iItem;
1071     LPARAM lParam;
1072 } NMTBGETINFOTIPW, *LPNMTBGETINFOTIPW;
1073
1074 #define NMTBGETINFOTIP   WINELIB_NAME_AW(NMTBGETINFOFTIP)
1075 #define LPNMTBGETINFOTIP WINELIB_NAME_AW(LPNMTBGETINFOTIP)
1076
1077 typedef struct
1078 {
1079         HINSTANCE hInstOld;
1080         UINT      nIDOld;
1081         HINSTANCE hInstNew;
1082         UINT      nIDNew;
1083         INT       nButtons;
1084 } TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
1085
1086 HWND WINAPI
1087 CreateToolbar(HWND, DWORD, UINT, INT, HINSTANCE,
1088               UINT, LPCOLDTBBUTTON, INT); 
1089  
1090 HWND WINAPI
1091 CreateToolbarEx(HWND, DWORD, UINT, INT,
1092                 HINSTANCE, UINT, LPCTBBUTTON, 
1093                 INT, INT, INT, INT, INT, UINT); 
1094
1095 HBITMAP WINAPI
1096 CreateMappedBitmap (HINSTANCE, INT, UINT, LPCOLORMAP, INT); 
1097
1098
1099 /* Tool tips */
1100
1101 #define TOOLTIPS_CLASS16        "tooltips_class"
1102 #define TOOLTIPS_CLASSA       "tooltips_class32"
1103 #define TOOLTIPS_CLASS32W       L"tooltips_class32"
1104 #define TOOLTIPS_CLASS          WINELIB_NAME_AW(TOOLTIPS_CLASS)
1105
1106 #define INFOTIPSIZE             1024
1107  
1108 #define TTS_ALWAYSTIP           0x01
1109 #define TTS_NOPREFIX            0x02
1110
1111 #define TTF_IDISHWND            0x0001
1112 #define TTF_CENTERTIP           0x0002
1113 #define TTF_RTLREADING          0x0004
1114 #define TTF_SUBCLASS            0x0010
1115 #define TTF_TRACK               0x0020
1116 #define TTF_ABSOLUTE            0x0080
1117 #define TTF_TRANSPARENT         0x0100
1118 #define TTF_DI_SETITEM          0x8000  /* valid only on the TTN_NEEDTEXT callback */
1119
1120
1121 #define TTDT_AUTOMATIC          0
1122 #define TTDT_RESHOW             1
1123 #define TTDT_AUTOPOP            2
1124 #define TTDT_INITIAL            3
1125
1126
1127 #define TTM_ACTIVATE            (WM_USER+1)
1128 #define TTM_SETDELAYTIME        (WM_USER+3)
1129 #define TTM_ADDTOOLA          (WM_USER+4)
1130 #define TTM_ADDTOOLW          (WM_USER+50)
1131 #define TTM_ADDTOOL WINELIB_NAME_AW(TTM_ADDTOOL)
1132 #define TTM_DELTOOLA          (WM_USER+5)
1133 #define TTM_DELTOOLW          (WM_USER+51)
1134 #define TTM_DELTOOL WINELIB_NAME_AW(TTM_DELTOOL)
1135 #define TTM_NEWTOOLRECTA      (WM_USER+6)
1136 #define TTM_NEWTOOLRECTW      (WM_USER+52)
1137 #define TTM_NEWTOOLRECT WINELIB_NAME_AW(TTM_NEWTOOLRECT)
1138 #define TTM_RELAYEVENT          (WM_USER+7)
1139 #define TTM_GETTOOLINFOA      (WM_USER+8)
1140 #define TTM_GETTOOLINFOW      (WM_USER+53)
1141 #define TTM_GETTOOLINFO WINELIB_NAME_AW(TTM_GETTOOLINFO)
1142 #define TTM_SETTOOLINFOA      (WM_USER+9)
1143 #define TTM_SETTOOLINFOW      (WM_USER+54)
1144 #define TTM_SETTOOLINFO WINELIB_NAME_AW(TTM_SETTOOLINFO)
1145 #define TTM_HITTESTA          (WM_USER+10)
1146 #define TTM_HITTESTW          (WM_USER+55)
1147 #define TTM_HITTEST WINELIB_NAME_AW(TTM_HITTEST)
1148 #define TTM_GETTEXTA          (WM_USER+11)
1149 #define TTM_GETTEXTW          (WM_USER+56)
1150 #define TTM_GETTEXT WINELIB_NAME_AW(TTM_GETTEXT)
1151 #define TTM_UPDATETIPTEXTA    (WM_USER+12)
1152 #define TTM_UPDATETIPTEXTW    (WM_USER+57)
1153 #define TTM_UPDATETIPTEXT WINELIB_NAME_AW(TTM_UPDATETIPTEXT)
1154 #define TTM_GETTOOLCOUNT        (WM_USER+13)
1155 #define TTM_ENUMTOOLSA        (WM_USER+14)
1156 #define TTM_ENUMTOOLSW        (WM_USER+58)
1157 #define TTM_ENUMTOOLS WINELIB_NAME_AW(TTM_ENUMTOOLS)
1158 #define TTM_GETCURRENTTOOLA   (WM_USER+15)
1159 #define TTM_GETCURRENTTOOLW   (WM_USER+59)
1160 #define TTM_GETCURRENTTOOL WINELIB_NAME_AW(TTM_GETCURRENTTOOL)
1161 #define TTM_WINDOWFROMPOINT     (WM_USER+16)
1162 #define TTM_TRACKACTIVATE       (WM_USER+17)
1163 #define TTM_TRACKPOSITION       (WM_USER+18)
1164 #define TTM_SETTIPBKCOLOR       (WM_USER+19)
1165 #define TTM_SETTIPTEXTCOLOR     (WM_USER+20)
1166 #define TTM_GETDELAYTIME        (WM_USER+21)
1167 #define TTM_GETTIPBKCOLOR       (WM_USER+22)
1168 #define TTM_GETTIPTEXTCOLOR     (WM_USER+23)
1169 #define TTM_SETMAXTIPWIDTH      (WM_USER+24)
1170 #define TTM_GETMAXTIPWIDTH      (WM_USER+25)
1171 #define TTM_SETMARGIN           (WM_USER+26)
1172 #define TTM_GETMARGIN           (WM_USER+27)
1173 #define TTM_POP                 (WM_USER+28)
1174 #define TTM_UPDATE              (WM_USER+29)
1175
1176
1177 #define TTN_FIRST               (0U-520U)
1178 #define TTN_LAST                (0U-549U)
1179 #define TTN_GETDISPINFOA      (TTN_FIRST-0)
1180 #define TTN_GETDISPINFOW      (TTN_FIRST-10)
1181 #define TTN_GETDISPINFO WINELIB_NAME_AW(TTN_GETDISPINFO)
1182 #define TTN_SHOW                (TTN_FIRST-1)
1183 #define TTN_POP                 (TTN_FIRST-2)
1184
1185 #define TTN_NEEDTEXT TTN_GETDISPINFO
1186 #define TTN_NEEDTEXTA TTN_GETDISPINFOA
1187 #define TTN_NEEDTEXTW TTN_GETDISPINFOW
1188
1189 typedef struct tagTOOLINFOA {
1190     UINT cbSize;
1191     UINT uFlags;
1192     HWND hwnd;
1193     UINT uId;
1194     RECT rect;
1195     HINSTANCE hinst;
1196     LPSTR lpszText;
1197     LPARAM lParam;
1198 } TTTOOLINFOA, *LPTOOLINFOA, *PTOOLINFOA, *LPTTTOOLINFOA;
1199
1200 typedef struct tagTOOLINFOW {
1201     UINT cbSize;
1202     UINT uFlags;
1203     HWND hwnd;
1204     UINT uId;
1205     RECT rect;
1206     HINSTANCE hinst;
1207     LPWSTR lpszText;
1208     LPARAM lParam;
1209 } TTTOOLINFOW, *LPTOOLINFOW, *PTOOLINFOW, *LPTTTOOLINFOW;
1210
1211 #define TTTOOLINFO WINELIB_NAME_AW(TTTOOLINFO)
1212 #define TOOLINFO WINELIB_NAME_AW(TTTOOLINFO)
1213 #define PTOOLINFO WINELIB_NAME_AW(PTOOLINFO)
1214 #define LPTTTOOLINFO WINELIB_NAME_AW(LPTTTOOLINFO)
1215 #define LPTOOLINFO WINELIB_NAME_AW(LPTOOLINFO)
1216
1217 #define TTTOOLINFO_V1_SIZEA CCSIZEOF_STRUCT(TTTOOLINFOA, lpszText)
1218 #define TTTOOLINFO_V1_SIZEW CCSIZEOF_STRUCT(TTTOOLINFOW, lpszText)
1219 #define TTTOOLINFO_V1_SIZE WINELIB_NAME_AW(TTTOOLINFO_V1_SIZE)
1220
1221 typedef struct _TT_HITTESTINFOA
1222 {
1223     HWND        hwnd;
1224     POINT       pt;
1225     TTTOOLINFOA ti;
1226 } TTHITTESTINFOA, *LPTTHITTESTINFOA;
1227
1228 typedef struct _TT_HITTESTINFOW
1229 {
1230     HWND        hwnd;
1231     POINT       pt;
1232     TTTOOLINFOW ti;
1233 } TTHITTESTINFOW, *LPTTHITTESTINFOW;
1234
1235 #define TTHITTESTINFO WINELIB_NAME_AW(TTHITTESTINFO)
1236 #define LPTTHITTESTINFO WINELIB_NAME_AW(LPTTHITTESTINFO)
1237
1238 typedef struct tagNMTTDISPINFOA
1239 {
1240     NMHDR hdr;
1241     LPSTR lpszText;
1242     CHAR  szText[80];
1243     HINSTANCE hinst;
1244     UINT      uFlags;
1245     LPARAM      lParam;
1246 } NMTTDISPINFOA, *LPNMTTDISPINFOA;
1247
1248 typedef struct tagNMTTDISPINFOW
1249 {
1250     NMHDR       hdr;
1251     LPWSTR      lpszText;
1252     WCHAR       szText[80];
1253     HINSTANCE hinst;
1254     UINT      uFlags;
1255     LPARAM      lParam;
1256 } NMTTDISPINFOW, *LPNMTTDISPINFOW;
1257
1258 #define NMTTDISPINFO WINELIB_NAME_AW(NMTTDISPINFO)
1259 #define LPNMTTDISPINFO WINELIB_NAME_AW(LPNMTTDISPINFO)
1260
1261 #define NMTTDISPINFO_V1_SIZEA CCSIZEOF_STRUCT(NMTTDISPINFOA, uFlags)
1262 #define NMTTDISPINFO_V1_SIZEW CCSIZEOF_STRUCT(NMTTDISPINFOW, uFlags)
1263 #define NMTTDISPINFO_V1_SIZE WINELIB_NAME_AW(NMTTDISPINFO_V1_SIZE)
1264
1265 #define TOOLTIPTEXTW    NMTTDISPINFOW
1266 #define TOOLTIPTEXTA    NMTTDISPINFOA
1267 #define TOOLTIPTEXT     NMTTDISPINFO
1268 #define LPTOOLTIPTEXTW  LPNMTTDISPINFOW
1269 #define LPTOOLTIPTEXTA  LPNMTTDISPINFOA
1270 #define LPTOOLTIPTEXT   LPNMTTDISPINFO
1271
1272
1273 /* Rebar control */
1274
1275 #define REBARCLASSNAME16        "ReBarWindow"
1276 #define REBARCLASSNAMEA       "ReBarWindow32"
1277 #define REBARCLASSNAMEW       L"ReBarWindow32"
1278 #define REBARCLASSNAME          WINELIB_NAME_AW(REBARCLASSNAME)
1279
1280 #define RBS_TOOLTIPS            0x0100
1281 #define RBS_VARHEIGHT           0x0200
1282 #define RBS_BANDBORDERS         0x0400
1283 #define RBS_FIXEDORDER          0x0800
1284 #define RBS_REGISTERDROP        0x1000
1285 #define RBS_AUTOSIZE            0x2000
1286 #define RBS_VERTICALGRIPPER     0x4000
1287 #define RBS_DBLCLKTOGGLE        0x8000
1288
1289 #define RBIM_IMAGELIST          0x00000001
1290
1291 #define RBBIM_STYLE             0x00000001
1292 #define RBBIM_COLORS            0x00000002
1293 #define RBBIM_TEXT              0x00000004
1294 #define RBBIM_IMAGE             0x00000008
1295 #define RBBIM_CHILD             0x00000010
1296 #define RBBIM_CHILDSIZE         0x00000020
1297 #define RBBIM_SIZE              0x00000040
1298 #define RBBIM_BACKGROUND        0x00000080
1299 #define RBBIM_ID                0x00000100
1300 #define RBBIM_IDEALSIZE         0x00000200
1301 #define RBBIM_LPARAM            0x00000400
1302 #define RBBIM_HEADERSIZE        0x00000800
1303
1304 #define RBBS_BREAK              0x00000001
1305 #define RBBS_FIXEDSIZE          0x00000002
1306 #define RBBS_CHILDEDGE          0x00000004
1307 #define RBBS_HIDDEN             0x00000008
1308 #define RBBS_NOVERT             0x00000010
1309 #define RBBS_FIXEDBMP           0x00000020
1310 #define RBBS_VARIABLEHEIGHT     0x00000040
1311 #define RBBS_GRIPPERALWAYS      0x00000080
1312 #define RBBS_NOGRIPPER          0x00000100
1313
1314 #define RBNM_ID                 0x00000001
1315 #define RBNM_STYLE              0x00000002
1316 #define RBNM_LPARAM             0x00000004
1317
1318 #define RBHT_NOWHERE            0x0001
1319 #define RBHT_CAPTION            0x0002
1320 #define RBHT_CLIENT             0x0003
1321 #define RBHT_GRABBER            0x0004
1322
1323 #define RB_INSERTBANDA        (WM_USER+1)
1324 #define RB_INSERTBANDW        (WM_USER+10)
1325 #define RB_INSERTBAND           WINELIB_NAME_AW(RB_INSERTBAND)
1326 #define RB_DELETEBAND           (WM_USER+2)
1327 #define RB_GETBARINFO           (WM_USER+3)
1328 #define RB_SETBARINFO           (WM_USER+4)
1329 #define RB_GETBANDINFO        (WM_USER+5)   /* just for compatibility */
1330 #define RB_SETBANDINFOA       (WM_USER+6)
1331 #define RB_SETBANDINFOW       (WM_USER+11)
1332 #define RB_SETBANDINFO          WINELIB_NAME_AW(RB_SETBANDINFO)
1333 #define RB_SETPARENT            (WM_USER+7)
1334 #define RB_HITTEST              (WM_USER+8)
1335 #define RB_GETRECT              (WM_USER+9)
1336 #define RB_GETBANDCOUNT         (WM_USER+12)
1337 #define RB_GETROWCOUNT          (WM_USER+13)
1338 #define RB_GETROWHEIGHT         (WM_USER+14)
1339 #define RB_IDTOINDEX            (WM_USER+16)
1340 #define RB_GETTOOLTIPS          (WM_USER+17)
1341 #define RB_SETTOOLTIPS          (WM_USER+18)
1342 #define RB_SETBKCOLOR           (WM_USER+19)
1343 #define RB_GETBKCOLOR           (WM_USER+20)
1344 #define RB_SETTEXTCOLOR         (WM_USER+21)
1345 #define RB_GETTEXTCOLOR         (WM_USER+22)
1346 #define RB_SIZETORECT           (WM_USER+23)
1347 #define RB_BEGINDRAG            (WM_USER+24)
1348 #define RB_ENDDRAG              (WM_USER+25)
1349 #define RB_DRAGMOVE             (WM_USER+26)
1350 #define RB_GETBARHEIGHT         (WM_USER+27)
1351 #define RB_GETBANDINFOW       (WM_USER+28)
1352 #define RB_GETBANDINFOA       (WM_USER+29)
1353 #define RB_GETBANDINFO16          WINELIB_NAME_AW(RB_GETBANDINFO16)
1354 #define RB_MINIMIZEBAND         (WM_USER+30)
1355 #define RB_MAXIMIZEBAND         (WM_USER+31)
1356 #define RB_GETBANDBORDERS       (WM_USER+34)
1357 #define RB_SHOWBAND             (WM_USER+35)
1358 #define RB_SETPALETTE           (WM_USER+37)
1359 #define RB_GETPALETTE           (WM_USER+38)
1360 #define RB_MOVEBAND             (WM_USER+39)
1361 #define RB_GETDROPTARGET        CCM_GETDROPTARGET
1362 #define RB_SETCOLORSCHEME       CCM_SETCOLORSCHEME
1363 #define RB_GETCOLORSCHEME       CCM_GETCOLORSCHEME
1364 #define RB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
1365 #define RB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
1366
1367 #define RBN_FIRST               (0U-831U)
1368 #define RBN_LAST                (0U-859U)
1369 #define RBN_HEIGHTCHANGE        (RBN_FIRST-0)
1370 #define RBN_GETOBJECT           (RBN_FIRST-1)
1371 #define RBN_LAYOUTCHANGED       (RBN_FIRST-2)
1372 #define RBN_AUTOSIZE            (RBN_FIRST-3)
1373 #define RBN_BEGINDRAG           (RBN_FIRST-4)
1374 #define RBN_ENDDRAG             (RBN_FIRST-5)
1375 #define RBN_DELETINGBAND        (RBN_FIRST-6)
1376 #define RBN_DELETEDBAND         (RBN_FIRST-7)
1377 #define RBN_CHILDSIZE           (RBN_FIRST-8)
1378
1379 typedef struct tagREBARINFO
1380 {
1381     UINT     cbSize;
1382     UINT     fMask;
1383     HIMAGELIST himl;
1384 } REBARINFO, *LPREBARINFO;
1385
1386 typedef struct tagREBARBANDINFOA
1387 {
1388     UINT    cbSize;
1389     UINT    fMask;
1390     UINT    fStyle;
1391     COLORREF  clrFore;
1392     COLORREF  clrBack;
1393     LPSTR     lpText;
1394     UINT    cch;
1395     INT     iImage;
1396     HWND    hwndChild;
1397     UINT    cxMinChild;
1398     UINT    cyMinChild;
1399     UINT    cx;
1400     HBITMAP hbmBack;
1401     UINT    wID;
1402     UINT    cyChild;
1403     UINT    cyMaxChild;
1404     UINT    cyIntegral;
1405     UINT    cxIdeal;
1406     LPARAM    lParam;
1407     UINT    cxHeader;
1408 } REBARBANDINFOA, *LPREBARBANDINFOA;
1409
1410 typedef REBARBANDINFOA const *LPCREBARBANDINFOA;
1411
1412 typedef struct tagREBARBANDINFOW
1413 {
1414     UINT    cbSize;
1415     UINT    fMask;
1416     UINT    fStyle;
1417     COLORREF  clrFore;
1418     COLORREF  clrBack;
1419     LPWSTR    lpText;
1420     UINT    cch;
1421     INT     iImage;
1422     HWND    hwndChild;
1423     UINT    cxMinChild;
1424     UINT    cyMinChild;
1425     UINT    cx;
1426     HBITMAP hbmBack;
1427     UINT    wID;
1428     UINT    cyChild;
1429     UINT    cyMaxChild;
1430     UINT    cyIntegral;
1431     UINT    cxIdeal;
1432     LPARAM    lParam;
1433     UINT    cxHeader;
1434 } REBARBANDINFOW, *LPREBARBANDINFOW;
1435
1436 typedef REBARBANDINFOW const *LPCREBARBANDINFOW;
1437
1438 #define REBARBANDINFO    WINELIB_NAME_AW(REBARBANDINFO)
1439 #define LPREBARBANDINFO  WINELIB_NAME_AW(LPREBARBANDINFO)
1440 #define LPCREBARBANDINFO WINELIB_NAME_AW(LPCREBARBANDINFO)
1441
1442 #define REBARBANDINFO_V3_SIZEA CCSIZEOF_STRUCT(REBARBANDINFOA, wID)
1443 #define REBARBANDINFO_V3_SIZEW CCSIZEOF_STRUCT(REBARBANDINFOW, wID)
1444 #define REBARBANDINFO_V3_SIZE WINELIB_NAME_AW(REBARBANDINFO_V3_SIZE)
1445
1446 typedef struct tagNMREBARCHILDSIZE
1447 {
1448     NMHDR  hdr;
1449     UINT uBand;
1450     UINT wID;
1451     RECT rcChild;
1452     RECT rcBand;
1453 } NMREBARCHILDSIZE, *LPNMREBARCHILDSIZE;
1454
1455 typedef struct tagNMREBAR
1456 {
1457     NMHDR  hdr;
1458     DWORD  dwMask;
1459     UINT uBand;
1460     UINT fStyle;
1461     UINT wID;
1462     LPARAM lParam;
1463 } NMREBAR, *LPNMREBAR;
1464
1465 typedef struct tagNMRBAUTOSIZE
1466 {
1467     NMHDR hdr;
1468     BOOL fChanged;
1469     RECT rcTarget;
1470     RECT rcActual;
1471 } NMRBAUTOSIZE, *LPNMRBAUTOSIZE;
1472
1473 typedef struct _RB_HITTESTINFO
1474 {
1475     POINT pt;
1476     UINT  flags;
1477     INT   iBand;
1478 } RBHITTESTINFO, *LPRBHITTESTINFO;
1479
1480
1481 /* Trackbar control */
1482
1483 #define TRACKBAR_CLASS16        "msctls_trackbar"
1484 #define TRACKBAR_CLASSA       "msctls_trackbar32"
1485 #define TRACKBAR_CLASSW       L"msctls_trackbar32"
1486 #define TRACKBAR_CLASS  WINELIB_NAME_AW(TRACKBAR_CLASS)
1487
1488 #define TBS_AUTOTICKS           0x0001
1489 #define TBS_VERT                0x0002
1490 #define TBS_HORZ                0x0000
1491 #define TBS_TOP                 0x0004
1492 #define TBS_BOTTOM              0x0000
1493 #define TBS_LEFT                0x0004
1494 #define TBS_RIGHT               0x0000
1495 #define TBS_BOTH                0x0008
1496 #define TBS_NOTICKS             0x0010
1497 #define TBS_ENABLESELRANGE      0x0020
1498 #define TBS_FIXEDLENGTH         0x0040
1499 #define TBS_NOTHUMB             0x0080
1500 #define TBS_TOOLTIPS            0x0100
1501 #define TBS_REVERSED                    0x0200
1502
1503 #define TBTS_TOP                0
1504 #define TBTS_LEFT               1
1505 #define TBTS_BOTTOM             2
1506 #define TBTS_RIGHT              3
1507
1508 #define TB_LINEUP               0
1509 #define TB_LINEDOWN             1
1510 #define TB_PAGEUP               2
1511 #define TB_PAGEDOWN             3
1512 #define TB_THUMBPOSITION        4
1513 #define TB_THUMBTRACK           5
1514 #define TB_TOP                  6
1515 #define TB_BOTTOM               7
1516 #define TB_ENDTRACK             8
1517
1518 #define TBCD_TICS               0x0001
1519 #define TBCD_THUMB              0x0002
1520 #define TBCD_CHANNEL            0x0003
1521
1522 #define TBM_GETPOS              (WM_USER)
1523 #define TBM_GETRANGEMIN         (WM_USER+1)
1524 #define TBM_GETRANGEMAX         (WM_USER+2)
1525 #define TBM_GETTIC              (WM_USER+3)
1526 #define TBM_SETTIC              (WM_USER+4)
1527 #define TBM_SETPOS              (WM_USER+5)
1528 #define TBM_SETRANGE            (WM_USER+6)
1529 #define TBM_SETRANGEMIN         (WM_USER+7)
1530 #define TBM_SETRANGEMAX         (WM_USER+8)
1531 #define TBM_CLEARTICS           (WM_USER+9)
1532 #define TBM_SETSEL              (WM_USER+10)
1533 #define TBM_SETSELSTART         (WM_USER+11)
1534 #define TBM_SETSELEND           (WM_USER+12)
1535 #define TBM_GETPTICS            (WM_USER+14)
1536 #define TBM_GETTICPOS           (WM_USER+15)
1537 #define TBM_GETNUMTICS          (WM_USER+16)
1538 #define TBM_GETSELSTART         (WM_USER+17)
1539 #define TBM_GETSELEND           (WM_USER+18)
1540 #define TBM_CLEARSEL            (WM_USER+19)
1541 #define TBM_SETTICFREQ          (WM_USER+20)
1542 #define TBM_SETPAGESIZE         (WM_USER+21)
1543 #define TBM_GETPAGESIZE         (WM_USER+22)
1544 #define TBM_SETLINESIZE         (WM_USER+23)
1545 #define TBM_GETLINESIZE         (WM_USER+24)
1546 #define TBM_GETTHUMBRECT        (WM_USER+25)
1547 #define TBM_GETCHANNELRECT      (WM_USER+26)
1548 #define TBM_SETTHUMBLENGTH      (WM_USER+27)
1549 #define TBM_GETTHUMBLENGTH      (WM_USER+28)
1550 #define TBM_SETTOOLTIPS         (WM_USER+29)
1551 #define TBM_GETTOOLTIPS         (WM_USER+30)
1552 #define TBM_SETTIPSIDE          (WM_USER+31)
1553 #define TBM_SETBUDDY            (WM_USER+32)
1554 #define TBM_GETBUDDY            (WM_USER+33)
1555 #define TBM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
1556 #define TBM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
1557
1558
1559 /* Pager control */
1560
1561 #define WC_PAGESCROLLERA      "SysPager"
1562 #define WC_PAGESCROLLERW      L"SysPager"
1563 #define WC_PAGESCROLLER  WINELIB_NAME_AW(WC_PAGESCROLLER)
1564
1565 #define PGS_VERT                0x00000000
1566 #define PGS_HORZ                0x00000001
1567 #define PGS_AUTOSCROLL          0x00000002
1568 #define PGS_DRAGNDROP           0x00000004
1569
1570 #define PGF_INVISIBLE           0
1571 #define PGF_NORMAL              1
1572 #define PGF_GRAYED              2
1573 #define PGF_DEPRESSED           4
1574 #define PGF_HOT                 8
1575
1576 #define PGB_TOPORLEFT           0
1577 #define PGB_BOTTOMORRIGHT       1
1578
1579 /* only used with PGN_SCROLL */
1580 #define PGF_SCROLLUP            1
1581 #define PGF_SCROLLDOWN          2
1582 #define PGF_SCROLLLEFT          4
1583 #define PGF_SCROLLRIGHT         8
1584
1585 #define PGK_SHIFT               1
1586 #define PGK_CONTROL             2
1587 #define PGK_MENU                4
1588
1589 /* only used with PGN_CALCSIZE */
1590 #define PGF_CALCWIDTH           1
1591 #define PGF_CALCHEIGHT          2
1592
1593 #define PGM_FIRST               0x1400
1594 #define PGM_SETCHILD            (PGM_FIRST+1)
1595 #define PGM_RECALCSIZE          (PGM_FIRST+2)
1596 #define PGM_FORWARDMOUSE        (PGM_FIRST+3)
1597 #define PGM_SETBKCOLOR          (PGM_FIRST+4)
1598 #define PGM_GETBKCOLOR          (PGM_FIRST+5)
1599 #define PGM_SETBORDER           (PGM_FIRST+6)
1600 #define PGM_GETBORDER           (PGM_FIRST+7)
1601 #define PGM_SETPOS              (PGM_FIRST+8)
1602 #define PGM_GETPOS              (PGM_FIRST+9)
1603 #define PGM_SETBUTTONSIZE       (PGM_FIRST+10)
1604 #define PGM_GETBUTTONSIZE       (PGM_FIRST+11)
1605 #define PGM_GETBUTTONSTATE      (PGM_FIRST+12)
1606 #define PGM_GETDROPTARGET       CCM_GETDROPTARGET
1607
1608 #define PGN_FIRST               (0U-900U)
1609 #define PGN_LAST                (0U-950U)
1610 #define PGN_SCROLL              (PGN_FIRST-1)
1611 #define PGN_CALCSIZE            (PGN_FIRST-2)
1612
1613 typedef struct
1614 {
1615     NMHDR hdr;
1616     WORD  fwKeys;
1617     RECT rcParent;
1618     INT  iDir;
1619     INT  iXpos;
1620     INT  iYpos;
1621     INT  iScroll;
1622 } NMPGSCROLL, *LPNMPGSCROLL;
1623
1624 typedef struct
1625 {
1626     NMHDR hdr;
1627     DWORD dwFlag;
1628     INT iWidth;
1629     INT iHeight;
1630 } NMPGCALCSIZE, *LPNMPGCALCSIZE;
1631
1632
1633 /* Treeview control */
1634
1635 #define WC_TREEVIEWA          "SysTreeView32"
1636 #define WC_TREEVIEWW          L"SysTreeView32"
1637 #define WC_TREEVIEW             WINELIB_NAME_AW(WC_TREEVIEW)
1638
1639 #define TVSIL_NORMAL            0
1640 #define TVSIL_STATE             2
1641
1642 #define TV_FIRST                0x1100
1643 #define TVM_INSERTITEMA       (TV_FIRST+0)
1644 #define TVM_INSERTITEMW       (TV_FIRST+50)
1645 #define TVM_INSERTITEM          WINELIB_NAME_AW(TVM_INSERTITEM)
1646 #define TVM_DELETEITEM          (TV_FIRST+1)
1647 #define TVM_EXPAND              (TV_FIRST+2)
1648 #define TVM_GETITEMRECT         (TV_FIRST+4)
1649 #define TVM_GETCOUNT            (TV_FIRST+5)
1650 #define TVM_GETINDENT           (TV_FIRST+6)
1651 #define TVM_SETINDENT           (TV_FIRST+7)
1652 #define TVM_GETIMAGELIST        (TV_FIRST+8)
1653 #define TVM_SETIMAGELIST        (TV_FIRST+9)
1654 #define TVM_GETNEXTITEM         (TV_FIRST+10)
1655 #define TVM_SELECTITEM          (TV_FIRST+11)
1656 #define TVM_GETITEMA          (TV_FIRST+12)
1657 #define TVM_GETITEMW          (TV_FIRST+62)
1658 #define TVM_GETITEM             WINELIB_NAME_AW(TVM_GETITEM)
1659 #define TVM_SETITEMA          (TV_FIRST+13)
1660 #define TVM_SETITEMW          (TV_FIRST+63)
1661 #define TVM_SETITEM             WINELIB_NAME_AW(TVM_SETITEM)
1662 #define TVM_EDITLABELA        (TV_FIRST+14)
1663 #define TVM_EDITLABELW        (TV_FIRST+65)
1664 #define TVM_EDITLABEL           WINELIB_NAME_AW(TVM_EDITLABEL)
1665 #define TVM_GETEDITCONTROL      (TV_FIRST+15)
1666 #define TVM_GETVISIBLECOUNT     (TV_FIRST+16)
1667 #define TVM_HITTEST             (TV_FIRST+17)
1668 #define TVM_CREATEDRAGIMAGE     (TV_FIRST+18)
1669 #define TVM_SORTCHILDREN        (TV_FIRST+19)
1670 #define TVM_ENSUREVISIBLE       (TV_FIRST+20)
1671 #define TVM_SORTCHILDRENCB      (TV_FIRST+21)
1672 #define TVM_ENDEDITLABELNOW     (TV_FIRST+22)
1673 #define TVM_GETISEARCHSTRINGA (TV_FIRST+23)
1674 #define TVM_GETISEARCHSTRINGW (TV_FIRST+64)
1675 #define TVM_GETISEARCHSTRING    WINELIB_NAME_AW(TVM_GETISEARCHSTRING)
1676 #define TVM_SETTOOLTIPS         (TV_FIRST+24)
1677 #define TVM_GETTOOLTIPS         (TV_FIRST+25)
1678 #define TVM_SETINSERTMARK       (TV_FIRST+26)
1679 #define TVM_SETITEMHEIGHT       (TV_FIRST+27)
1680 #define TVM_GETITEMHEIGHT       (TV_FIRST+28)
1681 #define TVM_SETBKCOLOR          (TV_FIRST+29)
1682 #define TVM_SETTEXTCOLOR        (TV_FIRST+30)
1683 #define TVM_GETBKCOLOR          (TV_FIRST+31)
1684 #define TVM_GETTEXTCOLOR        (TV_FIRST+32)
1685 #define TVM_SETSCROLLTIME       (TV_FIRST+33)
1686 #define TVM_GETSCROLLTIME       (TV_FIRST+34)
1687 #define TVM_UNKNOWN35           (TV_FIRST+35)
1688 #define TVM_UNKNOWN36           (TV_FIRST+36)
1689 #define TVM_SETINSERTMARKCOLOR  (TV_FIRST+37)
1690 #define TVM_GETINSERTMARKCOLOR  (TV_FIRST+38)
1691 #define TVM_GETITEMSTATE        (TV_FIRST+39)
1692 #define TVM_SETLINECOLOR        (TV_FIRST+40)
1693 #define TVM_GETLINECOLOR        (TV_FIRST+41)
1694 #define TVM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
1695 #define TVM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
1696
1697 #define TreeView_GetItemState(hwndTV, hti, mask) \
1698    (UINT)SendMessageA((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), (LPARAM)(mask))
1699 #define TreeView_GetCheckState(hwndTV, hti) \
1700    ((((UINT)(SendMessageA((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti),  \
1701                      TVIS_STATEIMAGEMASK))) >> 12) -1)
1702 #define TreeView_SetLineColor(hwnd, clr) \
1703     (COLORREF)SendMessageA((hwnd), TVM_SETLINECOLOR, 0, (LPARAM)(clr))
1704 #define TreeView_GetLineColor(hwnd) \
1705     (COLORREF)SendMessageA((hwnd), TVM_GETLINECOLOR, 0, 0)
1706 #define TreeView_SetItemState(hwndTV, hti, data, _mask) \
1707 { TVITEM _TVi; \
1708   _TVi.mask = TVIF_STATE; \
1709   _TVi.hItem = hti; \
1710   _TVi.stateMask = _mask; \
1711   _TVi.state = data; \
1712   SendMessageA((hwndTV), TVM_SETITEM, 0, (LPARAM)(TV_ITEM *)&_TVi); \
1713 }
1714
1715
1716
1717
1718
1719 #define TVN_FIRST               (0U-400U)
1720 #define TVN_LAST                (0U-499U)
1721
1722 #define TVN_SELCHANGING         (TVN_FIRST-1)
1723 #define TVN_SELCHANGED          (TVN_FIRST-2)
1724 #define TVN_GETDISPINFO         (TVN_FIRST-3)
1725 #define TVN_SETDISPINFO         (TVN_FIRST-4)
1726 #define TVN_ITEMEXPANDING       (TVN_FIRST-5)
1727 #define TVN_ITEMEXPANDED        (TVN_FIRST-6)
1728 #define TVN_BEGINDRAG           (TVN_FIRST-7)
1729 #define TVN_BEGINRDRAG          (TVN_FIRST-8)
1730 #define TVN_DELETEITEM          (TVN_FIRST-9)
1731 #define TVN_BEGINLABELEDIT      (TVN_FIRST-10)
1732 #define TVN_ENDLABELEDIT        (TVN_FIRST-11)
1733 #define TVN_KEYDOWN             (TVN_FIRST-12)
1734 #define TVN_GETINFOTIPA         (TVN_FIRST-13)
1735 #define TVN_GETINFOTIPW         (TVN_FIRST-14)
1736 #define TVN_SINGLEEXPAND        (TVN_FIRST-15)
1737
1738
1739 #define TVN_SELCHANGINGW        (TVN_FIRST-50)
1740 #define TVN_SELCHANGEDW         (TVN_FIRST-51)
1741 #define TVN_GETDISPINFOW        (TVN_FIRST-52)
1742 #define TVN_SETDISPINFOW        (TVN_FIRST-53)
1743 #define TVN_ITEMEXPANDINGW      (TVN_FIRST-54)
1744 #define TVN_ITEMEXPANDEDW       (TVN_FIRST-55)
1745 #define TVN_BEGINDRAGW          (TVN_FIRST-56)
1746 #define TVN_BEGINRDRAGW         (TVN_FIRST-57)
1747 #define TVN_DELETEITEMW         (TVN_FIRST-58)
1748 #define TVN_BEGINLABELEDITW     (TVN_FIRST-59)
1749 #define TVN_ENDLABELEDITW       (TVN_FIRST-60)
1750
1751
1752
1753 #define TVIF_TEXT             0x0001
1754 #define TVIF_IMAGE            0x0002
1755 #define TVIF_PARAM            0x0004
1756 #define TVIF_STATE            0x0008
1757 #define TVIF_HANDLE           0x0010
1758 #define TVIF_SELECTEDIMAGE    0x0020
1759 #define TVIF_CHILDREN         0x0040
1760 #define TVIF_INTEGRAL         0x0080
1761 #define TVIF_DI_SETITEM           0x1000
1762
1763 #define TVI_ROOT              ((HTREEITEM)0xffff0000)     /* -65536 */
1764 #define TVI_FIRST             ((HTREEITEM)0xffff0001)     /* -65535 */
1765 #define TVI_LAST              ((HTREEITEM)0xffff0002)     /* -65534 */
1766 #define TVI_SORT              ((HTREEITEM)0xffff0003)     /* -65533 */
1767
1768 #define TVIS_FOCUSED          0x0001
1769 #define TVIS_SELECTED         0x0002
1770 #define TVIS_CUT              0x0004
1771 #define TVIS_DROPHILITED      0x0008
1772 #define TVIS_BOLD             0x0010
1773 #define TVIS_EXPANDED         0x0020
1774 #define TVIS_EXPANDEDONCE     0x0040
1775 #define TVIS_OVERLAYMASK      0x0f00
1776 #define TVIS_STATEIMAGEMASK   0xf000
1777 #define TVIS_USERMASK         0xf000
1778
1779 #define TVHT_NOWHERE          0x0001
1780 #define TVHT_ONITEMICON       0x0002
1781 #define TVHT_ONITEMLABEL      0x0004
1782 #define TVHT_ONITEMINDENT     0x0008
1783 #define TVHT_ONITEMBUTTON     0x0010
1784 #define TVHT_ONITEMRIGHT      0x0020
1785 #define TVHT_ONITEMSTATEICON  0x0040
1786 #define TVHT_ONITEM           0x0046
1787 #define TVHT_ABOVE            0x0100
1788 #define TVHT_BELOW            0x0200
1789 #define TVHT_TORIGHT          0x0400
1790 #define TVHT_TOLEFT           0x0800
1791
1792 #define TVS_HASBUTTONS        0x0001
1793 #define TVS_HASLINES          0x0002
1794 #define TVS_LINESATROOT       0x0004
1795 #define TVS_EDITLABELS        0x0008
1796 #define TVS_DISABLEDRAGDROP   0x0010
1797 #define TVS_SHOWSELALWAYS     0x0020
1798 #define TVS_RTLREADING        0x0040
1799 #define TVS_NOTOOLTIPS        0x0080
1800 #define TVS_CHECKBOXES        0x0100
1801 #define TVS_TRACKSELECT       0x0200
1802 #define TVS_SINGLEEXPAND          0x0400
1803 #define TVS_INFOTIP               0x0800
1804 #define TVS_FULLROWSELECT         0x1000
1805 #define TVS_NOSCROLL              0x2000
1806 #define TVS_NONEVENHEIGHT         0x4000
1807
1808 #define TVS_SHAREDIMAGELISTS  0x0000
1809 #define TVS_PRIVATEIMAGELISTS 0x0400
1810
1811
1812 #define TVE_COLLAPSE          0x0001
1813 #define TVE_EXPAND            0x0002
1814 #define TVE_TOGGLE            0x0003
1815 #define TVE_EXPANDPARTIAL     0x4000
1816 #define TVE_COLLAPSERESET     0x8000
1817
1818 #define TVGN_ROOT             0
1819 #define TVGN_NEXT             1
1820 #define TVGN_PREVIOUS         2
1821 #define TVGN_PARENT           3
1822 #define TVGN_CHILD            4
1823 #define TVGN_FIRSTVISIBLE     5
1824 #define TVGN_NEXTVISIBLE      6
1825 #define TVGN_PREVIOUSVISIBLE  7
1826 #define TVGN_DROPHILITE       8
1827 #define TVGN_CARET            9
1828 #define TVGN_LASTVISIBLE      10
1829
1830 #define TVC_UNKNOWN           0x00
1831 #define TVC_BYMOUSE           0x01
1832 #define TVC_BYKEYBOARD        0x02
1833
1834
1835 typedef struct _TREEITEM *HTREEITEM;
1836
1837 typedef struct {
1838       UINT mask;
1839       HTREEITEM hItem;
1840       UINT state;
1841       UINT stateMask;
1842       LPSTR  pszText;
1843       INT  cchTextMax;
1844       INT  iImage;
1845       INT  iSelectedImage;
1846       INT  cChildren;
1847       LPARAM lParam;
1848 } TVITEMA, *LPTVITEMA;
1849
1850 typedef struct {
1851       UINT mask;
1852       HTREEITEM hItem;
1853       UINT state;
1854       UINT stateMask;
1855       LPWSTR pszText;
1856       INT cchTextMax;
1857       INT iImage;
1858       INT iSelectedImage;
1859       INT cChildren;
1860       LPARAM lParam;
1861 } TVITEMW, *LPTVITEMW;
1862
1863 #define TVITEM     WINELIB_NAME_AW(TVITEM)
1864 #define LPTVITEM   WINELIB_NAME_AW(LPTVITEM)
1865 #define TV_ITEM     TVITEM
1866
1867 typedef struct {
1868       UINT mask;
1869       HTREEITEM hItem;
1870       UINT state;
1871       UINT stateMask;
1872       LPSTR  pszText;
1873       INT  cchTextMax;
1874       INT  iImage;
1875       INT  iSelectedImage;
1876       INT  cChildren;
1877       LPARAM lParam;
1878       INT iIntegral;
1879 } TVITEMEXA, *LPTVITEMEXA;
1880
1881 typedef struct {
1882       UINT mask;
1883       HTREEITEM hItem;
1884       UINT state;
1885       UINT stateMask;
1886       LPWSTR pszText;
1887       INT cchTextMax;
1888       INT iImage;
1889       INT iSelectedImage;
1890       INT cChildren;
1891       LPARAM lParam;
1892       INT iIntegral;
1893 } TVITEMEXW, *LPTVITEMEXW;
1894
1895 #define TVITEMEX   WINELIB_NAME_AW(TVITEMEX)
1896 #define LPTVITEMEX WINELIB_NAME_AW(LPTVITEMEX)
1897
1898 typedef struct tagTVINSERTSTRUCTA {
1899         HTREEITEM hParent;
1900         HTREEITEM hInsertAfter;
1901         union {
1902            TVITEMEXA itemex;
1903            TVITEMA   item;
1904         } DUMMYUNIONNAME;
1905 } TVINSERTSTRUCTA, *LPTVINSERTSTRUCTA;
1906
1907 typedef struct tagTVINSERTSTRUCTW {
1908         HTREEITEM hParent;
1909         HTREEITEM hInsertAfter;
1910         union {
1911            TVITEMEXW itemex;
1912            TVITEMW   item;
1913         } DUMMYUNIONNAME;
1914 } TVINSERTSTRUCTW, *LPTVINSERTSTRUCTW;
1915
1916 #define TV_INSERTSTRUCT   WINELIB_NAME_AW(TVINSERTSTRUCT)
1917 #define LPTV_INSERTSTRUCT WINELIB_NAME_AW(LPTVINSERTSTRUCT)
1918
1919 #define TVINSERTSTRUCT_V1_SIZEA CCSIZEOF_STRUCT(TVINSERTSTRUCTA, item)
1920 #define TVINSERTSTRUCT_V1_SIZEW CCSIZEOF_STRUCT(TVINSERTSTRUCTW, item)
1921 #define TVINSERTSTRUCT_V1_SIZE    WINELIB_NAME_AW(TVINSERTSTRUCT_V1_SIZE)
1922
1923
1924
1925 typedef struct tagNMTREEVIEWA {
1926         NMHDR   hdr;
1927         UINT    action;
1928         TVITEMA itemOld;
1929         TVITEMA itemNew;
1930         POINT   ptDrag;
1931 } NMTREEVIEWA, *LPNMTREEVIEWA;
1932
1933 typedef struct tagNMTREEVIEWW {
1934         NMHDR   hdr;
1935         UINT    action;
1936         TVITEMW itemOld;
1937         TVITEMW itemNew;
1938         POINT   ptDrag;
1939 } NMTREEVIEWW, *LPNMTREEVIEWW;
1940
1941 #define NMTREEVIEW     WINELIB_NAME_AW(NMTREEVIEW)
1942 #define NM_TREEVIEW    WINELIB_NAME_AW(NMTREEVIEW)
1943 #define LPNMTREEVIEW   WINELIB_NAME_AW(LPNMTREEVIEW)
1944
1945 typedef struct tagTVDISPINFOA {
1946         NMHDR   hdr;
1947         TVITEMA item;
1948 } NMTVDISPINFOA, *LPNMTVDISPINFOA;
1949
1950 typedef struct tagTVDISPINFOW {
1951         NMHDR   hdr;
1952         TVITEMW item;
1953 } NMTVDISPINFOW, *LPNMTVDISPINFOW;
1954
1955 #define NMTVDISPINFO            WINELIB_NAME_AW(NMTVDISPINFO)
1956 #define LPNMTVDISPINFO          WINELIB_NAME_AW(LPNMTVDISPINFO)
1957 #define TV_DISPINFO             NMTVDISPINFO
1958
1959 typedef INT (CALLBACK *PFNTVCOMPARE)(LPARAM, LPARAM, LPARAM);
1960
1961 typedef struct tagTVSORTCB
1962 {
1963         HTREEITEM hParent;
1964         PFNTVCOMPARE lpfnCompare;
1965         LPARAM lParam;
1966 } TVSORTCB, *LPTVSORTCB;
1967
1968 #define TV_SORTCB TVSORTCB
1969 #define LPTV_SORTCB LPTVSORTCB
1970
1971 typedef struct tagTVHITTESTINFO {
1972         POINT pt;
1973         UINT flags;
1974         HTREEITEM hItem;
1975 } TVHITTESTINFO, *LPTVHITTESTINFO;
1976
1977 #define TV_HITTESTINFO TVHITTESTINFO
1978
1979
1980 /* Custom Draw Treeview */
1981
1982 #define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW, clrTextBk)
1983
1984 #define TVCDRF_NOIMAGES     0x00010000
1985
1986 typedef struct tagNMTVCUSTOMDRAW
1987 {
1988     NMCUSTOMDRAW nmcd;
1989     COLORREF     clrText;
1990     COLORREF     clrTextBk;
1991     INT iLevel;                 /* IE>0x0400 */
1992 } NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
1993
1994 /* Treeview tooltips */
1995
1996 typedef struct tagNMTVGETINFOTIPA
1997 {
1998     NMHDR hdr;
1999     LPSTR pszText;
2000     INT cchTextMax;
2001     HTREEITEM hItem;
2002     LPARAM lParam;
2003 } NMTVGETINFOTIPA, *LPNMTVGETINFOTIPA;
2004
2005 typedef struct tagNMTVGETINFOTIPW
2006 {
2007     NMHDR hdr;
2008     LPWSTR pszText;
2009     INT cchTextMax;
2010     HTREEITEM hItem;
2011     LPARAM lParam;
2012 } NMTVGETINFOTIPW, *LPNMTVGETINFOTIPW;
2013
2014
2015
2016 #define TreeView_InsertItemA(hwnd, phdi) \
2017   (INT)SendMessageA((hwnd), TVM_INSERTITEMA, 0, \
2018                             (LPARAM)(LPTVINSERTSTRUCTA)(phdi))
2019 #define TreeView_InsertItemW(hwnd,phdi) \
2020   (INT)SendMessageW((hwnd), TVM_INSERTITEMW, 0, \
2021                             (LPARAM)(LPTVINSERTSTRUCTW)(phdi))  
2022 #define TreeView_DeleteItem(hwnd, hItem) \
2023   (BOOL)SendMessageA((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hItem))
2024 #define TreeView_DeleteAllItems(hwnd) \
2025   (BOOL)SendMessageA((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT)
2026 #define TreeView_Expand(hwnd, hitem, code) \
2027  (BOOL)SendMessageA((hwnd), TVM_EXPAND, (WPARAM)code, \
2028         (LPARAM)(HTREEITEM)(hitem))
2029
2030 #define TreeView_GetItemRect(hwnd, hitem, prc, code) \
2031  (*(HTREEITEM *)prc = (hitem), (BOOL)SendMessageA((hwnd), \
2032                         TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT *)(prc)))
2033
2034 #define TreeView_GetCount(hwnd) \
2035     (UINT)SendMessageA((hwnd), TVM_GETCOUNT, 0, 0)
2036 #define TreeView_GetIndent(hwnd) \
2037     (UINT)SendMessageA((hwnd), TVM_GETINDENT, 0, 0)
2038 #define TreeView_SetIndent(hwnd, indent) \
2039     (BOOL)SendMessageA((hwnd), TVM_SETINDENT, (WPARAM)indent, 0)
2040
2041 #define TreeView_GetImageList(hwnd, iImage) \
2042     (HIMAGELIST)SendMessageA((hwnd), TVM_GETIMAGELIST, iImage, 0)
2043
2044 #define TreeView_SetImageList(hwnd, himl, iImage) \
2045     (HIMAGELIST)SendMessageA((hwnd), TVM_SETIMAGELIST, iImage, \
2046  (LPARAM)(UINT)(HIMAGELIST)(himl))
2047
2048 #define TreeView_GetNextItem(hwnd, hitem, code) \
2049     (HTREEITEM)SendMessageA((hwnd), TVM_GETNEXTITEM, (WPARAM)code,\
2050 (LPARAM)(HTREEITEM) (hitem))
2051
2052 #define TreeView_GetChild(hwnd, hitem) \
2053                  TreeView_GetNextItem(hwnd, hitem , TVGN_CHILD)
2054 #define TreeView_GetNextSibling(hwnd, hitem) \
2055                 TreeView_GetNextItem(hwnd, hitem , TVGN_NEXT)
2056 #define TreeView_GetPrevSibling(hwnd, hitem) \
2057                 TreeView_GetNextItem(hwnd, hitem , TVGN_PREVIOUS)
2058 #define TreeView_GetParent(hwnd, hitem) \
2059                 TreeView_GetNextItem(hwnd, hitem , TVGN_PARENT)
2060 #define TreeView_GetFirstVisible(hwnd)  \
2061                 TreeView_GetNextItem(hwnd, NULL, TVGN_FIRSTVISIBLE)
2062 #define TreeView_GetLastVisible(hwnd)   \
2063                 TreeView_GetNextItem(hwnd, NULL, TVGN_LASTVISIBLE)
2064 #define TreeView_GetNextVisible(hwnd, hitem) \
2065                 TreeView_GetNextItem(hwnd, hitem , TVGN_NEXTVISIBLE)
2066 #define TreeView_GetPrevVisible(hwnd, hitem) \
2067                 TreeView_GetNextItem(hwnd, hitem , TVGN_PREVIOUSVISIBLE)
2068 #define TreeView_GetSelection(hwnd) \
2069                 TreeView_GetNextItem(hwnd, NULL, TVGN_CARET)
2070 #define TreeView_GetDropHilight(hwnd) \
2071                 TreeView_GetNextItem(hwnd, NULL, TVGN_DROPHILITE)
2072 #define TreeView_GetRoot(hwnd) \
2073                 TreeView_GetNextItem(hwnd, NULL, TVGN_ROOT)
2074 #define TreeView_GetLastVisible(hwnd) \
2075                 TreeView_GetNextItem(hwnd, NULL, TVGN_LASTVISIBLE)
2076
2077
2078 #define TreeView_Select(hwnd, hitem, code) \
2079  (UINT)SendMessageA((hwnd), TVM_SELECTITEM, (WPARAM)code, \
2080 (LPARAM)(UINT)(hitem))
2081
2082
2083 #define TreeView_SelectItem(hwnd, hitem) \
2084                 TreeView_Select(hwnd, hitem, TVGN_CARET)
2085 #define TreeView_SelectDropTarget(hwnd, hitem) \
2086                 TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
2087 /* FIXME
2088 #define TreeView_SelectSetFirstVisible(hwnd, hitem)  \ 
2089                 TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
2090 */
2091
2092 #define TreeView_GetItemA(hwnd, pitem) \
2093  (BOOL)SendMessageA((hwnd), TVM_GETITEMA, 0, (LPARAM) (TVITEMA *)(pitem))
2094
2095 #define TreeView_SetItemA(hwnd, pitem) \
2096  (BOOL)SendMessageA((hwnd), TVM_SETITEMA, 0, (LPARAM)(const TVITEMA *)(pitem)) 
2097
2098 #define TreeView_EditLabel(hwnd, hitem) \
2099     (HWND)SendMessageA((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
2100
2101
2102 #define TreeView_GetEditControl(hwnd) \
2103     (HWND)SendMessageA((hwnd), TVM_GETEDITCONTROL, 0, 0)
2104
2105 #define TreeView_GetVisibleCount(hwnd) \
2106     (UINT)SendMessageA((hwnd), TVM_GETVISIBLECOUNT, 0, 0)
2107
2108 #define TreeView_HitTest(hwnd, lpht) \
2109     (HTREEITEM)SendMessageA((hwnd), TVM_HITTEST, 0,\
2110 (LPARAM)(LPTVHITTESTINFO)(lpht))
2111
2112 #define TreeView_CreateDragImage(hwnd, hitem) \
2113     (HIMAGELIST)SendMessageA((hwnd), TVM_CREATEDRAGIMAGE, 0,\
2114 (LPARAM)(HTREEITEM)(hitem))
2115
2116 #define TreeView_SortChildren(hwnd, hitem, recurse) \
2117     (BOOL)SendMessageA((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse,\
2118 (LPARAM)(HTREEITEM)(hitem))
2119
2120 #define TreeView_EnsureVisible(hwnd, hitem) \
2121     (BOOL)SendMessageA((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(UINT)(hitem))
2122
2123 #define TreeView_SortChildrenCB(hwnd, psort, recurse) \
2124     (BOOL)SendMessageA((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \
2125     (LPARAM)(LPTV_SORTCB)(psort))
2126
2127 #define TreeView_EndEditLabelNow(hwnd, fCancel) \
2128     (BOOL)SendMessageA((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0)
2129
2130 #define TreeView_GetISearchString(hwndTV, lpsz) \
2131     (BOOL)SendMessageA((hwndTV), TVM_GETISEARCHSTRING, 0, \
2132                                                         (LPARAM)(LPTSTR)lpsz)
2133
2134 #define TreeView_SetItemHeight(hwnd,  iHeight) \
2135     (INT)SendMessageA((hwnd), TVM_SETITEMHEIGHT, (WPARAM)iHeight, 0)
2136 #define TreeView_GetItemHeight(hwnd) \
2137     (INT)SendMessageA((hwnd), TVM_GETITEMHEIGHT, 0, 0)
2138
2139 #define TreeView_SetBkColor(hwnd, clr) \
2140     (COLORREF)SendMessageA((hwnd), TVM_SETBKCOLOR, 0, (LPARAM)clr)
2141
2142 #define TreeView_SetTextColor(hwnd, clr) \
2143     (COLORREF)SendMessageA((hwnd), TVM_SETTEXTCOLOR, 0, (LPARAM)clr)
2144
2145 #define TreeView_GetBkColor(hwnd) \
2146     (COLORREF)SendMessageA((hwnd), TVM_GETBKCOLOR, 0, 0)
2147
2148 #define TreeView_GetTextColor(hwnd) \
2149     (COLORREF)SendMessageA((hwnd), TVM_GETTEXTCOLOR, 0, 0)
2150
2151 #define TreeView_SetScrollTime(hwnd, uTime) \
2152     (UINT)SendMessageA((hwnd), TVM_SETSCROLLTIME, uTime, 0)
2153
2154 #define TreeView_GetScrollTime(hwnd) \
2155     (UINT)SendMessageA((hwnd), TVM_GETSCROLLTIME, 0, 0)
2156
2157 #define TreeView_SetInsertMarkColor(hwnd, clr) \
2158     (COLORREF)SendMessageA((hwnd), TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr)
2159 #define TreeView_GetInsertMarkColor(hwnd) \
2160     (COLORREF)SendMessageA((hwnd), TVM_GETINSERTMARKCOLOR, 0, 0)
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170 /* Listview control */
2171
2172 #define WC_LISTVIEWA          "SysListView32"
2173 #define WC_LISTVIEWW          L"SysListView32"
2174 #define WC_LISTVIEW  WINELIB_NAME_AW(WC_LISTVIEW)
2175
2176 #define LVS_ICON                0x0000
2177 #define LVS_REPORT              0x0001
2178 #define LVS_SMALLICON           0x0002
2179 #define LVS_LIST                0x0003
2180 #define LVS_TYPEMASK            0x0003
2181 #define LVS_SINGLESEL           0x0004
2182 #define LVS_SHOWSELALWAYS       0x0008
2183 #define LVS_SORTASCENDING       0x0010
2184 #define LVS_SORTDESCENDING      0x0020
2185 #define LVS_SHAREIMAGELISTS     0x0040
2186 #define LVS_NOLABELWRAP         0x0080
2187 #define LVS_AUTOARRANGE         0x0100
2188 #define LVS_EDITLABELS          0x0200
2189 #define LVS_OWNERDATA           0x1000
2190 #define LVS_NOSCROLL            0x2000
2191 #define LVS_TYPESTYLEMASK       0xfc00
2192 #define LVS_ALIGNTOP            0x0000
2193 #define LVS_ALIGNLEFT           0x0800
2194 #define LVS_ALIGNMASK           0x0c00
2195 #define LVS_OWNERDRAWFIXED      0x0400
2196 #define LVS_NOCOLUMNHEADER      0x4000
2197 #define LVS_NOSORTHEADER        0x8000
2198
2199 #define LVCF_FMT                0x0001
2200 #define LVCF_WIDTH              0x0002
2201 #define LVCF_TEXT               0x0004
2202 #define LVCF_SUBITEM            0x0008
2203 #define LVCF_IMAGE              0x0010
2204 #define LVCF_ORDER              0x0020
2205
2206 #define LVCFMT_LEFT             0x0000
2207 #define LVCFMT_RIGHT            0x0001
2208 #define LVCFMT_CENTER           0x0002
2209 #define LVCFMT_JUSTIFYMASK      0x0003
2210 #define LVCFMT_IMAGE            0x0800
2211 #define LVCFMT_BITMAP_ON_RIGHT  0x1000
2212 #define LVCFMT_COL_HAS_IMAGES   0x8000
2213
2214 #define LVSIL_NORMAL            0
2215 #define LVSIL_SMALL             1
2216 #define LVSIL_STATE             2
2217
2218 #define LVFI_PARAM              0X0001
2219 #define LVFI_STRING             0X0002
2220 #define LVFI_PARTIAL            0X0008
2221 #define LVFI_WRAP               0X0020  
2222 #define LVFI_NEARESTXY          0X0040
2223
2224 #define LVIF_TEXT               0x0001
2225 #define LVIF_IMAGE              0x0002
2226 #define LVIF_PARAM              0x0004
2227 #define LVIF_STATE              0x0008
2228 #define LVIF_INDENT             0x0010
2229 #define LVIF_NORECOMPUTE        0x0800
2230 #define LVIF_DI_SETITEM         0x1000
2231
2232 #define LVIR_BOUNDS             0x0000
2233 #define LVIR_LABEL              0x0002
2234 #define LVIR_ICON               0x0001
2235 #define LVIR_SELECTBOUNDS       0x0003 
2236
2237 #define LVIS_FOCUSED            0x0001
2238 #define LVIS_SELECTED           0x0002
2239 #define LVIS_CUT                0x0004
2240 #define LVIS_DROPHILITED        0x0008
2241 #define LVIS_ACTIVATING         0x0020
2242
2243 #define LVIS_OVERLAYMASK        0x0F00
2244 #define LVIS_STATEIMAGEMASK     0xF000
2245
2246 #define LVNI_ALL                0x0000
2247 #define LVNI_FOCUSED            0x0001
2248 #define LVNI_SELECTED           0x0002
2249 #define LVNI_CUT                0x0004
2250 #define LVNI_DROPHILITED        0x0008
2251
2252 #define LVNI_ABOVE              0x0100
2253 #define LVNI_BELOW              0x0200
2254 #define LVNI_TOLEFT             0x0400
2255 #define LVNI_TORIGHT            0x0800
2256
2257 #define LVHT_NOWHERE            0x0001
2258 #define LVHT_ONITEMICON         0x0002
2259 #define LVHT_ONITEMLABEL        0x0004
2260 #define LVHT_ONITEMSTATEICON    0x0008
2261 #define LVHT_ONITEM             (LVHT_ONITEMICON|LVHT_ONITEMLABEL|LVHT_ONITEMSTATEICON)
2262
2263 #define LVHT_ABOVE              0x0008
2264 #define LVHT_BELOW              0x0010
2265 #define LVHT_TORIGHT            0x0020
2266 #define LVHT_TOLEFT             0x0040
2267
2268 #define LVM_FIRST               0x1000
2269 #define LVM_GETBKCOLOR          (LVM_FIRST+0)
2270 #define LVM_SETBKCOLOR          (LVM_FIRST+1)
2271 #define LVM_GETIMAGELIST        (LVM_FIRST+2)
2272 #define LVM_SETIMAGELIST        (LVM_FIRST+3)
2273 #define LVM_GETITEMCOUNT        (LVM_FIRST+4)
2274 #define LVM_GETITEMA          (LVM_FIRST+5)
2275 #define LVM_GETITEMW          (LVM_FIRST+75)
2276 #define LVM_GETITEM             WINELIB_NAME_AW(LVM_GETITEM)
2277 #define LVM_SETITEMA          (LVM_FIRST+6)
2278 #define LVM_SETITEMW          (LVM_FIRST+76)
2279 #define LVM_SETITEM             WINELIB_NAME_AW(LVM_SETITEM)
2280 #define LVM_INSERTITEMA       (LVM_FIRST+7)
2281 #define LVM_INSERTITEMW       (LVM_FIRST+77)
2282 #define LVM_INSERTITEM          WINELIB_NAME_AW(LVM_INSERTITEM)
2283 #define LVM_DELETEITEM          (LVM_FIRST+8)
2284 #define LVM_DELETEALLITEMS      (LVM_FIRST+9)
2285 #define LVM_GETCALLBACKMASK     (LVM_FIRST+10)
2286 #define LVM_SETCALLBACKMASK     (LVM_FIRST+11)
2287 #define LVM_GETNEXTITEM         (LVM_FIRST+12)
2288 #define LVM_FINDITEMA         (LVM_FIRST+13)
2289 #define LVM_FINDITEMW         (LVM_FIRST+83)
2290 #define LVM_FINDITEM            WINELIB_NAME_AW(LVM_FINDITEM)
2291 #define LVM_GETITEMRECT         (LVM_FIRST+14)
2292 #define LVM_SETITEMPOSITION     (LVM_FIRST+15)
2293 #define LVM_GETITEMPOSITION     (LVM_FIRST+16)
2294 #define LVM_GETSTRINGWIDTHA   (LVM_FIRST+17)
2295 #define LVM_GETSTRINGWIDTHW   (LVM_FIRST+87)
2296 #define LVM_GETSTRINGWIDTH      WINELIB_NAME_AW(LVM_GETSTRINGWIDTH)
2297 #define LVM_HITTEST             (LVM_FIRST+18)
2298 #define LVM_ENSUREVISIBLE       (LVM_FIRST+19)
2299 #define LVM_SCROLL              (LVM_FIRST+20)
2300 #define LVM_REDRAWITEMS         (LVM_FIRST+21)
2301 #define LVM_ARRANGE             (LVM_FIRST+22)
2302 #define LVM_EDITLABELA        (LVM_FIRST+23)
2303 #define LVM_EDITLABELW        (LVM_FIRST+118)
2304 #define LVM_EDITLABEL           WINELIB_NAME_AW(LVM_EDITLABEL)
2305 #define LVM_GETEDITCONTROL      (LVM_FIRST+24)
2306 #define LVM_GETCOLUMNA        (LVM_FIRST+25)
2307 #define LVM_GETCOLUMNW        (LVM_FIRST+95)
2308 #define LVM_GETCOLUMN           WINELIB_NAME_AW(LVM_GETCOLUMN)
2309 #define LVM_SETCOLUMNA        (LVM_FIRST+26)
2310 #define LVM_SETCOLUMNW        (LVM_FIRST+96)
2311 #define LVM_SETCOLUMN           WINELIB_NAME_AW(LVM_SETCOLUMN)
2312 #define LVM_INSERTCOLUMNA     (LVM_FIRST+27)
2313 #define LVM_INSERTCOLUMNW     (LVM_FIRST+97)
2314 #define LVM_INSERTCOLUMN        WINELIB_NAME_AW(LVM_INSERTCOLUMN)
2315 #define LVM_DELETECOLUMN        (LVM_FIRST+28)
2316 #define LVM_GETCOLUMNWIDTH      (LVM_FIRST+29)
2317 #define LVM_SETCOLUMNWIDTH      (LVM_FIRST+30)
2318 #define LVM_GETHEADER           (LVM_FIRST+31)
2319
2320 #define LVM_CREATEDRAGIMAGE     (LVM_FIRST+33)
2321 #define LVM_GETVIEWRECT         (LVM_FIRST+34)
2322 #define LVM_GETTEXTCOLOR        (LVM_FIRST+35)
2323 #define LVM_SETTEXTCOLOR        (LVM_FIRST+36)
2324 #define LVM_GETTEXTBKCOLOR      (LVM_FIRST+37)
2325 #define LVM_SETTEXTBKCOLOR      (LVM_FIRST+38)
2326 #define LVM_GETTOPINDEX         (LVM_FIRST+39)
2327 #define LVM_GETCOUNTPERPAGE     (LVM_FIRST+40)
2328 #define LVM_GETORIGIN           (LVM_FIRST+41)
2329 #define LVM_UPDATE              (LVM_FIRST+42)
2330 #define LVM_SETITEMSTATE        (LVM_FIRST+43)
2331 #define LVM_GETITEMSTATE        (LVM_FIRST+44)
2332 #define LVM_GETITEMTEXTA      (LVM_FIRST+45)
2333 #define LVM_GETITEMTEXTW      (LVM_FIRST+115)
2334 #define LVM_GETITEMTEXT         WINELIB_NAME_AW(LVM_GETITEMTEXT)
2335 #define LVM_SETITEMTEXTA      (LVM_FIRST+46)
2336 #define LVM_SETITEMTEXTW      (LVM_FIRST+116)
2337 #define LVM_SETITEMTEXT         WINELIB_NAME_AW(LVM_SETITEMTEXT)
2338 #define LVM_SETITEMCOUNT        (LVM_FIRST+47)
2339 #define LVM_SORTITEMS           (LVM_FIRST+48)
2340 #define LVM_SETITEMPOSITION32   (LVM_FIRST+49)
2341 #define LVM_GETSELECTEDCOUNT    (LVM_FIRST+50)
2342 #define LVM_GETITEMSPACING      (LVM_FIRST+51)
2343 #define LVM_GETISEARCHSTRINGA (LVM_FIRST+52)
2344 #define LVM_GETISEARCHSTRINGW (LVM_FIRST+117)
2345 #define LVM_GETISEARCHSTRING    WINELIB_NAME_AW(LVM_GETISEARCHSTRING)
2346 #define LVM_SETICONSPACING      (LVM_FIRST+53)
2347 #define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+54)
2348 #define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+55)
2349 #define LVM_GETSUBITEMRECT      (LVM_FIRST+56)
2350 #define LVM_SUBITEMHITTEST      (LVM_FIRST+57)
2351 #define LVM_SETCOLUMNORDERARRAY (LVM_FIRST+58)
2352 #define LVM_GETCOLUMNORDERARRAY (LVM_FIRST+59)
2353 #define LVM_SETHOTITEM          (LVM_FIRST+60)
2354 #define LVM_GETHOTITEM          (LVM_FIRST+61)
2355 #define LVM_SETHOTCURSOR        (LVM_FIRST+62)
2356 #define LVM_GETHOTCURSOR        (LVM_FIRST+63)
2357 #define LVM_APPROXIMATEVIEWRECT (LVM_FIRST+64)
2358 #define LVM_SETWORKAREAS        (LVM_FIRST+65)
2359 #define LVM_GETSELECTIONMARK    (LVM_FIRST+66)
2360 #define LVM_SETSELECTIONMARK    (LVM_FIRST+67)
2361 #define LVM_SETBKIMAGEA       (LVM_FIRST+68)
2362 #define LVM_SETBKIMAGEW       (LVM_FIRST+138)
2363 #define LVM_SETBKIMAGE          WINELIB_NAME_AW(LVM_SETBKIMAGE)
2364 #define LVM_GETBKIMAGEA       (LVM_FIRST+69)
2365 #define LVM_GETBKIMAGEW       (LVM_FIRST+139)
2366 #define LVM_GETBKIMAGE          WINELIB_NAME_AW(LVM_GETBKIMAGE)
2367 #define LVM_GETWORKAREAS        (LVM_FIRST+70)
2368 #define LVM_SETHOVERTIME        (LVM_FIRST+71)
2369 #define LVM_GETHOVERTIME        (LVM_FIRST+72)
2370 #define LVM_GETNUMBEROFWORKAREAS (LVM_FIRST+73)
2371 #define LVM_SETTOOLTIPS         (LVM_FIRST+74)
2372
2373 #define LVM_GETTOOLTIPS         (LVM_FIRST+78)
2374
2375 #define LVN_FIRST               (0U-100U)
2376 #define LVN_LAST                (0U-199U)
2377 #define LVN_ITEMCHANGING        (LVN_FIRST-0)
2378 #define LVN_ITEMCHANGED         (LVN_FIRST-1)
2379 #define LVN_INSERTITEM          (LVN_FIRST-2)
2380 #define LVN_DELETEITEM          (LVN_FIRST-3)
2381 #define LVN_DELETEALLITEMS      (LVN_FIRST-4)
2382 #define LVN_BEGINLABELEDITA   (LVN_FIRST-5)
2383 #define LVN_BEGINLABELEDITW   (LVN_FIRST-75)
2384 #define LVN_BEGINLABELEDIT WINELIB_NAME_AW(LVN_BEGINLABELEDIT)
2385 #define LVN_ENDLABELEDITA     (LVN_FIRST-6)
2386 #define LVN_ENDLABELEDITW     (LVN_FIRST-76)
2387 #define LVN_ENDLABELEDIT WINELIB_NAME_AW(LVN_ENDLABELEDIT)
2388 #define LVN_COLUMNCLICK         (LVN_FIRST-8)
2389 #define LVN_BEGINDRAG           (LVN_FIRST-9)
2390 #define LVN_BEGINRDRAG          (LVN_FIRST-11)
2391 #define LVN_ODCACHEHINT         (LVN_FIRST-13)
2392 #define LVN_ODFINDITEMA       (LVN_FIRST-52)
2393 #define LVN_ODFINDITEMW       (LVN_FIRST-79)
2394 #define LVN_ODFINDITEM WINELIB_NAME_AW(LVN_ODFINDITEM)
2395 #define LVN_ITEMACTIVATE        (LVN_FIRST-14)
2396 #define LVN_ODSTATECHANGED      (LVN_FIRST-15)
2397 #define LVN_HOTTRACK            (LVN_FIRST-21)
2398 #define LVN_GETDISPINFOA      (LVN_FIRST-50)
2399 #define LVN_GETDISPINFOW      (LVN_FIRST-77)
2400 #define LVN_GETDISPINFO WINELIB_NAME_AW(LVN_GETDISPINFO)
2401 #define LVN_SETDISPINFOA      (LVN_FIRST-51)
2402 #define LVN_SETDISPINFOW      (LVN_FIRST-78)
2403 #define LVN_SETDISPINFO WINELIB_NAME_AW(LVN_SETDISPINFO)
2404
2405 #define LVA_ALIGNLEFT           0x0000
2406 #define LVA_DEFAULT             0x0001
2407 #define LVA_ALIGNTOP            0x0002
2408 #define LVA_SNAPTOGRID          0x0005
2409
2410 typedef struct tagLVITEMA
2411 {
2412     UINT mask;
2413     INT  iItem;
2414     INT  iSubItem;
2415     UINT state;
2416     UINT stateMask;
2417     LPSTR  pszText;
2418     INT  cchTextMax;
2419     INT  iImage;
2420     LPARAM lParam;
2421     INT  iIndent;       /* (_WIN32_IE >= 0x0300) */
2422 } LVITEMA, *LPLVITEMA;
2423
2424 typedef struct tagLVITEMW
2425 {
2426     UINT mask;
2427     INT  iItem;
2428     INT  iSubItem;
2429     UINT state;
2430     UINT stateMask;
2431     LPWSTR pszText;
2432     INT  cchTextMax;
2433     INT  iImage;
2434     LPARAM lParam;
2435     INT  iIndent;       /* (_WIN32_IE >= 0x0300) */
2436 } LVITEMW, *LPLVITEMW;
2437
2438 #define LVITEM   WINELIB_NAME_AW(LVITEM)
2439 #define LPLVITEM WINELIB_NAME_AW(LPLVITEM)
2440
2441 #define LVITEM_V1_SIZEA CCSIZEOF_STRUCT(LVITEMA, lParam)
2442 #define LVITEM_V1_SIZEW CCSIZEOF_STRUCT(LVITEMW, lParam)
2443 #define LVITEM_V1_SIZE WINELIB_NAME_AW(LVITEM_V1_SIZE)
2444
2445 #define LV_ITEM LVITEM
2446
2447 typedef struct tagLVCOLUMNA
2448 {
2449     UINT mask;
2450     INT  fmt;
2451     INT  cx;
2452     LPSTR  pszText;
2453     INT  cchTextMax;
2454     INT  iSubItem;
2455     INT  iImage;  /* (_WIN32_IE >= 0x0300) */
2456     INT  iOrder;  /* (_WIN32_IE >= 0x0300) */
2457 } LVCOLUMNA, *LPLVCOLUMNA;
2458
2459 typedef struct tagLVCOLUMNW
2460 {
2461     UINT mask;
2462     INT  fmt;
2463     INT  cx;
2464     LPWSTR pszText;
2465     INT  cchTextMax;
2466     INT  iSubItem;
2467     INT  iImage;        /* (_WIN32_IE >= 0x0300) */
2468     INT  iOrder;        /* (_WIN32_IE >= 0x0300) */
2469 } LVCOLUMNW, *LPLVCOLUMNW;
2470
2471 #define LVCOLUMN   WINELIB_NAME_AW(LVCOLUMN)
2472 #define LPLVCOLUMN WINELIB_NAME_AW(LPLVCOLUMN)
2473
2474 #define LVCOLUMN_V1_SIZEA CCSIZEOF_STRUCT(LVCOLUMNA, iSubItem)
2475 #define LVCOLUMN_V1_SIZEW CCSIZEOF_STRUCT(LVCOLUMNW, iSubItem)
2476 #define LVCOLUMN_V1_SIZE WINELIB_NAME_AW(LVCOLUMN_V1_SIZE)
2477
2478 #define LV_COLUMN       LVCOLUMN
2479
2480
2481 typedef struct tagNMLISTVIEW
2482 {
2483     NMHDR   hdr;
2484     INT   iItem;
2485     INT   iSubItem;
2486     UINT  uNewState;
2487     UINT  uOldState;
2488     UINT  uChanged;
2489     POINT ptAction;
2490     LPARAM  lParam;
2491 } NMLISTVIEW, *LPNMLISTVIEW;
2492
2493 #define LPNM_LISTVIEW   LPNMLISTVIEW
2494 #define NM_LISTVIEW     NMLISTVIEW
2495
2496
2497 typedef struct tagLVDISPINFO
2498 {
2499     NMHDR     hdr;
2500     LVITEMA item;
2501 } NMLVDISPINFOA, *LPNMLVDISPINFOA;
2502
2503 typedef struct tagLVDISPINFOW
2504 {
2505     NMHDR     hdr;
2506     LVITEMW item;
2507 } NMLVDISPINFOW, *LPNMLVDISPINFOW;
2508
2509 #define NMLVDISPINFO   WINELIB_NAME_AW(NMLVDISPINFO)
2510 #define LPNMLVDISPINFO WINELIB_NAME_AW(LPNMLVDISPINFO)
2511
2512 #define LV_DISPINFO     NMLVDISPINFO
2513
2514 #define LVN_KEYDOWN     (LVN_FIRST-55)
2515
2516 typedef struct tagLVKEYDOWN
2517 {
2518   NMHDR hdr;
2519   WORD  wVKey;
2520   UINT flags;
2521 } NMLVKEYDOWN, *LPNMLVKEYDOWN;
2522
2523 #define LV_KEYDOWN     NMLVKEYDOWN
2524
2525 typedef struct tagLVHITTESTINFO
2526 {
2527     POINT pt;
2528     UINT  flags;
2529     INT   iItem;
2530     INT   iSubItem;
2531 } LVHITTESTINFO, *LPLVHITTESTINFO;
2532
2533 #define LV_HITTESTINFO LVHITTESTINFO
2534 #define _LV_HITTESTINFO tagLVHITTESTINFO
2535 #define LVHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(LVHITTESTINFO,iItem)
2536
2537 typedef struct tagLVFINDINFO
2538 {
2539         UINT flags;
2540         LPCSTR psz;
2541         LPARAM lParam;
2542         POINT pt;
2543         UINT vkDirection;
2544 } LVFINDINFO, *LPLVFINDINFO;
2545
2546 #define LV_FINDINFO LVFINDINFO
2547
2548 typedef struct tagTCHITTESTINFO
2549 {
2550         POINT pt;
2551         UINT flags;
2552 } TCHITTESTINFO, *LPTCHITTESTINFO;
2553
2554 #define TC_HITTESTINFO TCHITTESTINFO
2555
2556 typedef INT (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
2557
2558 #define ListView_GetNextItem(hwnd,nItem,flags) \
2559     (INT)SendMessageA((hwnd),LVM_GETNEXTITEM,(WPARAM)(INT)(nItem),(LPARAM)(MAKELPARAM(flags,0)))
2560 #define ListView_FindItem(hwnd,nItem,plvfi) \
2561     (INT)SendMessageA((hwnd),LVM_FINDITEMA,(WPARAM)(INT)(nItem),(LPARAM)(LVFINDINFO*)(plvfi))
2562 #define ListView_Arrange(hwnd,code) \
2563     (INT)SendMessageA((hwnd),LVM_ARRANGE,(WPARAM)(INT)(code),0L)
2564 #define ListView_GetItemPosition(hwnd,i,ppt) \
2565     (INT)SendMessageA((hwnd),LVM_GETITEMPOSITION,(WPARAM)(INT)(i),(LPARAM)(LPPOINT)(ppt))
2566 #define ListView_GetItemRect(hwnd,i,prc) \
2567     (INT)SendMessageA((hwnd),LVM_GETITEMRECT,(WPARAM)(INT)(i),(LPARAM)(LPRECT)(prc))
2568 #define ListView_SetItemA(hwnd,pitem) \
2569     (INT)SendMessageA((hwnd),LVM_SETITEMA,0,(LPARAM)(const LVITEMA *)(pitem))
2570 #define ListView_SetItemState(hwnd,i,pitem) \
2571     (BOOL)SendMessageA((hwnd),LVM_SETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(LPLVITEMA)(pitem))
2572 #define ListView_GetItemState(hwnd,i,mask) \
2573     (BOOL)SendMessageA((hwnd),LVM_GETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(UINT)(mask))
2574 #define ListView_GetCountPerPage(hwnd) \
2575     (BOOL)SendMessageW((hwnd),LVM_GETCOUNTPERPAGE,0,0L)
2576 #define ListView_GetImageList(hwnd,iImageList) \
2577     (HIMAGELIST)SendMessageA((hwnd),LVM_GETIMAGELIST,(WPARAM)(INT)(iImageList),0L)
2578 #define ListView_GetStringWidthA(hwnd,pstr) \
2579     (INT)SendMessageA((hwnd),LVM_GETSTRINGWIDTHA,0,(LPARAM)(LPCSTR)(pstr))
2580 #define ListView_GetTopIndex(hwnd) \
2581     (BOOL)SendMessageA((hwnd),LVM_GETTOPINDEX,0,0L)
2582 #define ListView_Scroll(hwnd,dx,dy) \
2583     (BOOL)SendMessageA((hwnd),LVM_SCROLL,(WPARAM)(INT)(dx),(LPARAM)(INT)(dy))
2584 #define ListView_EnsureVisible(hwnd,i,fPartialOk) \
2585     (BOOL)SendMessageA((hwnd),LVM_ENSUREVISIBLE,(WPARAM)(INT)i,(LPARAM)(BOOL)fPartialOk)
2586 #define ListView_SetBkColor(hwnd,clrBk) \
2587     (BOOL)SendMessageA((hwnd),LVM_SETBKCOLOR,0,(LPARAM)(COLORREF)(clrBk))
2588 #define ListView_SetImageList(hwnd,himl,iImageList) \
2589     (HIMAGELIST)(UINT)SendMessageA((hwnd),LVM_SETIMAGELIST,(WPARAM)(iImageList),(LPARAM)(UINT)(HIMAGELIST)(himl))
2590 #define ListView_GetItemCount(hwnd) \
2591     (INT)SendMessageA((hwnd),LVM_GETITEMCOUNT,0,0L)
2592 #define ListView_GetItemA(hwnd,pitem) \
2593     (BOOL)SendMessageA((hwnd),LVM_GETITEMA,0,(LPARAM)(LVITEMA *)(pitem))
2594 #define ListView_GetItemW(hwnd,pitem) \
2595     (BOOL)SendMessageW((hwnd),LVM_GETITEMW,0,(LPARAM)(LVITEMW *)(pitem))
2596 #define ListView_GetItem WINELIB_NAME_AW(ListView_GetItem)
2597 #define ListView_HitTest(hwnd,pinfo) \
2598     (INT)SendMessageA((hwnd),LVM_HITTEST,0,(LPARAM)(LPLVHITTESTINFO)(pinfo))
2599 #define ListView_InsertItemA(hwnd,pitem) \
2600     (INT)SendMessageA((hwnd),LVM_INSERTITEMA,0,(LPARAM)(const LVITEMA *)(pitem))
2601 #define ListView_InsertItemW(hwnd,pitem) \
2602     (INT)SendMessageW((hwnd),LVM_INSERTITEMW,0,(LPARAM)(const LVITEMW *)(pitem))
2603 #define ListView_InsertItem WINELIB_NAME_AW(ListView_InsertItem)
2604 #define ListView_DeleteAllItems(hwnd) \
2605     (BOOL)SendMessageA((hwnd),LVM_DELETEALLITEMS,0,0L)
2606 #define ListView_InsertColumnA(hwnd,iCol,pcol) \
2607     (INT)SendMessageA((hwnd),LVM_INSERTCOLUMNA,(WPARAM)(INT)(iCol),(LPARAM)(const LVCOLUMNA *)(pcol))
2608 #define ListView_InsertColumnW(hwnd,iCol,pcol) \
2609     (INT)SendMessageW((hwnd),LVM_INSERTCOLUMNW,(WPARAM)(INT)(iCol),(LPARAM)(const LVCOLUMNW *)(pcol))
2610 #define ListView_InsertColumn WINELIB_NAME_AW(ListView_InsertColumn)
2611 #define ListView_SortItems(hwndLV,_pfnCompare,_lPrm) \
2612     (BOOL)SendMessageA((hwndLV),LVM_SORTITEMS,(WPARAM)(LPARAM)_lPrm,(LPARAM)(PFNLVCOMPARE)_pfnCompare)
2613 #define ListView_SetItemPosition(hwndLV, i, x, y) \
2614     (BOOL)SendMessageA((hwndLV),LVM_SETITEMPOSITION,(WPARAM)(INT)(i),MAKELPARAM((x),(y)))
2615 #define ListView_GetSelectedCount(hwndLV) \
2616     (UINT)SendMessageA((hwndLV),LVM_GETSELECTEDCOUNT,0,0L)
2617
2618
2619 /* Tab Control */
2620
2621 #define WC_TABCONTROL16          "SysTabControl"
2622 #define WC_TABCONTROLA   "SysTabControl32"
2623 #define WC_TABCONTROLW  L"SysTabControl32"
2624
2625 #define WC_TABCONTROL           WINELIB_NAME_AW(WC_TABCONTROL)
2626
2627 /* tab control styles */
2628 #define TCS_SCROLLOPPOSITE      0x0001   /* assumes multiline tab */
2629 #define TCS_BOTTOM              0x0002
2630 #define TCS_RIGHT               0x0002
2631 #define TCS_MULTISELECT         0x0004  /* allow multi-select in button mode */
2632 #define TCS_FLATBUTTONS         0x0008
2633 #define TCS_FORCEICONLEFT       0x0010
2634 #define TCS_FORCELABELLEFT      0x0020
2635 #define TCS_HOTTRACK            0x0040
2636 #define TCS_VERTICAL            0x0080
2637 #define TCS_TABS                0x0000
2638 #define TCS_BUTTONS             0x0100
2639 #define TCS_SINGLELINE          0x0000
2640 #define TCS_MULTILINE           0x0200
2641 #define TCS_RIGHTJUSTIFY        0x0000
2642 #define TCS_FIXEDWIDTH          0x0400
2643 #define TCS_RAGGEDRIGHT         0x0800
2644 #define TCS_FOCUSONBUTTONDOWN   0x1000
2645 #define TCS_OWNERDRAWFIXED      0x2000
2646 #define TCS_TOOLTIPS            0x4000
2647 #define TCS_FOCUSNEVER          0x8000
2648 #define TCS_EX_FLATSEPARATORS   0x00000001  /* to be used with */
2649 #define TCS_EX_REGISTERDROP     0x00000002  /* TCM_SETEXTENDEDSTYLE */
2650
2651
2652 #define TCM_FIRST               0x1300
2653
2654 #define TCM_GETIMAGELIST        (TCM_FIRST + 2)
2655 #define TCM_SETIMAGELIST        (TCM_FIRST + 3)
2656 #define TCM_GETITEMCOUNT        (TCM_FIRST + 4)
2657 #define TCM_GETITEM                             WINELIB_NAME_AW(TCM_GETITEM)
2658 #define TCM_GETITEMA                    (TCM_FIRST + 5)
2659 #define TCM_GETITEMW                    (TCM_FIRST + 60)
2660 #define TCM_SETITEMA                    (TCM_FIRST + 6)
2661 #define TCM_SETITEMW                    (TCM_FIRST + 61)
2662 #define TCM_SETITEM                             WINELIB_NAME_AW(TCM_SETITEM)
2663 #define TCM_INSERTITEMA         (TCM_FIRST + 7)
2664 #define TCM_INSERTITEMW         (TCM_FIRST + 62)
2665 #define TCM_INSERTITEM                  WINELIB_NAME_AW(TCM_INSERTITEM)
2666 #define TCM_DELETEITEM          (TCM_FIRST + 8)
2667 #define TCM_DELETEALLITEMS      (TCM_FIRST + 9)
2668 #define TCM_GETITEMRECT         (TCM_FIRST + 10)
2669 #define TCM_GETCURSEL           (TCM_FIRST + 11)
2670 #define TCM_SETCURSEL           (TCM_FIRST + 12)
2671 #define TCM_HITTEST             (TCM_FIRST + 13)
2672 #define TCM_SETITEMEXTRA        (TCM_FIRST + 14)
2673 #define TCM_ADJUSTRECT          (TCM_FIRST + 40)
2674 #define TCM_SETITEMSIZE         (TCM_FIRST + 41)
2675 #define TCM_REMOVEIMAGE         (TCM_FIRST + 42)
2676 #define TCM_SETPADDING          (TCM_FIRST + 43)
2677 #define TCM_GETROWCOUNT         (TCM_FIRST + 44)
2678 #define TCM_GETTOOLTIPS         (TCM_FIRST + 45)
2679 #define TCM_SETTOOLTIPS         (TCM_FIRST + 46)
2680 #define TCM_GETCURFOCUS         (TCM_FIRST + 47)
2681 #define TCM_SETCURFOCUS         (TCM_FIRST + 48)
2682 #define TCM_SETMINTTABWIDTH     (TCM_FIRST + 49)
2683 #define TCM_DESELECTALL         (TCM_FIRST + 50)
2684 #define TCM_HIGHLIGHTITEM               (TCM_FIRST + 51)
2685 #define TCM_SETEXTENDEDSTYLE    (TCM_FIRST + 52)
2686 #define TCM_GETEXTENDEDSTYLE    (TCM_FIRST + 53)
2687 #define TCM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
2688 #define TCM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
2689
2690
2691 #define TCIF_TEXT               0x0001
2692 #define TCIF_IMAGE              0x0002
2693 #define TCIF_RTLREADING         0x0004
2694 #define TCIF_PARAM              0x0008
2695 #define TCIF_STATE              0x0010
2696
2697 #define TCIS_BUTTONPRESSED      0x0001
2698 #define TCIS_HIGHLIGHTED 0x0002
2699
2700 /* TabCtrl Macros */
2701 #define TabCtrl_GetImageList(hwnd) \
2702     (HIMAGELIST)SendMessageA((hwnd), TCM_GETIMAGELIST, 0, 0L)
2703 #define TabCtrl_SetImageList(hwnd, himl) \
2704     (HIMAGELIST)SendMessageA((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl))
2705 #define TabCtrl_GetItemCount(hwnd) \
2706     (int)SendMessageA((hwnd), TCM_GETITEMCOUNT, 0, 0L)
2707 #define TabCtrl_GetItemA(hwnd, iItem, pitem) \
2708     (BOOL)SendMessageA((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem))
2709 #define TabCtrl_GetItemW(hwnd, iItem, pitem) \
2710     (BOOL)SendMessageW((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem))
2711 #define TabCtrl_GetItem WINELIB_NAME_AW(TabCtrl_GetItem)
2712 #define TabCtrl_SetItemA(hwnd, iItem, pitem) \
2713     (BOOL)SendMessageA((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem))
2714 #define TabCtrl_SetItemW(hwnd, iItem, pitem) \
2715     (BOOL)SendMessageW((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem))
2716 #define TabCtrl_SetItem WINELIB_NAME_AW(TabCtrl_GetItem)
2717 #define TabCtrl_InsertItemA(hwnd, iItem, pitem)   \
2718     (int)SendMessageA((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM *)(pitem))
2719 #define TabCtrl_InsertItemW(hwnd, iItem, pitem)   \
2720     (int)SendMessageW((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM *)(pitem))
2721 #define TabCtrl_InsertItem WINELIB_NAME_AW(TabCtrl_InsertItem)
2722 #define TabCtrl_DeleteItem(hwnd, i) \
2723     (BOOL)SendMessageA((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L)
2724 #define TabCtrl_DeleteAllItems(hwnd) \
2725     (BOOL)SendMessageA((hwnd), TCM_DELETEALLITEMS, 0, 0L)
2726 #define TabCtrl_GetItemRect(hwnd, i, prc) \
2727     (BOOL)SendMessageA((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT *)(prc))
2728 #define TabCtrl_GetCurSel(hwnd) \
2729     (int)SendMessageA((hwnd), TCM_GETCURSEL, 0, 0)
2730 #define TabCtrl_SetCurSel(hwnd, i) \
2731     (int)SendMessageA((hwnd), TCM_SETCURSEL, (WPARAM)i, 0)
2732 #define TabCtrl_HitTest(hwndTC, pinfo) \
2733     (int)SendMessageA((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO *)(pinfo))
2734 #define TabCtrl_SetItemExtra(hwndTC, cb) \
2735     (BOOL)SendMessageA((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L)
2736 #define TabCtrl_AdjustRect(hwnd, bLarger, prc) \
2737     (int)SendMessageA(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT *)prc)
2738 #define TabCtrl_SetItemSize(hwnd, x, y) \
2739     (DWORD)SendMessageA((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y))
2740 #define TabCtrl_RemoveImage(hwnd, i) \
2741     (void)SendMessageA((hwnd), TCM_REMOVEIMAGE, i, 0L)
2742 #define TabCtrl_SetPadding(hwnd,  cx, cy) \
2743     (void)SendMessageA((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
2744 #define TabCtrl_GetRowCount(hwnd) \
2745     (int)SendMessageA((hwnd), TCM_GETROWCOUNT, 0, 0L)
2746 #define TabCtrl_GetToolTips(hwnd) \
2747     (HWND)SendMessageA((hwnd), TCM_GETTOOLTIPS, 0, 0L)
2748 #define TabCtrl_SetToolTips(hwnd, hwndTT) \
2749     (void)SendMessageA((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L)
2750 #define TabCtrl_GetCurFocus(hwnd) \
2751     (int)SendMessageA((hwnd), TCM_GETCURFOCUS, 0, 0)
2752 #define TabCtrl_SetCurFocus(hwnd, i) \
2753     SendMessageA((hwnd),TCM_SETCURFOCUS, i, 0)
2754 #define TabCtrl_SetMinTabWidth(hwnd, x) \
2755     (int)SendMessageA((hwnd), TCM_SETMINTABWIDTH, 0, x)
2756 #define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\
2757     (void)SendMessageA((hwnd), TCM_DESELECTALL, fExcludeFocus, 0)
2758
2759
2760 /* constants for TCHITTESTINFO */
2761
2762 #define TCHT_NOWHERE      0x01
2763 #define TCHT_ONITEMICON   0x02
2764 #define TCHT_ONITEMLABEL  0x04
2765 #define TCHT_ONITEM       (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
2766
2767
2768 typedef struct tagTCITEMA {
2769     UINT mask;
2770     UINT dwState;
2771     UINT dwStateMask;
2772     LPSTR  pszText;
2773     INT  cchTextMax;
2774     INT  iImage;
2775     LPARAM lParam;
2776 } TCITEMA, *LPTCITEMA;
2777
2778 typedef struct tagTCITEMW
2779 {
2780     UINT mask;
2781     DWORD  dwState;
2782     DWORD  dwStateMask;
2783     LPWSTR pszText;
2784     INT  cchTextMax;
2785     INT  iImage;
2786     LPARAM lParam;
2787 } TCITEMW, *LPTCITEMW;
2788
2789 #define TCITEM   WINELIB_NAME_AW(TCITEM)
2790 #define LPTCITEM WINELIB_NAME_AW(LPTCITEM)
2791 #define TC_ITEM  TCITEM
2792
2793 #define TCN_FIRST               (0U-550U)
2794 #define TCN_LAST                (0U-580U)
2795 #define TCN_KEYDOWN             (TCN_FIRST - 0)
2796 #define TCN_SELCHANGE           (TCN_FIRST - 1)
2797 #define TCN_SELCHANGING         (TCN_FIRST - 2)
2798 #define TCN_GETOBJECT      (TCN_FIRST - 3)
2799
2800
2801 /* ComboBoxEx control */
2802
2803 #define WC_COMBOBOXEXA        "ComboBoxEx32"
2804 #define WC_COMBOBOXEXW        L"ComboBoxEx32"
2805 #define WC_COMBOBOXEX           WINELIB_NAME_AW(WC_COMBOBOXEX)
2806
2807 #define CBEM_INSERTITEMA      (WM_USER+1)
2808 #define CBEM_INSERTITEMW      (WM_USER+11)
2809 #define CBEM_INSERTITEM         WINELIB_NAME_AW(CBEM_INSERTITEM)
2810 #define CBEM_SETIMAGELIST       (WM_USER+2)
2811 #define CBEM_GETIMAGELIST       (WM_USER+3)
2812 #define CBEM_GETITEMA         (WM_USER+4)
2813 #define CBEM_GETITEMW         (WM_USER+13)
2814 #define CBEM_GETITEM            WINELIB_NAME_AW(CBEM_GETITEM)
2815 #define CBEM_SETITEMA         (WM_USER+5)
2816 #define CBEM_SETITEMW         (WM_USER+12)
2817 #define CBEM_SETITEM            WINELIB_NAME_AW(CBEM_SETITEM)
2818 #define CBEM_GETCOMBOCONTROL    (WM_USER+6)
2819 #define CBEM_GETEDITCONTROL     (WM_USER+7)
2820 #define CBEM_SETEXSTYLE         (WM_USER+8)
2821 #define CBEM_GETEXSTYLE         (WM_USER+9)
2822 #define CBEM_GETEXTENDEDSTYLE   (WM_USER+9)
2823 #define CBEM_SETEXTENDEDSTYLE   (WM_USER+14)
2824 #define CBEM_HASEDITCHANGED     (WM_USER+10)
2825 #define CBEM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
2826 #define CBEM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
2827
2828 #define CBEN_FIRST              (0U-800U)
2829 #define CBEN_LAST               (0U-830U)
2830
2831
2832 /* Hotkey control */
2833
2834 #define HOTKEY_CLASS16          "msctls_hotkey"
2835 #define HOTKEY_CLASSA         "msctls_hotkey32"
2836 #define HOTKEY_CLASSW         L"msctls_hotkey32"
2837 #define HOTKEY_CLASS            WINELIB_NAME_AW(HOTKEY_CLASS)
2838
2839 #define HOTKEYF_SHIFT           0x01
2840 #define HOTKEYF_CONTROL         0x02
2841 #define HOTKEYF_ALT             0x04
2842 #define HOTKEYF_EXT             0x08
2843
2844 #define HKCOMB_NONE             0x0001
2845 #define HKCOMB_S                0x0002
2846 #define HKCOMB_C                0x0004
2847 #define HKCOMB_A                0x0008
2848 #define HKCOMB_SC               0x0010
2849 #define HKCOMB_SA               0x0020
2850 #define HKCOMB_CA               0x0040
2851 #define HKCOMB_SCA              0x0080
2852
2853 #define HKM_SETHOTKEY           (WM_USER+1)
2854 #define HKM_GETHOTKEY           (WM_USER+2)
2855 #define HKM_SETRULES            (WM_USER+3)
2856
2857
2858 /* animate control */
2859
2860 #define ANIMATE_CLASSA        "SysAnimate32"
2861 #define ANIMATE_CLASSW        L"SysAnimate32"
2862 #define ANIMATE_CLASS           WINELIB_NAME_AW(ANIMATE_CLASS)
2863
2864 #define ACS_CENTER              0x0001
2865 #define ACS_TRANSPARENT         0x0002
2866 #define ACS_AUTOPLAY            0x0004
2867 #define ACS_TIMER               0x0008  /* no threads, just timers */
2868
2869 #define ACM_OPENA             (WM_USER+100)
2870 #define ACM_OPENW             (WM_USER+103)
2871 #define ACM_OPEN                WINELIB_NAME_AW(ACM_OPEN)
2872 #define ACM_PLAY                (WM_USER+101)
2873 #define ACM_STOP                (WM_USER+102)
2874
2875 #define ACN_START               1
2876 #define ACN_STOP                2
2877
2878 #define Animate_CreateA(hwndP,id,dwStyle,hInstance) \
2879     CreateWindowA(ANIMATE_CLASSA,NULL,dwStyle,0,0,0,0,hwndP,(HMENU)(id),hInstance,NULL)
2880 #define Animate_CreateW(hwndP,id,dwStyle,hInstance) \
2881     CreateWindowW(ANIMATE_CLASSW,NULL,dwStyle,0,0,0,0,hwndP,(HMENU)(id),hInstance,NULL)
2882 #define Animate_Create WINELIB_NAME_AW(Animate_Create)
2883 #define Animate_OpenA(hwnd,szName) \
2884     (BOOL)SendMessageA(hwnd,ACM_OPENA,0,(LPARAM)(LPSTR)(szName))
2885 #define Animate_OpenW(hwnd,szName) \
2886     (BOOL)SendMessageW(hwnd,ACM_OPENW,0,(LPARAM)(LPWSTR)(szName))
2887 #define Animate_Open WINELIB_NAME_AW(Animate_Open)
2888 #define Animate_OpenExA(hwnd,hInst,szName) \
2889     (BOOL)SendMessageA(hwnd,ACM_OPENA,(WPARAM)hInst,(LPARAM)(LPSTR)(szName))
2890 #define Animate_OpenExW(hwnd,hInst,szName) \
2891     (BOOL)SendMessageW(hwnd,ACM_OPENW,(WPARAM)hInst,(LPARAM)(LPWSTR)(szName))
2892 #define Animate_OpenEx WINELIB_NAME_AW(Animate_OpenEx)
2893 #define Animate_Play(hwnd,from,to,rep) \
2894     (BOOL)SendMessageA(hwnd,ACM_PLAY,(WPARAM)(UINT)(rep),(LPARAM)MAKELONG(from,to))
2895 #define Animate_Stop(hwnd) \
2896     (BOOL)SendMessageA(hwnd,ACM_STOP,0,0)
2897 #define Animate_Close(hwnd) \
2898     (BOOL)SendMessageA(hwnd,ACM_OPENA,0,0)
2899 #define Animate_Seek(hwnd,frame) \
2900     (BOOL)SendMessageA(hwnd,ACM_PLAY,1,(LPARAM)MAKELONG(frame,frame))
2901
2902
2903 /**************************************************************************
2904  * IP Address control
2905  */
2906
2907 #define WC_IPADDRESSA           "SysIPAddress32"
2908 #define WC_IPADDRESSW           L"SysIPAddress32"
2909 #define WC_IPADDRESS            WINELIB_NAME_AW(WC_IPADDRESS)
2910
2911 #define IPM_CLEARADDRESS        (WM_USER+100)
2912 #define IPM_SETADDRESS          (WM_USER+101)
2913 #define IPM_GETADDRESS          (WM_USER+102)
2914 #define IPM_SETRANGE            (WM_USER+103)
2915 #define IPM_SETFOCUS            (WM_USER+104)
2916 #define IPM_ISBLANK             (WM_USER+105)
2917
2918 #define IPN_FIRST               (0U-860U)
2919 #define IPN_LAST                (0U-879U)
2920 #define IPN_FIELDCHANGED    (IPN_FIRST-0)
2921
2922 typedef struct tagNMIPADDRESS
2923 {
2924     NMHDR hdr;
2925     INT iField;
2926     INT iValue;
2927 } NMIPADDRESS, *LPNMIPADDRESS;
2928
2929 #define MAKEIPRANGE(low,high) \
2930     ((LPARAM)(WORD)(((BYTE)(high)<<8)+(BYTE)(low)))
2931 #define MAKEIPADDRESS(b1,b2,b3,b4) \
2932     ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<16)+((DWORD)(b3)<<8)+((DWORD)(b4))))
2933
2934 #define FIRST_IPADDRESS(x)      (((x)>>24)&0xff)
2935 #define SECOND_IPADDRESS(x)     (((x)>>16)&0xff)
2936 #define THIRD_IPADDRESS(x)      (((x)>>8)&0xff)
2937 #define FOURTH_IPADDRESS(x)     ((x)&0xff)
2938
2939
2940 /**************************************************************************
2941  * Native Font control
2942  */
2943
2944 #define WC_NATIVEFONTCTLA       "NativeFontCtl"
2945 #define WC_NATIVEFONTCTLW       L"NativeFontCtl"
2946 #define WC_NATIVEFONTCTL        WINELIB_NAME_AW(WC_NATIVEFONTCTL)
2947
2948 #define NFS_EDIT                0x0001
2949 #define NFS_STATIC              0x0002
2950 #define NFS_LISTCOMBO           0x0004
2951 #define NFS_BUTTON              0x0008
2952 #define NFS_ALL                 0x0010
2953
2954
2955 /**************************************************************************
2956  * Month calendar control
2957  *
2958  */
2959
2960 #define MONTHCAL_CLASSA "SysMonthCal32"
2961 #define MONTHCAL_CLASSW L"SysMonthCal32"
2962 #define MONTHCAL_CLASS          WINELIB_NAME_AW(MONTHCAL_CLASS)
2963
2964 #define MCM_FIRST             0x1000
2965 #define MCN_FIRST             (0U-750U)
2966 #define MCN_LAST              (0U-759U)
2967
2968
2969 #define MCM_GETCURSEL         (MCM_FIRST + 1)
2970 #define MCM_SETCURSEL         (MCM_FIRST + 2)
2971 #define MCM_GETMAXSELCOUNT    (MCM_FIRST + 3)
2972 #define MCM_SETMAXSELCOUNT    (MCM_FIRST + 4)
2973 #define MCM_GETSELRANGE       (MCM_FIRST + 5)
2974 #define MCM_SETSELRANGE       (MCM_FIRST + 6)
2975 #define MCM_GETMONTHRANGE     (MCM_FIRST + 7)
2976 #define MCM_SETDAYSTATE       (MCM_FIRST + 8)
2977 #define MCM_GETMINREQRECT     (MCM_FIRST + 9)
2978 #define MCM_SETCOLOR          (MCM_FIRST + 10)
2979 #define MCM_GETCOLOR          (MCM_FIRST + 11)
2980 #define MCM_SETTODAY          (MCM_FIRST + 12)
2981 #define MCM_GETTODAY          (MCM_FIRST + 13)
2982 #define MCM_HITTEST           (MCM_FIRST + 14)
2983 #define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15)
2984 #define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16)
2985 #define MCM_GETRANGE          (MCM_FIRST + 17)
2986 #define MCM_SETRANGE          (MCM_FIRST + 18)
2987 #define MCM_GETMONTHDELTA     (MCM_FIRST + 19)
2988 #define MCM_SETMONTHDELTA     (MCM_FIRST + 20)
2989 #define MCM_GETMAXTODAYWIDTH  (MCM_FIRST + 21)
2990 #define MCM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
2991 #define MCM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
2992
2993
2994 /* Notifications */
2995
2996 #define MCN_SELCHANGE         (MCN_FIRST + 1)
2997 #define MCN_GETDAYSTATE       (MCN_FIRST + 3)
2998 #define MCN_SELECT            (MCN_FIRST + 4)
2999
3000 #define MCSC_BACKGROUND   0   
3001 #define MCSC_TEXT         1   
3002 #define MCSC_TITLEBK      2   
3003 #define MCSC_TITLETEXT    3
3004 #define MCSC_MONTHBK      4   
3005 #define MCSC_TRAILINGTEXT 5   
3006
3007 #define MCS_DAYSTATE           0x0001
3008 #define MCS_MULTISELECT        0x0002
3009 #define MCS_WEEKNUMBERS        0x0004
3010 #define MCS_NOTODAY            0x0010
3011 #define MCS_NOTODAYCIRCLE      0x0008
3012
3013 #define MCHT_TITLE             0x00010000
3014 #define MCHT_CALENDAR          0x00020000
3015 #define MCHT_TODAYLINK         0x00030000
3016
3017 #define MCHT_NEXT              0x01000000   
3018 #define MCHT_PREV              0x02000000  
3019 #define MCHT_NOWHERE           0x00000000
3020 #define MCHT_TITLEBK           (MCHT_TITLE)
3021 #define MCHT_TITLEMONTH        (MCHT_TITLE | 0x0001)
3022 #define MCHT_TITLEYEAR         (MCHT_TITLE | 0x0002)
3023 #define MCHT_TITLEBTNNEXT      (MCHT_TITLE | MCHT_NEXT | 0x0003)
3024 #define MCHT_TITLEBTNPREV      (MCHT_TITLE | MCHT_PREV | 0x0003)
3025
3026 #define MCHT_CALENDARBK        (MCHT_CALENDAR)
3027 #define MCHT_CALENDARDATE      (MCHT_CALENDAR | 0x0001)
3028 #define MCHT_CALENDARDATENEXT  (MCHT_CALENDARDATE | MCHT_NEXT)
3029 #define MCHT_CALENDARDATEPREV  (MCHT_CALENDARDATE | MCHT_PREV)
3030 #define MCHT_CALENDARDAY       (MCHT_CALENDAR | 0x0002)
3031 #define MCHT_CALENDARWEEKNUM   (MCHT_CALENDAR | 0x0003)
3032
3033
3034
3035 #define GMR_VISIBLE     0      
3036 #define GMR_DAYSTATE    1     
3037
3038
3039 /*  Month calendar's structures */
3040
3041
3042 typedef struct {
3043         UINT cbSize;
3044         POINT pt;
3045         UINT uHit;   
3046         SYSTEMTIME st;
3047 } MCHITTESTINFO, *PMCHITTESTINFO;
3048
3049 typedef struct tagNMSELCHANGE
3050 {
3051     NMHDR           nmhdr; 
3052     SYSTEMTIME      stSelStart;
3053     SYSTEMTIME      stSelEnd;
3054 } NMSELCHANGE, *LPNMSELCHANGE;
3055
3056 typedef NMSELCHANGE NMSELECT, *LPNMSELECT;
3057 typedef DWORD MONTHDAYSTATE, *LPMONTHDAYSTATE;
3058
3059 typedef struct tagNMDAYSTATE
3060 {
3061     NMHDR           nmhdr;  
3062     SYSTEMTIME      stStart;
3063     int             cDayState;
3064     LPMONTHDAYSTATE prgDayState;
3065 } NMDAYSTATE, *LPNMDAYSTATE;
3066
3067
3068 /* macros */
3069
3070 #define MonthCal_GetCurSel(hmc, pst) \
3071                 (BOOL)SendMessageA(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst))
3072 #define MonthCal_SetCurSel(hmc, pst)  \
3073                 (BOOL)SendMessageA(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst))
3074 #define MonthCal_GetMaxSelCount(hmc) \
3075                 (DWORD)SendMessageA(hmc, MCM_GETMAXSELCOUNT, 0, 0L)
3076 #define MonthCal_SetMaxSelCount(hmc, n) \
3077                 (BOOL)SendMessageA(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L)
3078 #define MonthCal_GetSelRange(hmc, rgst) \
3079                 SendMessageA(hmc, MCM_GETSELRANGE, 0, (LPARAM) (rgst))
3080 #define MonthCal_SetSelRange(hmc, rgst) \
3081                 SendMessageA(hmc, MCM_SETSELRANGE, 0, (LPARAM) (rgst))
3082 #define MonthCal_GetMonthRange(hmc, gmr, rgst) \
3083                 (DWORD)SendMessageA(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst))
3084 #define MonthCal_SetDayState(hmc, cbds, rgds) \
3085                 SendMessageA(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds))
3086 #define MonthCal_GetMinReqRect(hmc, prc) \
3087                 SendMessageA(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc))
3088 #define MonthCal_SetColor(hmc, iColor, clr)\
3089                 SendMessageA(hmc, MCM_SETCOLOR, iColor, clr
3090 #define MonthCal_GetColor(hmc, iColor) \
3091                 SendMessageA(hmc, MCM_SETCOLOR, iColor, 0)
3092 #define MonthCal_GetToday(hmc, pst)\
3093                 (BOOL)SendMessageA(hmc, MCM_GETTODAY, 0, (LPARAM)pst)
3094 #define MonthCal_SetToday(hmc, pst)\
3095                 SendMessageA(hmc, MCM_SETTODAY, 0, (LPARAM)pst)
3096 #define MonthCal_HitTest(hmc, pinfo) \
3097         SendMessageA(hmc, MCM_HITTEST, 0, (LPARAM)(PMCHITTESTINFO)pinfo)
3098 #define MonthCal_SetFirstDayOfWeek(hmc, iDay) \
3099         SendMessageA(hmc, MCM_SETFIRSTDAYOFWEEK, 0, iDay)
3100 #define MonthCal_GetFirstDayOfWeek(hmc) \
3101         (DWORD)SendMessageA(hmc, MCM_GETFIRSTDAYOFWEEK, 0, 0)
3102 #define MonthCal_GetRange(hmc, rgst) \
3103         (DWORD)SendMessageA(hmc, MCM_GETRANGE, 0, (LPARAM)(rgst))
3104 #define MonthCal_SetRange(hmc, gd, rgst) \
3105         (BOOL)SendMessageA(hmc, MCM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
3106 #define MonthCal_GetMonthDelta(hmc) \
3107         (int)SendMessageA(hmc, MCM_GETMONTHDELTA, 0, 0)
3108 #define MonthCal_SetMonthDelta(hmc, n) \
3109         (int)SendMessageA(hmc, MCM_SETMONTHDELTA, n, 0)
3110 #define MonthCal_GetMaxTodayWidth(hmc) \
3111         (DWORD)SendMessageA(hmc, MCM_GETMAXTODAYWIDTH, 0, 0)
3112 #define MonthCal_SetUnicodeFormat(hwnd, fUnicode)  \
3113         (BOOL)SendMessageA((hwnd), MCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
3114 #define MonthCal_GetUnicodeFormat(hwnd)  \
3115         (BOOL)SendMessageA((hwnd), MCM_GETUNICODEFORMAT, 0, 0)
3116
3117
3118 /**************************************************************************
3119  * Date and time picker control
3120  */
3121
3122 #define DATETIMEPICK_CLASSA     "SysDateTimePick32"
3123 #define DATETIMEPICK_CLASSW     L"SysDateTimePick32"
3124 #define DATETIMEPICK_CLASS      WINELIB_NAME_AW(DATETIMEPICK_CLASS)
3125
3126 #define DTM_FIRST        0x1000
3127 #define DTN_FIRST       (0U-760U)     
3128 #define DTN_LAST        (0U-799U)
3129
3130
3131 #define DTM_GETSYSTEMTIME       (DTM_FIRST+1)
3132 #define DTM_SETSYSTEMTIME       (DTM_FIRST+2)
3133 #define DTM_GETRANGE            (DTM_FIRST+3)
3134 #define DTM_SETRANGE            (DTM_FIRST+4)
3135 #define DTM_SETFORMATA      (DTM_FIRST+5)
3136 #define DTM_SETFORMATW      (DTM_FIRST + 50)
3137 #define DTM_SETFORMAT           WINELIB_NAME_AW(DTM_SETFORMAT)
3138 #define DTM_SETMCCOLOR          (DTM_FIRST+6)
3139 #define DTM_GETMCCOLOR          (DTM_FIRST+7)
3140 #define DTM_GETMONTHCAL         (DTM_FIRST+8)
3141 #define DTM_SETMCFONT           (DTM_FIRST+9)
3142 #define DTM_GETMCFONT           (DTM_FIRST+10)
3143
3144
3145 /* Datetime Notifications */
3146
3147 #define DTN_DATETIMECHANGE  (DTN_FIRST + 1) 
3148 #define DTN_USERSTRINGA     (DTN_FIRST + 2) 
3149 #define DTN_WMKEYDOWNA      (DTN_FIRST + 3) 
3150 #define DTN_FORMATA         (DTN_FIRST + 4) 
3151 #define DTN_FORMATQUERYA    (DTN_FIRST + 5) 
3152 #define DTN_DROPDOWN        (DTN_FIRST + 6)
3153 #define DTN_CLOSEUP         (DTN_FIRST + 7) 
3154 #define DTN_USERSTRINGW     (DTN_FIRST + 15)
3155 #define DTN_WMKEYDOWNW      (DTN_FIRST + 16)
3156 #define DTN_FORMATW         (DTN_FIRST + 17)
3157 #define DTN_FORMATQUERYW    (DTN_FIRST + 18)
3158
3159
3160 #define DTS_SHORTDATEFORMAT 0x0000 
3161 #define DTS_UPDOWN          0x0001 
3162 #define DTS_SHOWNONE        0x0002 
3163 #define DTS_LONGDATEFORMAT  0x0004 
3164 #define DTS_TIMEFORMAT      0x0009 
3165 #define DTS_APPCANPARSE     0x0010 
3166 #define DTS_RIGHTALIGN      0x0020 
3167
3168 typedef struct tagNMDATETIMECHANGE
3169 {
3170     NMHDR       nmhdr;
3171     DWORD       dwFlags;    
3172     SYSTEMTIME  st;         
3173 } NMDATETIMECHANGE, *LPNMDATETIMECHANGE;
3174
3175 typedef struct tagNMDATETIMESTRINGA
3176 {
3177     NMHDR      nmhdr;
3178     LPCSTR     pszUserString; 
3179     SYSTEMTIME st;      
3180     DWORD      dwFlags;  
3181 } NMDATETIMESTRINGA, *LPNMDATETIMESTRINGA;
3182
3183 typedef struct tagNMDATETIMESTRINGW
3184 {
3185     NMHDR      nmhdr;
3186     LPCWSTR    pszUserString;
3187     SYSTEMTIME st;          
3188     DWORD      dwFlags;    
3189 } NMDATETIMESTRINGW, *LPNMDATETIMESTRINGW;
3190
3191
3192 typedef struct tagNMDATETIMEWMKEYDOWNA
3193 {
3194     NMHDR      nmhdr;
3195     int        nVirtKey;  
3196     LPCSTR     pszFormat; 
3197     SYSTEMTIME st;       
3198 } NMDATETIMEWMKEYDOWNA, *LPNMDATETIMEWMKEYDOWNA;
3199
3200 typedef struct tagNMDATETIMEWMKEYDOWNW
3201 {
3202     NMHDR      nmhdr;
3203     int        nVirtKey;  
3204     LPCWSTR    pszFormat; 
3205     SYSTEMTIME st;       
3206 } NMDATETIMEWMKEYDOWNW, *LPNMDATETIMEWMKEYDOWNW;
3207
3208
3209
3210 typedef struct tagNMDATETIMEFORMATA
3211 {
3212     NMHDR nmhdr;
3213     LPCSTR  pszFormat;   
3214     SYSTEMTIME st;      
3215     LPCSTR pszDisplay;  
3216     CHAR szDisplay[64]; 
3217 } NMDATETIMEFORMATA, *LPNMDATETIMEFORMATA;
3218
3219
3220 typedef struct tagNMDATETIMEFORMATW
3221 {
3222     NMHDR nmhdr;
3223     LPCWSTR pszFormat;  
3224     SYSTEMTIME st;     
3225     LPCWSTR pszDisplay;
3226     WCHAR szDisplay[64];
3227 } NMDATETIMEFORMATW, *LPNMDATETIMEFORMATW;
3228
3229
3230
3231 typedef struct tagNMDATETIMEFORMATQUERYA
3232 {
3233     NMHDR nmhdr;
3234     LPCSTR pszFormat; 
3235     SIZE szMax;       
3236 } NMDATETIMEFORMATQUERYA, *LPNMDATETIMEFORMATQUERYA;
3237
3238 typedef struct tagNMDATETIMEFORMATQUERYW
3239 {
3240     NMHDR nmhdr;
3241     LPCWSTR pszFormat; 
3242     SIZE szMax;        
3243 } NMDATETIMEFORMATQUERYW, *LPNMDATETIMEFORMATQUERYW;
3244
3245
3246 #define NMDATETIMESTRING WINELIB_NAME_AW(NMDATETIMESTRING)
3247 #define NMDATETIMEWMKEYDOWN WINELIB_NAME_AW(NMDATETIMEWMKEYDOWN)
3248 #define NMDATETIMEFORMAT WINELIB_NAME_AW(NMDATETIMEFORMAT)
3249 #define NMDATETIMEFORMATQUERY WINELIB_NAME_AW(NMDATETIMEFORMATQUERY)
3250
3251
3252
3253
3254
3255 #define GDT_ERROR    -1
3256 #define GDT_VALID    0
3257 #define GDT_NONE     1
3258
3259 #define GDTR_MIN     0x0001
3260 #define GDTR_MAX     0x0002
3261
3262
3263 #define DateTime_GetSystemtime(hdp, pst)   \\
3264   (DWORD)SendMessageA (hdp, DTM_GETSYSTEMTIME , 0, (LPARAM)(pst)) 
3265 #define DateTime_SetSystemtime(hdp, gd, pst)   \\
3266   (BOOL)SendMessageA (hdp, DTM_SETSYSTEMTIME, (LPARAM)(gd), (LPARAM)(pst))
3267 #define DateTime_GetRange(hdp, rgst)  \\
3268   (DWORD)SendMessageA (hdp, DTM_GETRANGE, 0, (LPARAM)(rgst)) 
3269 #define DateTime_SetRange(hdp, gd, rgst) \\
3270    (BOOL)SendMessageA (hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
3271 #define DateTime_SetFormat WINELIB_NAME_AW(DateTime_SetFormat)
3272 #define DateTime_SetFormatA(hdp, sz)  \\
3273   (BOOL)SendMessageA (hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
3274 #define DateTime_SetFormatW(hdp, sz)  \\
3275   (BOOL)SendMessageW (hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
3276 #define DateTime_GetMonthCalColor(hdp, iColor) \\
3277   SendMessageA (hdp, DTM_GETMCCOLOR, iColor, 0)
3278 #define DateTime_GetMonthCal(hdp)  \\
3279   (HWND) SendMessageA (hdp, DTM_GETMONTHCAL, 0, 0)
3280 #define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) \\
3281   SendMessageA (hdp, DTM_SETMCFONT, (WPARAM)hfont, (LPARAM)fRedraw)
3282 #define DateTime_GetMonthCalFont(hdp) \\
3283   SendMessageA (hdp, DTM_GETMCFONT, 0, 0)
3284
3285
3286
3287
3288
3289
3290 /**************************************************************************
3291  *  UNDOCUMENTED functions
3292  */
3293
3294 /* private heap memory functions */
3295
3296 LPVOID WINAPI COMCTL32_Alloc (DWORD);
3297 LPVOID WINAPI COMCTL32_ReAlloc (LPVOID, DWORD);
3298 BOOL WINAPI COMCTL32_Free (LPVOID);
3299 DWORD  WINAPI COMCTL32_GetSize (LPVOID);
3300
3301
3302 INT  WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
3303 BOOL WINAPI Str_SetPtrA (LPSTR *, LPCSTR);
3304 INT  WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
3305 BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR);
3306 #define Str_GetPtr WINELIB_NAME_AW(Str_GetPtr)
3307 #define Str_SetPtr WINELIB_NAME_AW(Str_SetPtr)
3308
3309
3310 /* Dynamic Storage Array */
3311
3312 typedef struct _DSA
3313 {
3314     INT  nItemCount;
3315     LPVOID pData;
3316     INT  nMaxCount;
3317     INT  nItemSize;
3318     INT  nGrow;
3319 } DSA, *HDSA;
3320
3321 HDSA   WINAPI DSA_Create (INT, INT);
3322 BOOL WINAPI DSA_DeleteAllItems (const HDSA);
3323 INT  WINAPI DSA_DeleteItem (const HDSA, INT);
3324 BOOL WINAPI DSA_Destroy (const HDSA);
3325 BOOL WINAPI DSA_GetItem (const HDSA, INT, LPVOID);
3326 LPVOID WINAPI DSA_GetItemPtr (const HDSA, INT);
3327 INT  WINAPI DSA_InsertItem (const HDSA, INT, LPVOID);
3328 BOOL WINAPI DSA_SetItem (const HDSA, INT, LPVOID);
3329
3330 typedef INT (CALLBACK *DSAENUMPROC)(LPVOID, DWORD);
3331 VOID   WINAPI DSA_EnumCallback (const HDSA, DSAENUMPROC, LPARAM);
3332 BOOL WINAPI DSA_DestroyCallback (const HDSA, DSAENUMPROC, LPARAM);
3333
3334
3335 /* Dynamic Pointer Array */
3336
3337 typedef struct _DPA
3338 {
3339     INT    nItemCount;
3340     LPVOID   *ptrs; 
3341     HANDLE hHeap;
3342     INT    nGrow;
3343     INT    nMaxCount;
3344 } DPA, *HDPA;
3345
3346 HDPA   WINAPI DPA_Create (INT);
3347 HDPA   WINAPI DPA_CreateEx (INT, HANDLE);
3348 BOOL WINAPI DPA_Destroy (const HDPA);
3349 HDPA   WINAPI DPA_Clone (const HDPA, const HDPA);
3350 LPVOID WINAPI DPA_GetPtr (const HDPA, INT);
3351 INT  WINAPI DPA_GetPtrIndex (const HDPA, LPVOID);
3352 BOOL WINAPI DPA_Grow (const HDPA, INT);
3353 BOOL WINAPI DPA_SetPtr (const HDPA, INT, LPVOID);
3354 INT  WINAPI DPA_InsertPtr (const HDPA, INT, LPVOID);
3355 LPVOID WINAPI DPA_DeletePtr (const HDPA, INT);
3356 BOOL WINAPI DPA_DeleteAllPtrs (const HDPA);
3357
3358 typedef INT (CALLBACK *PFNDPACOMPARE)(LPVOID, LPVOID, LPARAM);
3359 BOOL WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM);
3360
3361 #define DPAS_SORTED             0x0001
3362 #define DPAS_INSERTBEFORE       0x0002
3363 #define DPAS_INSERTAFTER        0x0004
3364  
3365 INT  WINAPI DPA_Search (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
3366
3367 #define DPAM_SORT               0x0001
3368
3369 typedef PVOID(CALLBACK *PFNDPAMERGE)(DWORD,PVOID,PVOID,LPARAM);
3370 BOOL WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM);
3371
3372 typedef INT (CALLBACK *DPAENUMPROC)(LPVOID, DWORD);
3373 VOID   WINAPI DPA_EnumCallback (const HDPA, DPAENUMPROC, LPARAM);
3374 BOOL WINAPI DPA_DestroyCallback (const HDPA, DPAENUMPROC, LPARAM);
3375
3376
3377 #define DPA_GetPtrCount(hdpa)  (*(INT*)(hdpa))
3378 #define DPA_GetPtrPtr(hdpa)    (*((LPVOID**)((BYTE*)(hdpa)+sizeof(INT))))
3379 #define DPA_FastGetPtr(hdpa,i) (DPA_GetPtrPtr(hdpa)[i])
3380
3381
3382 /* notification helper functions */
3383
3384 LRESULT WINAPI COMCTL32_SendNotify (HWND, HWND, UINT, LPNMHDR);
3385
3386 /* type and functionality of last parameter is still unknown */
3387 LRESULT WINAPI COMCTL32_SendNotifyEx (HWND, HWND, UINT, LPNMHDR, DWORD);
3388
3389 #ifdef __cplusplus
3390 }
3391 #endif
3392
3393 #endif  /* __WINE_COMMCTRL_H */
3394
3395