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