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