LPARAM in find dialog wm_initdialog is the find/replace structure, not
[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 typedef struct _NMTBCUSTOMDRAW
1040 {
1041     NMCUSTOMDRAW nmcd;
1042     HBRUSH hbrMonoDither;
1043     HBRUSH hbrLines;
1044     HPEN hpenLines;
1045     COLORREF clrText;
1046     COLORREF clrMark;
1047     COLORREF clrTextHighlight;
1048     COLORREF clrBtnFace;
1049     COLORREF clrBtnHighlight;
1050     COLORREF clrHighlightHotTrack;
1051     RECT rcText;
1052     int nStringBkMode;
1053     int nHLStringBkMode;
1054 } NMTBCUSTOMDRAW, *LPNMTBCUSTOMDRAW;
1055
1056 /* This is just for old CreateToolbar. */
1057 /* Don't use it in new programs. */
1058 typedef struct _OLDTBBUTTON {
1059     INT iBitmap;
1060     INT idCommand;
1061     BYTE  fsState;
1062     BYTE  fsStyle;
1063     BYTE  bReserved[2];
1064     DWORD dwData;
1065 } OLDTBBUTTON, *POLDTBBUTTON, *LPOLDTBBUTTON;
1066 typedef const OLDTBBUTTON *LPCOLDTBBUTTON;
1067
1068
1069 typedef struct _TBBUTTON {
1070     INT iBitmap;
1071     INT idCommand;
1072     BYTE  fsState;
1073     BYTE  fsStyle;
1074     BYTE  bReserved[2];
1075     DWORD dwData;
1076     INT iString;
1077 } TBBUTTON, *PTBBUTTON, *LPTBBUTTON;
1078 typedef const TBBUTTON *LPCTBBUTTON;
1079
1080
1081 typedef struct _COLORMAP {
1082     COLORREF from;
1083     COLORREF to;
1084 } COLORMAP, *LPCOLORMAP;
1085
1086
1087 typedef struct tagTBADDBITMAP {
1088     HINSTANCE hInst;
1089     UINT      nID;
1090 } TBADDBITMAP, *LPTBADDBITMAP;
1091
1092 #define HINST_COMMCTRL         ((HINSTANCE)-1)
1093 #define IDB_STD_SMALL_COLOR     0
1094 #define IDB_STD_LARGE_COLOR     1
1095 #define IDB_VIEW_SMALL_COLOR    4
1096 #define IDB_VIEW_LARGE_COLOR    5
1097 #define IDB_HIST_SMALL_COLOR    8
1098 #define IDB_HIST_LARGE_COLOR    9
1099
1100 #define STD_CUT                 0
1101 #define STD_COPY                1
1102 #define STD_PASTE               2
1103 #define STD_UNDO                3
1104 #define STD_REDOW               4
1105 #define STD_DELETE              5
1106 #define STD_FILENEW             6
1107 #define STD_FILEOPEN            7
1108 #define STD_FILESAVE            8
1109 #define STD_PRINTPRE            9
1110 #define STD_PROPERTIES          10
1111 #define STD_HELP                11
1112 #define STD_FIND                12
1113 #define STD_REPLACE             13
1114 #define STD_PRINT               14
1115
1116 #define VIEW_LARGEICONS         0
1117 #define VIEW_SMALLICONS         1
1118 #define VIEW_LIST               2
1119 #define VIEW_DETAILS            3
1120 #define VIEW_SORTNAME           4
1121 #define VIEW_SORTSIZE           5
1122 #define VIEW_SORTDATE           6
1123 #define VIEW_SORTTYPE           7
1124 #define VIEW_PARENTFOLDER       8
1125 #define VIEW_NETCONNECT         9
1126 #define VIEW_NETDISCONNECT      10
1127 #define VIEW_NEWFOLDER          11
1128 #define VIEW_VIEWMENU           12
1129
1130 #define HIST_BACK               0
1131 #define HIST_FORWARD            1
1132 #define HIST_FAVORITES          2
1133 #define HIST_ADDTOFAVORITES     3
1134 #define HIST_VIEWTREE           4
1135
1136 typedef struct tagTBSAVEPARAMSA {
1137     HKEY   hkr;
1138     LPCSTR pszSubKey;
1139     LPCSTR pszValueName;
1140 } TBSAVEPARAMSA, *LPTBSAVEPARAMSA;
1141
1142 typedef struct tagTBSAVEPARAMSW {
1143     HKEY   hkr;
1144     LPCWSTR pszSubKey;
1145     LPCWSTR pszValueName;
1146 } TBSAVEPARAMSAW, *LPTBSAVEPARAMSAW;
1147
1148 #define TBSAVEPARAMS   WINELIB_NAME_AW(TBSAVEPARAMS)
1149 #define LPTBSAVEPARAMS WINELIB_NAME_AW(LPTBSAVEPARAMS)
1150
1151 typedef struct
1152 {
1153     UINT cbSize;
1154     DWORD  dwMask;
1155     INT  idCommand;
1156     INT  iImage;
1157     BYTE   fsState;
1158     BYTE   fsStyle;
1159     WORD   cx;
1160     DWORD  lParam;
1161     LPSTR  pszText;
1162     INT  cchText;
1163 } TBBUTTONINFOA, *LPTBBUTTONINFOA;
1164
1165 typedef struct
1166 {
1167     UINT cbSize;
1168     DWORD  dwMask;
1169     INT  idCommand;
1170     INT  iImage;
1171     BYTE   fsState;
1172     BYTE   fsStyle;
1173     WORD   cx;
1174     DWORD  lParam;
1175     LPWSTR pszText;
1176     INT  cchText;
1177 } TBBUTTONINFOW, *LPTBBUTTONINFOW;
1178
1179 #define TBBUTTONINFO   WINELIB_NAME_AW(TBBUTTONINFO)
1180 #define LPTBBUTTONINFO WINELIB_NAME_AW(LPTBBUTTONINFO)
1181
1182 typedef struct tagNMTBHOTITEM
1183 {
1184     NMHDR hdr;
1185     int idOld;
1186     int idNew;
1187     DWORD dwFlags;
1188 } NMTBHOTITEM, *LPNMTBHOTITEM;
1189
1190 typedef struct tagNMTBGETINFOTIPA
1191 {
1192     NMHDR  hdr;
1193     LPSTR  pszText;
1194     INT  cchTextMax;
1195     INT  iItem;
1196     LPARAM lParam;
1197 } NMTBGETINFOTIPA, *LPNMTBGETINFOTIPA;
1198
1199 typedef struct tagNMTBGETINFOTIPW
1200 {
1201     NMHDR  hdr;
1202     LPWSTR pszText;
1203     INT  cchTextMax;
1204     INT  iItem;
1205     LPARAM lParam;
1206 } NMTBGETINFOTIPW, *LPNMTBGETINFOTIPW;
1207
1208 #define NMTBGETINFOTIP   WINELIB_NAME_AW(NMTBGETINFOFTIP)
1209 #define LPNMTBGETINFOTIP WINELIB_NAME_AW(LPNMTBGETINFOTIP)
1210
1211 typedef struct
1212 {
1213     NMHDR hdr;
1214     DWORD dwMask;
1215     int idCommand;
1216     DWORD lParam;
1217     int iImage;
1218     LPSTR pszText;
1219     int cchText;
1220 } NMTBDISPINFOA, *LPNMTBDISPINFOA;
1221
1222 typedef struct
1223 {
1224     NMHDR hdr;
1225     DWORD dwMask;
1226     int idCommand;
1227     DWORD lParam;
1228     int iImage;
1229     LPWSTR pszText;
1230     int cchText;
1231 } NMTBDISPINFOW, *LPNMTBDISPINFOW;
1232
1233 #define NMTBDISPINFO WINELIB_NAME_AW(NMTBDISPINFO)
1234 #define LPNMTBDISPINFO WINELIB_NAME_AW(LPNMTBDISPINFO)
1235
1236 typedef struct tagNMTOOLBARA
1237 {
1238     NMHDR    hdr;
1239     INT      iItem;
1240     TBBUTTON tbButton;
1241     INT      cchText;
1242     LPSTR    pszText;
1243     RECT     rcButton; /* Version 5.80 */
1244 } NMTOOLBARA, *LPNMTOOLBARA, TBNOTIFYA, *LPTBNOTIFYA;
1245
1246 typedef struct tagNMTOOLBARW
1247 {
1248     NMHDR    hdr;
1249     INT      iItem;
1250     TBBUTTON tbButton;
1251     INT      cchText;
1252     LPWSTR   pszText;
1253     RECT     rcButton; /* Version 5.80 */
1254 } NMTOOLBARW, *LPNMTOOLBARW, TBNOTIFYW, *LPTBNOTIFYW;
1255
1256 #define NMTOOLBAR   WINELIB_NAME_AW(NMTOOLBAR)
1257 #define LPNMTOOLBAR WINELIB_NAME_AW(LPNMTOOLBAR)
1258 #define TBNOTIFY    WINELIB_NAME_AW(TBNOTIFY)
1259 #define LPTBNOTIFY  WINELIB_NAME_AW(LPTBNOTIFY)
1260
1261 typedef struct
1262 {
1263         HINSTANCE hInstOld;
1264         UINT      nIDOld;
1265         HINSTANCE hInstNew;
1266         UINT      nIDNew;
1267         INT       nButtons;
1268 } TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
1269
1270 typedef struct 
1271 {
1272     int   iButton;
1273     DWORD dwFlags;
1274 } TBINSERTMARK, *LPTBINSERTMARK;
1275 #define TBIMHT_AFTER      0x00000001 /* TRUE = insert After iButton, otherwise before */
1276 #define TBIMHT_BACKGROUND 0x00000002 /* TRUE if and only if missed buttons completely */
1277
1278 HWND WINAPI
1279 CreateToolbar(HWND, DWORD, UINT, INT, HINSTANCE,
1280               UINT, LPCOLDTBBUTTON, INT); 
1281  
1282 HWND WINAPI
1283 CreateToolbarEx(HWND, DWORD, UINT, INT,
1284                 HINSTANCE, UINT, LPCTBBUTTON, 
1285                 INT, INT, INT, INT, INT, UINT); 
1286
1287 HBITMAP WINAPI
1288 CreateMappedBitmap (HINSTANCE, INT, UINT, LPCOLORMAP, INT); 
1289
1290
1291 /* Tool tips */
1292
1293 #define TOOLTIPS_CLASS16        "tooltips_class"
1294 #define TOOLTIPS_CLASSA         "tooltips_class32"
1295 static const WCHAR TOOLTIPS_CLASSW[] = { 't','o','o','l','t','i','p','s','_',
1296   'c','l','a','s','s','3','2',0 };
1297 #define TOOLTIPS_CLASS          WINELIB_NAME_AW(TOOLTIPS_CLASS)
1298
1299 #define INFOTIPSIZE             1024
1300  
1301 #define TTS_ALWAYSTIP           0x01
1302 #define TTS_NOPREFIX            0x02
1303
1304 #define TTF_IDISHWND            0x0001
1305 #define TTF_CENTERTIP           0x0002
1306 #define TTF_RTLREADING          0x0004
1307 #define TTF_SUBCLASS            0x0010
1308 #define TTF_TRACK               0x0020
1309 #define TTF_ABSOLUTE            0x0080
1310 #define TTF_TRANSPARENT         0x0100
1311 #define TTF_DI_SETITEM          0x8000  /* valid only on the TTN_NEEDTEXT callback */
1312
1313
1314 #define TTDT_AUTOMATIC          0
1315 #define TTDT_RESHOW             1
1316 #define TTDT_AUTOPOP            2
1317 #define TTDT_INITIAL            3
1318
1319
1320 #define TTM_ACTIVATE            (WM_USER+1)
1321 #define TTM_SETDELAYTIME        (WM_USER+3)
1322 #define TTM_ADDTOOLA          (WM_USER+4)
1323 #define TTM_ADDTOOLW          (WM_USER+50)
1324 #define TTM_ADDTOOL WINELIB_NAME_AW(TTM_ADDTOOL)
1325 #define TTM_DELTOOLA          (WM_USER+5)
1326 #define TTM_DELTOOLW          (WM_USER+51)
1327 #define TTM_DELTOOL WINELIB_NAME_AW(TTM_DELTOOL)
1328 #define TTM_NEWTOOLRECTA      (WM_USER+6)
1329 #define TTM_NEWTOOLRECTW      (WM_USER+52)
1330 #define TTM_NEWTOOLRECT WINELIB_NAME_AW(TTM_NEWTOOLRECT)
1331 #define TTM_RELAYEVENT          (WM_USER+7)
1332 #define TTM_GETTOOLINFOA      (WM_USER+8)
1333 #define TTM_GETTOOLINFOW      (WM_USER+53)
1334 #define TTM_GETTOOLINFO WINELIB_NAME_AW(TTM_GETTOOLINFO)
1335 #define TTM_SETTOOLINFOA      (WM_USER+9)
1336 #define TTM_SETTOOLINFOW      (WM_USER+54)
1337 #define TTM_SETTOOLINFO WINELIB_NAME_AW(TTM_SETTOOLINFO)
1338 #define TTM_HITTESTA          (WM_USER+10)
1339 #define TTM_HITTESTW          (WM_USER+55)
1340 #define TTM_HITTEST WINELIB_NAME_AW(TTM_HITTEST)
1341 #define TTM_GETTEXTA          (WM_USER+11)
1342 #define TTM_GETTEXTW          (WM_USER+56)
1343 #define TTM_GETTEXT WINELIB_NAME_AW(TTM_GETTEXT)
1344 #define TTM_UPDATETIPTEXTA    (WM_USER+12)
1345 #define TTM_UPDATETIPTEXTW    (WM_USER+57)
1346 #define TTM_UPDATETIPTEXT WINELIB_NAME_AW(TTM_UPDATETIPTEXT)
1347 #define TTM_GETTOOLCOUNT        (WM_USER+13)
1348 #define TTM_ENUMTOOLSA        (WM_USER+14)
1349 #define TTM_ENUMTOOLSW        (WM_USER+58)
1350 #define TTM_ENUMTOOLS WINELIB_NAME_AW(TTM_ENUMTOOLS)
1351 #define TTM_GETCURRENTTOOLA   (WM_USER+15)
1352 #define TTM_GETCURRENTTOOLW   (WM_USER+59)
1353 #define TTM_GETCURRENTTOOL WINELIB_NAME_AW(TTM_GETCURRENTTOOL)
1354 #define TTM_WINDOWFROMPOINT     (WM_USER+16)
1355 #define TTM_TRACKACTIVATE       (WM_USER+17)
1356 #define TTM_TRACKPOSITION       (WM_USER+18)
1357 #define TTM_SETTIPBKCOLOR       (WM_USER+19)
1358 #define TTM_SETTIPTEXTCOLOR     (WM_USER+20)
1359 #define TTM_GETDELAYTIME        (WM_USER+21)
1360 #define TTM_GETTIPBKCOLOR       (WM_USER+22)
1361 #define TTM_GETTIPTEXTCOLOR     (WM_USER+23)
1362 #define TTM_SETMAXTIPWIDTH      (WM_USER+24)
1363 #define TTM_GETMAXTIPWIDTH      (WM_USER+25)
1364 #define TTM_SETMARGIN           (WM_USER+26)
1365 #define TTM_GETMARGIN           (WM_USER+27)
1366 #define TTM_POP                 (WM_USER+28)
1367 #define TTM_UPDATE              (WM_USER+29)
1368
1369
1370 #define TTN_FIRST               (0U-520U)
1371 #define TTN_LAST                (0U-549U)
1372 #define TTN_GETDISPINFOA      (TTN_FIRST-0)
1373 #define TTN_GETDISPINFOW      (TTN_FIRST-10)
1374 #define TTN_GETDISPINFO WINELIB_NAME_AW(TTN_GETDISPINFO)
1375 #define TTN_SHOW                (TTN_FIRST-1)
1376 #define TTN_POP                 (TTN_FIRST-2)
1377
1378 #define TTN_NEEDTEXT TTN_GETDISPINFO
1379 #define TTN_NEEDTEXTA TTN_GETDISPINFOA
1380 #define TTN_NEEDTEXTW TTN_GETDISPINFOW
1381
1382 typedef struct tagTOOLINFOA {
1383     UINT cbSize;
1384     UINT uFlags;
1385     HWND hwnd;
1386     UINT uId;
1387     RECT rect;
1388     HINSTANCE hinst;
1389     LPSTR lpszText;
1390     LPARAM lParam;
1391 } TTTOOLINFOA, *LPTOOLINFOA, *PTOOLINFOA, *LPTTTOOLINFOA;
1392
1393 typedef struct tagTOOLINFOW {
1394     UINT cbSize;
1395     UINT uFlags;
1396     HWND hwnd;
1397     UINT uId;
1398     RECT rect;
1399     HINSTANCE hinst;
1400     LPWSTR lpszText;
1401     LPARAM lParam;
1402 } TTTOOLINFOW, *LPTOOLINFOW, *PTOOLINFOW, *LPTTTOOLINFOW;
1403
1404 #define TTTOOLINFO WINELIB_NAME_AW(TTTOOLINFO)
1405 #define TOOLINFO WINELIB_NAME_AW(TTTOOLINFO)
1406 #define PTOOLINFO WINELIB_NAME_AW(PTOOLINFO)
1407 #define LPTTTOOLINFO WINELIB_NAME_AW(LPTTTOOLINFO)
1408 #define LPTOOLINFO WINELIB_NAME_AW(LPTOOLINFO)
1409
1410 #define TTTOOLINFO_V1_SIZEA CCSIZEOF_STRUCT(TTTOOLINFOA, lpszText)
1411 #define TTTOOLINFO_V1_SIZEW CCSIZEOF_STRUCT(TTTOOLINFOW, lpszText)
1412 #define TTTOOLINFO_V1_SIZE WINELIB_NAME_AW(TTTOOLINFO_V1_SIZE)
1413
1414 typedef struct _TT_HITTESTINFOA
1415 {
1416     HWND        hwnd;
1417     POINT       pt;
1418     TTTOOLINFOA ti;
1419 } TTHITTESTINFOA, *LPTTHITTESTINFOA;
1420 #define LPHITTESTINFOA LPTTHITTESTINFOA
1421
1422 typedef struct _TT_HITTESTINFOW
1423 {
1424     HWND        hwnd;
1425     POINT       pt;
1426     TTTOOLINFOW ti;
1427 } TTHITTESTINFOW, *LPTTHITTESTINFOW;
1428 #define LPHITTESTINFOW LPTTHITTESTINFOW
1429
1430 #define TTHITTESTINFO WINELIB_NAME_AW(TTHITTESTINFO)
1431 #define LPTTHITTESTINFO WINELIB_NAME_AW(LPTTHITTESTINFO)
1432 #define LPHITTESTINFO WINELIB_NAME_AW(LPHITTESTINFO)
1433
1434 typedef struct tagNMTTDISPINFOA
1435 {
1436     NMHDR hdr;
1437     LPSTR lpszText;
1438     CHAR  szText[80];
1439     HINSTANCE hinst;
1440     UINT      uFlags;
1441     LPARAM      lParam;
1442 } NMTTDISPINFOA, *LPNMTTDISPINFOA;
1443
1444 typedef struct tagNMTTDISPINFOW
1445 {
1446     NMHDR       hdr;
1447     LPWSTR      lpszText;
1448     WCHAR       szText[80];
1449     HINSTANCE hinst;
1450     UINT      uFlags;
1451     LPARAM      lParam;
1452 } NMTTDISPINFOW, *LPNMTTDISPINFOW;
1453
1454 #define NMTTDISPINFO WINELIB_NAME_AW(NMTTDISPINFO)
1455 #define LPNMTTDISPINFO WINELIB_NAME_AW(LPNMTTDISPINFO)
1456
1457 #define NMTTDISPINFO_V1_SIZEA CCSIZEOF_STRUCT(NMTTDISPINFOA, uFlags)
1458 #define NMTTDISPINFO_V1_SIZEW CCSIZEOF_STRUCT(NMTTDISPINFOW, uFlags)
1459 #define NMTTDISPINFO_V1_SIZE WINELIB_NAME_AW(NMTTDISPINFO_V1_SIZE)
1460
1461 #define TOOLTIPTEXTW    NMTTDISPINFOW
1462 #define TOOLTIPTEXTA    NMTTDISPINFOA
1463 #define TOOLTIPTEXT     NMTTDISPINFO
1464 #define LPTOOLTIPTEXTW  LPNMTTDISPINFOW
1465 #define LPTOOLTIPTEXTA  LPNMTTDISPINFOA
1466 #define LPTOOLTIPTEXT   LPNMTTDISPINFO
1467
1468
1469 /* Rebar control */
1470
1471 #define REBARCLASSNAME16        "ReBarWindow"
1472 #define REBARCLASSNAMEA         "ReBarWindow32"
1473 static const WCHAR REBARCLASSNAMEW[] = { 'R','e','B','a','r',
1474   'W','i','n','d','o','w','3','2',0 };
1475 #define REBARCLASSNAME          WINELIB_NAME_AW(REBARCLASSNAME)
1476
1477 #define RBS_TOOLTIPS            0x0100
1478 #define RBS_VARHEIGHT           0x0200
1479 #define RBS_BANDBORDERS         0x0400
1480 #define RBS_FIXEDORDER          0x0800
1481 #define RBS_REGISTERDROP        0x1000
1482 #define RBS_AUTOSIZE            0x2000
1483 #define RBS_VERTICALGRIPPER     0x4000
1484 #define RBS_DBLCLKTOGGLE        0x8000
1485
1486 #define RBIM_IMAGELIST          0x00000001
1487
1488 #define RBBIM_STYLE             0x00000001
1489 #define RBBIM_COLORS            0x00000002
1490 #define RBBIM_TEXT              0x00000004
1491 #define RBBIM_IMAGE             0x00000008
1492 #define RBBIM_CHILD             0x00000010
1493 #define RBBIM_CHILDSIZE         0x00000020
1494 #define RBBIM_SIZE              0x00000040
1495 #define RBBIM_BACKGROUND        0x00000080
1496 #define RBBIM_ID                0x00000100
1497 #define RBBIM_IDEALSIZE         0x00000200
1498 #define RBBIM_LPARAM            0x00000400
1499 #define RBBIM_HEADERSIZE        0x00000800
1500
1501 #define RBBS_BREAK              0x00000001
1502 #define RBBS_FIXEDSIZE          0x00000002
1503 #define RBBS_CHILDEDGE          0x00000004
1504 #define RBBS_HIDDEN             0x00000008
1505 #define RBBS_NOVERT             0x00000010
1506 #define RBBS_FIXEDBMP           0x00000020
1507 #define RBBS_VARIABLEHEIGHT     0x00000040
1508 #define RBBS_GRIPPERALWAYS      0x00000080
1509 #define RBBS_NOGRIPPER          0x00000100
1510
1511 #define RBNM_ID                 0x00000001
1512 #define RBNM_STYLE              0x00000002
1513 #define RBNM_LPARAM             0x00000004
1514
1515 #define RBHT_NOWHERE            0x0001
1516 #define RBHT_CAPTION            0x0002
1517 #define RBHT_CLIENT             0x0003
1518 #define RBHT_GRABBER            0x0004
1519
1520 #define RB_INSERTBANDA        (WM_USER+1)
1521 #define RB_INSERTBANDW        (WM_USER+10)
1522 #define RB_INSERTBAND           WINELIB_NAME_AW(RB_INSERTBAND)
1523 #define RB_DELETEBAND           (WM_USER+2)
1524 #define RB_GETBARINFO           (WM_USER+3)
1525 #define RB_SETBARINFO           (WM_USER+4)
1526 #define RB_GETBANDINFO        (WM_USER+5)   /* just for compatibility */
1527 #define RB_SETBANDINFOA       (WM_USER+6)
1528 #define RB_SETBANDINFOW       (WM_USER+11)
1529 #define RB_SETBANDINFO          WINELIB_NAME_AW(RB_SETBANDINFO)
1530 #define RB_SETPARENT            (WM_USER+7)
1531 #define RB_HITTEST              (WM_USER+8)
1532 #define RB_GETRECT              (WM_USER+9)
1533 #define RB_GETBANDCOUNT         (WM_USER+12)
1534 #define RB_GETROWCOUNT          (WM_USER+13)
1535 #define RB_GETROWHEIGHT         (WM_USER+14)
1536 #define RB_IDTOINDEX            (WM_USER+16)
1537 #define RB_GETTOOLTIPS          (WM_USER+17)
1538 #define RB_SETTOOLTIPS          (WM_USER+18)
1539 #define RB_SETBKCOLOR           (WM_USER+19)
1540 #define RB_GETBKCOLOR           (WM_USER+20)
1541 #define RB_SETTEXTCOLOR         (WM_USER+21)
1542 #define RB_GETTEXTCOLOR         (WM_USER+22)
1543 #define RB_SIZETORECT           (WM_USER+23)
1544 #define RB_BEGINDRAG            (WM_USER+24)
1545 #define RB_ENDDRAG              (WM_USER+25)
1546 #define RB_DRAGMOVE             (WM_USER+26)
1547 #define RB_GETBARHEIGHT         (WM_USER+27)
1548 #define RB_GETBANDINFOW       (WM_USER+28)
1549 #define RB_GETBANDINFOA       (WM_USER+29)
1550 #define RB_GETBANDINFO16          WINELIB_NAME_AW(RB_GETBANDINFO16)
1551 #define RB_MINIMIZEBAND         (WM_USER+30)
1552 #define RB_MAXIMIZEBAND         (WM_USER+31)
1553 #define RB_GETBANDBORDERS       (WM_USER+34)
1554 #define RB_SHOWBAND             (WM_USER+35)
1555 #define RB_SETPALETTE           (WM_USER+37)
1556 #define RB_GETPALETTE           (WM_USER+38)
1557 #define RB_MOVEBAND             (WM_USER+39)
1558 #define RB_GETDROPTARGET        CCM_GETDROPTARGET
1559 #define RB_SETCOLORSCHEME       CCM_SETCOLORSCHEME
1560 #define RB_GETCOLORSCHEME       CCM_GETCOLORSCHEME
1561 #define RB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
1562 #define RB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
1563
1564 #define RBN_FIRST               (0U-831U)
1565 #define RBN_LAST                (0U-859U)
1566 #define RBN_HEIGHTCHANGE        (RBN_FIRST-0)
1567 #define RBN_GETOBJECT           (RBN_FIRST-1)
1568 #define RBN_LAYOUTCHANGED       (RBN_FIRST-2)
1569 #define RBN_AUTOSIZE            (RBN_FIRST-3)
1570 #define RBN_BEGINDRAG           (RBN_FIRST-4)
1571 #define RBN_ENDDRAG             (RBN_FIRST-5)
1572 #define RBN_DELETINGBAND        (RBN_FIRST-6)
1573 #define RBN_DELETEDBAND         (RBN_FIRST-7)
1574 #define RBN_CHILDSIZE           (RBN_FIRST-8)
1575
1576 typedef struct tagREBARINFO
1577 {
1578     UINT     cbSize;
1579     UINT     fMask;
1580     HIMAGELIST himl;
1581 } REBARINFO, *LPREBARINFO;
1582
1583 typedef struct tagREBARBANDINFOA
1584 {
1585     UINT    cbSize;
1586     UINT    fMask;
1587     UINT    fStyle;
1588     COLORREF  clrFore;
1589     COLORREF  clrBack;
1590     LPSTR     lpText;
1591     UINT    cch;
1592     INT     iImage;
1593     HWND    hwndChild;
1594     UINT    cxMinChild;
1595     UINT    cyMinChild;
1596     UINT    cx;
1597     HBITMAP hbmBack;
1598     UINT    wID;
1599     UINT    cyChild;
1600     UINT    cyMaxChild;
1601     UINT    cyIntegral;
1602     UINT    cxIdeal;
1603     LPARAM    lParam;
1604     UINT    cxHeader;
1605 } REBARBANDINFOA, *LPREBARBANDINFOA;
1606
1607 typedef REBARBANDINFOA const *LPCREBARBANDINFOA;
1608
1609 typedef struct tagREBARBANDINFOW
1610 {
1611     UINT    cbSize;
1612     UINT    fMask;
1613     UINT    fStyle;
1614     COLORREF  clrFore;
1615     COLORREF  clrBack;
1616     LPWSTR    lpText;
1617     UINT    cch;
1618     INT     iImage;
1619     HWND    hwndChild;
1620     UINT    cxMinChild;
1621     UINT    cyMinChild;
1622     UINT    cx;
1623     HBITMAP hbmBack;
1624     UINT    wID;
1625     UINT    cyChild;
1626     UINT    cyMaxChild;
1627     UINT    cyIntegral;
1628     UINT    cxIdeal;
1629     LPARAM    lParam;
1630     UINT    cxHeader;
1631 } REBARBANDINFOW, *LPREBARBANDINFOW;
1632
1633 typedef REBARBANDINFOW const *LPCREBARBANDINFOW;
1634
1635 #define REBARBANDINFO    WINELIB_NAME_AW(REBARBANDINFO)
1636 #define LPREBARBANDINFO  WINELIB_NAME_AW(LPREBARBANDINFO)
1637 #define LPCREBARBANDINFO WINELIB_NAME_AW(LPCREBARBANDINFO)
1638
1639 #define REBARBANDINFO_V3_SIZEA CCSIZEOF_STRUCT(REBARBANDINFOA, wID)
1640 #define REBARBANDINFO_V3_SIZEW CCSIZEOF_STRUCT(REBARBANDINFOW, wID)
1641 #define REBARBANDINFO_V3_SIZE WINELIB_NAME_AW(REBARBANDINFO_V3_SIZE)
1642
1643 typedef struct tagNMREBARCHILDSIZE
1644 {
1645     NMHDR  hdr;
1646     UINT uBand;
1647     UINT wID;
1648     RECT rcChild;
1649     RECT rcBand;
1650 } NMREBARCHILDSIZE, *LPNMREBARCHILDSIZE;
1651
1652 typedef struct tagNMREBAR
1653 {
1654     NMHDR  hdr;
1655     DWORD  dwMask;
1656     UINT uBand;
1657     UINT fStyle;
1658     UINT wID;
1659     LPARAM lParam;
1660 } NMREBAR, *LPNMREBAR;
1661
1662 typedef struct tagNMRBAUTOSIZE
1663 {
1664     NMHDR hdr;
1665     BOOL fChanged;
1666     RECT rcTarget;
1667     RECT rcActual;
1668 } NMRBAUTOSIZE, *LPNMRBAUTOSIZE;
1669
1670 typedef struct _RB_HITTESTINFO
1671 {
1672     POINT pt;
1673     UINT  flags;
1674     INT   iBand;
1675 } RBHITTESTINFO, *LPRBHITTESTINFO;
1676
1677
1678 /* Trackbar control */
1679
1680 #define TRACKBAR_CLASS16        "msctls_trackbar"
1681 #define TRACKBAR_CLASSA         "msctls_trackbar32"
1682 static const WCHAR TRACKBAR_CLASSW[] = { 'm','s','c','t','l','s','_',
1683   't','r','a','c','k','b','a','r','3','2',0 };
1684 #define TRACKBAR_CLASS  WINELIB_NAME_AW(TRACKBAR_CLASS)
1685
1686 #define TBS_AUTOTICKS           0x0001
1687 #define TBS_VERT                0x0002
1688 #define TBS_HORZ                0x0000
1689 #define TBS_TOP                 0x0004
1690 #define TBS_BOTTOM              0x0000
1691 #define TBS_LEFT                0x0004
1692 #define TBS_RIGHT               0x0000
1693 #define TBS_BOTH                0x0008
1694 #define TBS_NOTICKS             0x0010
1695 #define TBS_ENABLESELRANGE      0x0020
1696 #define TBS_FIXEDLENGTH         0x0040
1697 #define TBS_NOTHUMB             0x0080
1698 #define TBS_TOOLTIPS            0x0100
1699 #define TBS_REVERSED                    0x0200
1700
1701 #define TBTS_TOP                0
1702 #define TBTS_LEFT               1
1703 #define TBTS_BOTTOM             2
1704 #define TBTS_RIGHT              3
1705
1706 #define TB_LINEUP               0
1707 #define TB_LINEDOWN             1
1708 #define TB_PAGEUP               2
1709 #define TB_PAGEDOWN             3
1710 #define TB_THUMBPOSITION        4
1711 #define TB_THUMBTRACK           5
1712 #define TB_TOP                  6
1713 #define TB_BOTTOM               7
1714 #define TB_ENDTRACK             8
1715
1716 #define TBCD_TICS               0x0001
1717 #define TBCD_THUMB              0x0002
1718 #define TBCD_CHANNEL            0x0003
1719
1720 #define TBM_GETPOS              (WM_USER)
1721 #define TBM_GETRANGEMIN         (WM_USER+1)
1722 #define TBM_GETRANGEMAX         (WM_USER+2)
1723 #define TBM_GETTIC              (WM_USER+3)
1724 #define TBM_SETTIC              (WM_USER+4)
1725 #define TBM_SETPOS              (WM_USER+5)
1726 #define TBM_SETRANGE            (WM_USER+6)
1727 #define TBM_SETRANGEMIN         (WM_USER+7)
1728 #define TBM_SETRANGEMAX         (WM_USER+8)
1729 #define TBM_CLEARTICS           (WM_USER+9)
1730 #define TBM_SETSEL              (WM_USER+10)
1731 #define TBM_SETSELSTART         (WM_USER+11)
1732 #define TBM_SETSELEND           (WM_USER+12)
1733 #define TBM_GETPTICS            (WM_USER+14)
1734 #define TBM_GETTICPOS           (WM_USER+15)
1735 #define TBM_GETNUMTICS          (WM_USER+16)
1736 #define TBM_GETSELSTART         (WM_USER+17)
1737 #define TBM_GETSELEND           (WM_USER+18)
1738 #define TBM_CLEARSEL            (WM_USER+19)
1739 #define TBM_SETTICFREQ          (WM_USER+20)
1740 #define TBM_SETPAGESIZE         (WM_USER+21)
1741 #define TBM_GETPAGESIZE         (WM_USER+22)
1742 #define TBM_SETLINESIZE         (WM_USER+23)
1743 #define TBM_GETLINESIZE         (WM_USER+24)
1744 #define TBM_GETTHUMBRECT        (WM_USER+25)
1745 #define TBM_GETCHANNELRECT      (WM_USER+26)
1746 #define TBM_SETTHUMBLENGTH      (WM_USER+27)
1747 #define TBM_GETTHUMBLENGTH      (WM_USER+28)
1748 #define TBM_SETTOOLTIPS         (WM_USER+29)
1749 #define TBM_GETTOOLTIPS         (WM_USER+30)
1750 #define TBM_SETTIPSIDE          (WM_USER+31)
1751 #define TBM_SETBUDDY            (WM_USER+32)
1752 #define TBM_GETBUDDY            (WM_USER+33)
1753 #define TBM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
1754 #define TBM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
1755
1756
1757 /* Pager control */
1758
1759 #define WC_PAGESCROLLERA      "SysPager"
1760 static const WCHAR WC_PAGESCROLLERW[] = { 'S','y','s','P','a','g','e','r',0 };
1761 #define WC_PAGESCROLLER  WINELIB_NAME_AW(WC_PAGESCROLLER)
1762
1763 #define PGS_VERT                0x00000000
1764 #define PGS_HORZ                0x00000001
1765 #define PGS_AUTOSCROLL          0x00000002
1766 #define PGS_DRAGNDROP           0x00000004
1767
1768 #define PGF_INVISIBLE           0
1769 #define PGF_NORMAL              1
1770 #define PGF_GRAYED              2
1771 #define PGF_DEPRESSED           4
1772 #define PGF_HOT                 8
1773
1774 #define PGB_TOPORLEFT           0
1775 #define PGB_BOTTOMORRIGHT       1
1776
1777 /* only used with PGN_SCROLL */
1778 #define PGF_SCROLLUP            1
1779 #define PGF_SCROLLDOWN          2
1780 #define PGF_SCROLLLEFT          4
1781 #define PGF_SCROLLRIGHT         8
1782
1783 #define PGK_SHIFT               1
1784 #define PGK_CONTROL             2
1785 #define PGK_MENU                4
1786
1787 /* only used with PGN_CALCSIZE */
1788 #define PGF_CALCWIDTH           1
1789 #define PGF_CALCHEIGHT          2
1790
1791 #define PGM_FIRST               0x1400
1792 #define PGM_SETCHILD            (PGM_FIRST+1)
1793 #define PGM_RECALCSIZE          (PGM_FIRST+2)
1794 #define PGM_FORWARDMOUSE        (PGM_FIRST+3)
1795 #define PGM_SETBKCOLOR          (PGM_FIRST+4)
1796 #define PGM_GETBKCOLOR          (PGM_FIRST+5)
1797 #define PGM_SETBORDER           (PGM_FIRST+6)
1798 #define PGM_GETBORDER           (PGM_FIRST+7)
1799 #define PGM_SETPOS              (PGM_FIRST+8)
1800 #define PGM_GETPOS              (PGM_FIRST+9)
1801 #define PGM_SETBUTTONSIZE       (PGM_FIRST+10)
1802 #define PGM_GETBUTTONSIZE       (PGM_FIRST+11)
1803 #define PGM_GETBUTTONSTATE      (PGM_FIRST+12)
1804 #define PGM_GETDROPTARGET       CCM_GETDROPTARGET
1805
1806 #define PGN_FIRST               (0U-900U)
1807 #define PGN_LAST                (0U-950U)
1808 #define PGN_SCROLL              (PGN_FIRST-1)
1809 #define PGN_CALCSIZE            (PGN_FIRST-2)
1810
1811 #include "pshpack1.h"
1812
1813 typedef struct
1814 {
1815     NMHDR hdr;
1816     WORD  fwKeys;
1817     RECT rcParent;
1818     INT  iDir;
1819     INT  iXpos;
1820     INT  iYpos;
1821     INT  iScroll;
1822 } NMPGSCROLL, *LPNMPGSCROLL;
1823
1824 #include "poppack.h"
1825
1826 typedef struct
1827 {
1828     NMHDR hdr;
1829     DWORD dwFlag;
1830     INT iWidth;
1831     INT iHeight;
1832 } NMPGCALCSIZE, *LPNMPGCALCSIZE;
1833
1834
1835 /* Treeview control */
1836
1837 #define WC_TREEVIEWA          "SysTreeView32"
1838 static const WCHAR WC_TREEVIEWW[] = { 'S','y','s',
1839   'T','r','e','e','V','i','e','w','3','2',0 };
1840 #define WC_TREEVIEW             WINELIB_NAME_AW(WC_TREEVIEW)
1841
1842 #define TVSIL_NORMAL            0
1843 #define TVSIL_STATE             2
1844
1845 #define TV_FIRST                0x1100
1846 #define TVM_INSERTITEMA       (TV_FIRST+0)
1847 #define TVM_INSERTITEMW       (TV_FIRST+50)
1848 #define TVM_INSERTITEM          WINELIB_NAME_AW(TVM_INSERTITEM)
1849 #define TVM_DELETEITEM          (TV_FIRST+1)
1850 #define TVM_EXPAND              (TV_FIRST+2)
1851 #define TVM_GETITEMRECT         (TV_FIRST+4)
1852 #define TVM_GETCOUNT            (TV_FIRST+5)
1853 #define TVM_GETINDENT           (TV_FIRST+6)
1854 #define TVM_SETINDENT           (TV_FIRST+7)
1855 #define TVM_GETIMAGELIST        (TV_FIRST+8)
1856 #define TVM_SETIMAGELIST        (TV_FIRST+9)
1857 #define TVM_GETNEXTITEM         (TV_FIRST+10)
1858 #define TVM_SELECTITEM          (TV_FIRST+11)
1859 #define TVM_GETITEMA          (TV_FIRST+12)
1860 #define TVM_GETITEMW          (TV_FIRST+62)
1861 #define TVM_GETITEM             WINELIB_NAME_AW(TVM_GETITEM)
1862 #define TVM_SETITEMA          (TV_FIRST+13)
1863 #define TVM_SETITEMW          (TV_FIRST+63)
1864 #define TVM_SETITEM             WINELIB_NAME_AW(TVM_SETITEM)
1865 #define TVM_EDITLABELA        (TV_FIRST+14)
1866 #define TVM_EDITLABELW        (TV_FIRST+65)
1867 #define TVM_EDITLABEL           WINELIB_NAME_AW(TVM_EDITLABEL)
1868 #define TVM_GETEDITCONTROL      (TV_FIRST+15)
1869 #define TVM_GETVISIBLECOUNT     (TV_FIRST+16)
1870 #define TVM_HITTEST             (TV_FIRST+17)
1871 #define TVM_CREATEDRAGIMAGE     (TV_FIRST+18)
1872 #define TVM_SORTCHILDREN        (TV_FIRST+19)
1873 #define TVM_ENSUREVISIBLE       (TV_FIRST+20)
1874 #define TVM_SORTCHILDRENCB      (TV_FIRST+21)
1875 #define TVM_ENDEDITLABELNOW     (TV_FIRST+22)
1876 #define TVM_GETISEARCHSTRINGA (TV_FIRST+23)
1877 #define TVM_GETISEARCHSTRINGW (TV_FIRST+64)
1878 #define TVM_GETISEARCHSTRING    WINELIB_NAME_AW(TVM_GETISEARCHSTRING)
1879 #define TVM_SETTOOLTIPS         (TV_FIRST+24)
1880 #define TVM_GETTOOLTIPS         (TV_FIRST+25)
1881 #define TVM_SETINSERTMARK       (TV_FIRST+26)
1882 #define TVM_SETITEMHEIGHT       (TV_FIRST+27)
1883 #define TVM_GETITEMHEIGHT       (TV_FIRST+28)
1884 #define TVM_SETBKCOLOR          (TV_FIRST+29)
1885 #define TVM_SETTEXTCOLOR        (TV_FIRST+30)
1886 #define TVM_GETBKCOLOR          (TV_FIRST+31)
1887 #define TVM_GETTEXTCOLOR        (TV_FIRST+32)
1888 #define TVM_SETSCROLLTIME       (TV_FIRST+33)
1889 #define TVM_GETSCROLLTIME       (TV_FIRST+34)
1890 #define TVM_UNKNOWN35           (TV_FIRST+35)
1891 #define TVM_UNKNOWN36           (TV_FIRST+36)
1892 #define TVM_SETINSERTMARKCOLOR  (TV_FIRST+37)
1893 #define TVM_GETINSERTMARKCOLOR  (TV_FIRST+38)
1894 #define TVM_GETITEMSTATE        (TV_FIRST+39)
1895 #define TVM_SETLINECOLOR        (TV_FIRST+40)
1896 #define TVM_GETLINECOLOR        (TV_FIRST+41)
1897 #define TVM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
1898 #define TVM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
1899
1900
1901
1902 #define TVN_FIRST               (0U-400U)
1903 #define TVN_LAST                (0U-499U)
1904
1905 #define TVN_SELCHANGINGA        (TVN_FIRST-1)
1906 #define TVN_SELCHANGINGW        (TVN_FIRST-50)
1907 #define TVN_SELCHANGING         WINELIB_NAME_AW(TVN_SELCHANGING)
1908
1909 #define TVN_SELCHANGEDA         (TVN_FIRST-2)
1910 #define TVN_SELCHANGEDW         (TVN_FIRST-51)
1911 #define TVN_SELCHANGED          WINELIB_NAME_AW(TVN_SELCHANGED)
1912
1913 #define TVN_GETDISPINFOA        (TVN_FIRST-3)
1914 #define TVN_GETDISPINFOW        (TVN_FIRST-52)
1915 #define TVN_GETDISPINFO         WINELIB_NAME_AW(TVN_GETDISPINFO)
1916
1917 #define TVN_SETDISPINFOA        (TVN_FIRST-4)
1918 #define TVN_SETDISPINFOW        (TVN_FIRST-53)
1919 #define TVN_SETDISPINFO         WINELIB_NAME_AW(TVN_SETDISPINFO)
1920
1921 #define TVN_ITEMEXPANDINGA      (TVN_FIRST-5)
1922 #define TVN_ITEMEXPANDINGW      (TVN_FIRST-54)
1923 #define TVN_ITEMEXPANDING       WINELIB_NAME_AW(TVN_ITEMEXPANDING)
1924
1925 #define TVN_ITEMEXPANDEDA       (TVN_FIRST-6)
1926 #define TVN_ITEMEXPANDEDW       (TVN_FIRST-55)
1927 #define TVN_ITEMEXPANDED        WINELIB_NAME_AW(TVN_ITEMEXPANDED)
1928
1929 #define TVN_BEGINDRAGA          (TVN_FIRST-7)
1930 #define TVN_BEGINDRAGW          (TVN_FIRST-56)
1931 #define TVN_BEGINDRAG           WINELIB_NAME_AW(TVN_BEGINDRAG)
1932
1933 #define TVN_BEGINRDRAGA         (TVN_FIRST-8)
1934 #define TVN_BEGINRDRAGW         (TVN_FIRST-57)
1935 #define TVN_BEGINRDRAG          WINELIB_NAME_AW(TVN_BEGINRDRAG)
1936
1937 #define TVN_DELETEITEMA         (TVN_FIRST-9)
1938 #define TVN_DELETEITEMW         (TVN_FIRST-58)
1939 #define TVN_DELETEITEM          WINELIB_NAME_AW(TVN_DELETEITEM)
1940
1941 #define TVN_BEGINLABELEDITA     (TVN_FIRST-10)
1942 #define TVN_BEGINLABELEDITW     (TVN_FIRST-59)
1943 #define TVN_BEGINLABELEDIT      WINELIB_NAME_AW(TVN_BEGINLABELEDIT)
1944
1945 #define TVN_ENDLABELEDITA       (TVN_FIRST-11)
1946 #define TVN_ENDLABELEDITW       (TVN_FIRST-60)
1947 #define TVN_ENDLABELEDIT        WINELIB_NAME_AW(TVN_ENDLABELEDIT)
1948
1949 #define TVN_KEYDOWN             (TVN_FIRST-12)
1950
1951 #define TVN_GETINFOTIPA         (TVN_FIRST-13)
1952 #define TVN_GETINFOTIPW         (TVN_FIRST-14)
1953 #define TVN_GETINFOTIP          WINELIB_NAME_AW(TVN_GETINFOTIP)
1954
1955 #define TVN_SINGLEEXPAND        (TVN_FIRST-15)
1956
1957
1958
1959
1960
1961 #define TVIF_TEXT             0x0001
1962 #define TVIF_IMAGE            0x0002
1963 #define TVIF_PARAM            0x0004
1964 #define TVIF_STATE            0x0008
1965 #define TVIF_HANDLE           0x0010
1966 #define TVIF_SELECTEDIMAGE    0x0020
1967 #define TVIF_CHILDREN         0x0040
1968 #define TVIF_INTEGRAL         0x0080
1969 #define TVIF_DI_SETITEM           0x1000
1970
1971 #define TVI_ROOT              ((HTREEITEM)0xffff0000)     /* -65536 */
1972 #define TVI_FIRST             ((HTREEITEM)0xffff0001)     /* -65535 */
1973 #define TVI_LAST              ((HTREEITEM)0xffff0002)     /* -65534 */
1974 #define TVI_SORT              ((HTREEITEM)0xffff0003)     /* -65533 */
1975
1976 #define TVIS_FOCUSED          0x0001
1977 #define TVIS_SELECTED         0x0002
1978 #define TVIS_CUT              0x0004
1979 #define TVIS_DROPHILITED      0x0008
1980 #define TVIS_BOLD             0x0010
1981 #define TVIS_EXPANDED         0x0020
1982 #define TVIS_EXPANDEDONCE     0x0040
1983 #define TVIS_EXPANDPARTIAL    0x0080
1984 #define TVIS_OVERLAYMASK      0x0f00
1985 #define TVIS_STATEIMAGEMASK   0xf000
1986 #define TVIS_USERMASK         0xf000
1987
1988 #define TVHT_NOWHERE          0x0001
1989 #define TVHT_ONITEMICON       0x0002
1990 #define TVHT_ONITEMLABEL      0x0004
1991 #define TVHT_ONITEMINDENT     0x0008
1992 #define TVHT_ONITEMBUTTON     0x0010
1993 #define TVHT_ONITEMRIGHT      0x0020
1994 #define TVHT_ONITEMSTATEICON  0x0040
1995 #define TVHT_ONITEM           0x0046
1996 #define TVHT_ABOVE            0x0100
1997 #define TVHT_BELOW            0x0200
1998 #define TVHT_TORIGHT          0x0400
1999 #define TVHT_TOLEFT           0x0800
2000
2001 #define TVS_HASBUTTONS        0x0001
2002 #define TVS_HASLINES          0x0002
2003 #define TVS_LINESATROOT       0x0004
2004 #define TVS_EDITLABELS        0x0008
2005 #define TVS_DISABLEDRAGDROP   0x0010
2006 #define TVS_SHOWSELALWAYS     0x0020
2007 #define TVS_RTLREADING        0x0040
2008 #define TVS_NOTOOLTIPS        0x0080
2009 #define TVS_CHECKBOXES        0x0100
2010 #define TVS_TRACKSELECT       0x0200
2011 #define TVS_SINGLEEXPAND          0x0400
2012 #define TVS_INFOTIP               0x0800
2013 #define TVS_FULLROWSELECT         0x1000
2014 #define TVS_NOSCROLL              0x2000
2015 #define TVS_NONEVENHEIGHT         0x4000
2016 #define TVS_NOHSCROLL         0x8000 
2017
2018 #define TVS_SHAREDIMAGELISTS  0x0000
2019 #define TVS_PRIVATEIMAGELISTS 0x0400
2020
2021
2022 #define TVE_COLLAPSE          0x0001
2023 #define TVE_EXPAND            0x0002
2024 #define TVE_TOGGLE            0x0003
2025 #define TVE_EXPANDPARTIAL     0x4000
2026 #define TVE_COLLAPSERESET     0x8000
2027
2028 #define TVGN_ROOT             0
2029 #define TVGN_NEXT             1
2030 #define TVGN_PREVIOUS         2
2031 #define TVGN_PARENT           3
2032 #define TVGN_CHILD            4
2033 #define TVGN_FIRSTVISIBLE     5
2034 #define TVGN_NEXTVISIBLE      6
2035 #define TVGN_PREVIOUSVISIBLE  7
2036 #define TVGN_DROPHILITE       8
2037 #define TVGN_CARET            9
2038 #define TVGN_LASTVISIBLE      10
2039
2040 #define TVC_UNKNOWN           0x00
2041 #define TVC_BYMOUSE           0x01
2042 #define TVC_BYKEYBOARD        0x02
2043
2044
2045 typedef struct _TREEITEM *HTREEITEM;
2046
2047 typedef struct {
2048       UINT mask;
2049       HTREEITEM hItem;
2050       UINT state;
2051       UINT stateMask;
2052       LPSTR  pszText;
2053       INT  cchTextMax;
2054       INT  iImage;
2055       INT  iSelectedImage;
2056       INT  cChildren;
2057       LPARAM lParam;
2058 } TVITEMA, *LPTVITEMA;
2059
2060 typedef struct {
2061       UINT mask;
2062       HTREEITEM hItem;
2063       UINT state;
2064       UINT stateMask;
2065       LPWSTR pszText;
2066       INT cchTextMax;
2067       INT iImage;
2068       INT iSelectedImage;
2069       INT cChildren;
2070       LPARAM lParam;
2071 } TVITEMW, *LPTVITEMW;
2072
2073 #define TV_ITEMA    TVITEMA
2074 #define TV_ITEMW    TVITEMW
2075 #define LPTV_ITEMA  LPTVITEMA
2076 #define LPTV_ITEMW  LPTVITEMW
2077
2078 #define TVITEM      WINELIB_NAME_AW(TVITEM)
2079 #define LPTVITEM    WINELIB_NAME_AW(LPTVITEM)
2080 #define TV_ITEM     WINELIB_NAME_AW(TV_ITEM)
2081 #define LPTV_ITEM   WINELIB_NAME_AW(LPTV_ITEM)
2082
2083 typedef struct {
2084       UINT mask;
2085       HTREEITEM hItem;
2086       UINT state;
2087       UINT stateMask;
2088       LPSTR  pszText;
2089       INT  cchTextMax;
2090       INT  iImage;
2091       INT  iSelectedImage;
2092       INT  cChildren;
2093       LPARAM lParam;
2094       INT iIntegral;
2095 } TVITEMEXA, *LPTVITEMEXA;
2096
2097 typedef struct {
2098       UINT mask;
2099       HTREEITEM hItem;
2100       UINT state;
2101       UINT stateMask;
2102       LPWSTR pszText;
2103       INT cchTextMax;
2104       INT iImage;
2105       INT iSelectedImage;
2106       INT cChildren;
2107       LPARAM lParam;
2108       INT iIntegral;
2109 } TVITEMEXW, *LPTVITEMEXW;
2110
2111 #define TVITEMEX   WINELIB_NAME_AW(TVITEMEX)
2112 #define LPTVITEMEX WINELIB_NAME_AW(LPTVITEMEX)
2113
2114 typedef struct tagTVINSERTSTRUCTA {
2115         HTREEITEM hParent;
2116         HTREEITEM hInsertAfter;
2117         union {
2118            TVITEMEXA itemex;
2119            TVITEMA   item;
2120         } DUMMYUNIONNAME;
2121 } TVINSERTSTRUCTA, *LPTVINSERTSTRUCTA;
2122
2123 typedef struct tagTVINSERTSTRUCTW {
2124         HTREEITEM hParent;
2125         HTREEITEM hInsertAfter;
2126         union {
2127            TVITEMEXW itemex;
2128            TVITEMW   item;
2129         } DUMMYUNIONNAME;
2130 } TVINSERTSTRUCTW, *LPTVINSERTSTRUCTW;
2131
2132 #define TVINSERTSTRUCT    WINELIB_NAME_AW(TVINSERTSTRUCT)
2133 #define LPTVINSERTSTRUCT  WINELIB_NAME_AW(LPTVINSERTSTRUCT)
2134
2135 #define TVINSERTSTRUCT_V1_SIZEA CCSIZEOF_STRUCT(TVINSERTSTRUCTA, item)
2136 #define TVINSERTSTRUCT_V1_SIZEW CCSIZEOF_STRUCT(TVINSERTSTRUCTW, item)
2137 #define TVINSERTSTRUCT_V1_SIZE    WINELIB_NAME_AW(TVINSERTSTRUCT_V1_SIZE)
2138
2139 #define TV_INSERTSTRUCT    TVINSERTSTRUCT
2140 #define TV_INSERTSTRUCTA   TVINSERTSTRUCTA
2141 #define TV_INSERTSTRUCTW   TVINSERTSTRUCTW
2142 #define LPTV_INSERTSTRUCT  LPTVINSERTSTRUCT
2143 #define LPTV_INSERTSTRUCTA LPTVINSERTSTRUCTA
2144 #define LPTV_INSERTSTRUCTW LPTVINSERTSTRUCTW
2145
2146
2147
2148 typedef struct tagNMTREEVIEWA {
2149         NMHDR   hdr;
2150         UINT    action;
2151         TVITEMA itemOld;
2152         TVITEMA itemNew;
2153         POINT   ptDrag;
2154 } NMTREEVIEWA, *LPNMTREEVIEWA;
2155
2156 typedef struct tagNMTREEVIEWW {
2157         NMHDR   hdr;
2158         UINT    action;
2159         TVITEMW itemOld;
2160         TVITEMW itemNew;
2161         POINT   ptDrag;
2162 } NMTREEVIEWW, *LPNMTREEVIEWW;
2163
2164 #define NMTREEVIEW     WINELIB_NAME_AW(NMTREEVIEW)
2165 #define NM_TREEVIEW    WINELIB_NAME_AW(NMTREEVIEW)
2166 #define LPNMTREEVIEW   WINELIB_NAME_AW(LPNMTREEVIEW)
2167
2168 #define LPNM_TREEVIEW           LPNMTREEVIEW
2169
2170 typedef struct tagTVDISPINFOA {
2171         NMHDR   hdr;
2172         TVITEMA item;
2173 } NMTVDISPINFOA, *LPNMTVDISPINFOA;
2174
2175 typedef struct tagTVDISPINFOW {
2176         NMHDR   hdr;
2177         TVITEMW item;
2178 } NMTVDISPINFOW, *LPNMTVDISPINFOW;
2179
2180 #define NMTVDISPINFO            WINELIB_NAME_AW(NMTVDISPINFO)
2181 #define LPNMTVDISPINFO          WINELIB_NAME_AW(LPNMTVDISPINFO)
2182 #define TV_DISPINFO             NMTVDISPINFO
2183
2184 typedef INT CALLBACK (*PFNTVCOMPARE)(LPARAM, LPARAM, LPARAM);
2185
2186 typedef struct tagTVSORTCB
2187 {
2188         HTREEITEM hParent;
2189         PFNTVCOMPARE lpfnCompare;
2190         LPARAM lParam;
2191 } TVSORTCB, *LPTVSORTCB;
2192
2193 #define TV_SORTCB TVSORTCB
2194 #define LPTV_SORTCB LPTVSORTCB
2195
2196 typedef struct tagTVHITTESTINFO {
2197         POINT pt;
2198         UINT flags;
2199         HTREEITEM hItem;
2200 } TVHITTESTINFO, *LPTVHITTESTINFO;
2201
2202 #define TV_HITTESTINFO TVHITTESTINFO
2203
2204
2205 /* Custom Draw Treeview */
2206
2207 #define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW, clrTextBk)
2208
2209 #define TVCDRF_NOIMAGES     0x00010000
2210
2211 typedef struct tagNMTVCUSTOMDRAW
2212 {
2213     NMCUSTOMDRAW nmcd;
2214     COLORREF     clrText;
2215     COLORREF     clrTextBk;
2216     INT iLevel;                 /* IE>0x0400 */
2217 } NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
2218
2219 /* Treeview tooltips */
2220
2221 typedef struct tagNMTVGETINFOTIPA
2222 {
2223     NMHDR hdr;
2224     LPSTR pszText;
2225     INT cchTextMax;
2226     HTREEITEM hItem;
2227     LPARAM lParam;
2228 } NMTVGETINFOTIPA, *LPNMTVGETINFOTIPA;
2229
2230 typedef struct tagNMTVGETINFOTIPW
2231 {
2232     NMHDR hdr;
2233     LPWSTR pszText;
2234     INT cchTextMax;
2235     HTREEITEM hItem;
2236     LPARAM lParam;
2237 } NMTVGETINFOTIPW, *LPNMTVGETINFOTIPW;
2238
2239 #define NMTVGETINFOTIP WINELIB_NAME_AW(NMTVGETINFOTIP)
2240 #define LPNMTVGETINFOTIP WINELIB_NAME_AW(LPNMTVGETINFOTIP)
2241
2242 typedef struct tagTVKEYDOWN
2243 {
2244     NMHDR hdr;
2245     WORD wVKey;
2246     UINT flags;
2247 } NMTVKEYDOWN, *LPNMTVKEYDOWN;
2248
2249 #define TV_KEYDOWN      NMTVKEYDOWN
2250
2251 #define TreeView_InsertItemA(hwnd, phdi) \
2252   (HTREEITEM)SendMessageA((hwnd), TVM_INSERTITEMA, 0, \
2253                             (LPARAM)(LPTVINSERTSTRUCTA)(phdi))
2254 #define TreeView_InsertItemW(hwnd,phdi) \
2255   (HTREEITEM)SendMessageW((hwnd), TVM_INSERTITEMW, 0, \
2256                             (LPARAM)(LPTVINSERTSTRUCTW)(phdi))
2257 #define TreeView_InsertItem WINELIB_NAME_AW(TreeView_InsertItem) 
2258
2259 #define TreeView_DeleteItem(hwnd, hItem) \
2260   (BOOL)SendMessageA((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hItem))
2261 #define TreeView_DeleteAllItems(hwnd) \
2262   (BOOL)SendMessageA((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT)
2263 #define TreeView_Expand(hwnd, hitem, code) \
2264  (BOOL)SendMessageA((hwnd), TVM_EXPAND, (WPARAM)code, \
2265         (LPARAM)(HTREEITEM)(hitem))
2266
2267 #define TreeView_GetItemRect(hwnd, hitem, prc, code) \
2268  (*(HTREEITEM *)prc = (hitem), (BOOL)SendMessageA((hwnd), \
2269                         TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT *)(prc)))
2270
2271 #define TreeView_GetCount(hwnd) \
2272     (UINT)SendMessageA((hwnd), TVM_GETCOUNT, 0, 0)
2273 #define TreeView_GetIndent(hwnd) \
2274     (UINT)SendMessageA((hwnd), TVM_GETINDENT, 0, 0)
2275 #define TreeView_SetIndent(hwnd, indent) \
2276     (BOOL)SendMessageA((hwnd), TVM_SETINDENT, (WPARAM)indent, 0)
2277
2278 #define TreeView_GetImageList(hwnd, iImage) \
2279     (HIMAGELIST)SendMessageA((hwnd), TVM_GETIMAGELIST, iImage, 0)
2280
2281 #define TreeView_SetImageList(hwnd, himl, iImage) \
2282     (HIMAGELIST)SendMessageA((hwnd), TVM_SETIMAGELIST, iImage, \
2283  (LPARAM)(UINT)(HIMAGELIST)(himl))
2284
2285 #define TreeView_GetNextItem(hwnd, hitem, code) \
2286     (HTREEITEM)SendMessageA((hwnd), TVM_GETNEXTITEM, (WPARAM)code,\
2287 (LPARAM)(HTREEITEM) (hitem))
2288
2289 #define TreeView_GetChild(hwnd, hitem) \
2290                 TreeView_GetNextItem(hwnd, hitem , TVGN_CHILD)
2291 #define TreeView_GetNextSibling(hwnd, hitem) \
2292                 TreeView_GetNextItem(hwnd, hitem , TVGN_NEXT)
2293 #define TreeView_GetPrevSibling(hwnd, hitem) \
2294                 TreeView_GetNextItem(hwnd, hitem , TVGN_PREVIOUS)
2295 #define TreeView_GetParent(hwnd, hitem) \
2296                 TreeView_GetNextItem(hwnd, hitem , TVGN_PARENT)
2297 #define TreeView_GetFirstVisible(hwnd)  \
2298                 TreeView_GetNextItem(hwnd, NULL, TVGN_FIRSTVISIBLE)
2299 #define TreeView_GetLastVisible(hwnd)   \
2300                 TreeView_GetNextItem(hwnd, NULL, TVGN_LASTVISIBLE)
2301 #define TreeView_GetNextVisible(hwnd, hitem) \
2302                 TreeView_GetNextItem(hwnd, hitem , TVGN_NEXTVISIBLE)
2303 #define TreeView_GetPrevVisible(hwnd, hitem) \
2304                 TreeView_GetNextItem(hwnd, hitem , TVGN_PREVIOUSVISIBLE)
2305 #define TreeView_GetSelection(hwnd) \
2306                 TreeView_GetNextItem(hwnd, NULL, TVGN_CARET)
2307 #define TreeView_GetDropHilight(hwnd) \
2308                 TreeView_GetNextItem(hwnd, NULL, TVGN_DROPHILITE)
2309 #define TreeView_GetRoot(hwnd) \
2310                 TreeView_GetNextItem(hwnd, NULL, TVGN_ROOT)
2311 #define TreeView_GetLastVisible(hwnd) \
2312                 TreeView_GetNextItem(hwnd, NULL, TVGN_LASTVISIBLE)
2313
2314
2315 #define TreeView_Select(hwnd, hitem, code) \
2316  (UINT)SendMessageA((hwnd), TVM_SELECTITEM, (WPARAM)code, \
2317 (LPARAM)(UINT)(hitem))
2318
2319
2320 #define TreeView_SelectItem(hwnd, hitem) \
2321                 TreeView_Select(hwnd, hitem, TVGN_CARET)
2322 #define TreeView_SelectDropTarget(hwnd, hitem) \
2323         TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
2324 #define TreeView_SelectSetFirstVisible(hwnd, hitem) \
2325         TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
2326
2327
2328 #define TreeView_GetItemA(hwnd, pitem) \
2329  (BOOL)SendMessageA((hwnd), TVM_GETITEMA, 0, (LPARAM) (TVITEMA *)(pitem))
2330 #define TreeView_GetItemW(hwnd, pitem) \
2331  (BOOL)SendMessageW((hwnd), TVM_GETITEMA, 0, (LPARAM) (TVITEMA *)(pitem))
2332 #define TreeView_GetItem WINELIB_NAME_AW(TreeView_GetItem) 
2333
2334 #define TreeView_SetItemA(hwnd, pitem) \
2335  (BOOL)SendMessageA((hwnd), TVM_SETITEMA, 0, (LPARAM)(const TVITEMA *)(pitem)) 
2336 #define TreeView_SetItemW(hwnd, pitem) \
2337  (BOOL)SendMessageW((hwnd), TVM_SETITEMA, 0, (LPARAM)(const TVITEMA *)(pitem)) 
2338 #define TreeView_SetItem WINELIB_NAME_AW(TreeView_SetItem)
2339
2340 #define TreeView_EditLabel(hwnd, hitem) \
2341     (HWND)SendMessageA((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
2342
2343 #define TreeView_GetEditControl(hwnd) \
2344     (HWND)SendMessageA((hwnd), TVM_GETEDITCONTROL, 0, 0)
2345
2346 #define TreeView_GetVisibleCount(hwnd) \
2347     (UINT)SendMessageA((hwnd), TVM_GETVISIBLECOUNT, 0, 0)
2348
2349 #define TreeView_HitTest(hwnd, lpht) \
2350     (HTREEITEM)SendMessageA((hwnd), TVM_HITTEST, 0,\
2351 (LPARAM)(LPTVHITTESTINFO)(lpht))
2352
2353 #define TreeView_CreateDragImage(hwnd, hitem) \
2354     (HIMAGELIST)SendMessageA((hwnd), TVM_CREATEDRAGIMAGE, 0,\
2355 (LPARAM)(HTREEITEM)(hitem))
2356
2357 #define TreeView_SortChildren(hwnd, hitem, recurse) \
2358     (BOOL)SendMessageA((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse,\
2359 (LPARAM)(HTREEITEM)(hitem))
2360
2361 #define TreeView_EnsureVisible(hwnd, hitem) \
2362     (BOOL)SendMessageA((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(UINT)(hitem))
2363
2364 #define TreeView_SortChildrenCB(hwnd, psort, recurse) \
2365     (BOOL)SendMessageA((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \
2366     (LPARAM)(LPTV_SORTCB)(psort))
2367
2368 #define TreeView_EndEditLabelNow(hwnd, fCancel) \
2369     (BOOL)SendMessageA((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0)
2370
2371 #define TreeView_GetISearchString(hwnd, lpsz) \
2372     (BOOL)SendMessageA((hwnd), TVM_GETISEARCHSTRING, 0, \
2373                                                         (LPARAM)(LPTSTR)lpsz)
2374
2375 #define TreeView_SetToolTips(hwnd,  hwndTT) \
2376     (HWND)SendMessageA((hwnd), TVM_SETTOOLTIPS, (WPARAM)(hwndTT), 0)
2377
2378 #define TreeView_GetToolTips(hwnd) \
2379     (HWND)SendMessageA((hwnd), TVM_GETTOOLTIPS, 0, 0)
2380
2381 #define TreeView_SetItemHeight(hwnd,  iHeight) \
2382     (INT)SendMessageA((hwnd), TVM_SETITEMHEIGHT, (WPARAM)iHeight, 0)
2383
2384 #define TreeView_GetItemHeight(hwnd) \
2385     (INT)SendMessageA((hwnd), TVM_GETITEMHEIGHT, 0, 0)
2386
2387 #define TreeView_SetBkColor(hwnd, clr) \
2388     (COLORREF)SendMessageA((hwnd), TVM_SETBKCOLOR, 0, (LPARAM)clr)
2389
2390 #define TreeView_SetTextColor(hwnd, clr) \
2391     (COLORREF)SendMessageA((hwnd), TVM_SETTEXTCOLOR, 0, (LPARAM)clr)
2392
2393 #define TreeView_GetBkColor(hwnd) \
2394     (COLORREF)SendMessageA((hwnd), TVM_GETBKCOLOR, 0, 0)
2395
2396 #define TreeView_GetTextColor(hwnd) \
2397     (COLORREF)SendMessageA((hwnd), TVM_GETTEXTCOLOR, 0, 0)
2398
2399 #define TreeView_SetScrollTime(hwnd, uTime) \
2400     (UINT)SendMessageA((hwnd), TVM_SETSCROLLTIME, uTime, 0)
2401
2402 #define TreeView_GetScrollTime(hwnd) \
2403     (UINT)SendMessageA((hwnd), TVM_GETSCROLLTIME, 0, 0)
2404
2405 #define TreeView_SetInsertMark(hwnd, hItem, fAfter) \
2406     (BOOL)SendMessageA((hwnd), TVM_SETINSERTMARK, (WPARAM)(fAfter), \
2407                        (LPARAM) (hItem))
2408
2409 #define TreeView_SetInsertMarkColor(hwnd, clr) \
2410     (COLORREF)SendMessageA((hwnd), TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr)
2411
2412 #define TreeView_GetInsertMarkColor(hwnd) \
2413     (COLORREF)SendMessageA((hwnd), TVM_GETINSERTMARKCOLOR, 0, 0)
2414
2415 #define TreeView_GetItemState(hwndTV, hti, mask) \
2416    (UINT)SendMessageA((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), (LPARAM)(mask))
2417 #define TreeView_GetCheckState(hwndTV, hti) \
2418    ((((UINT)(SendMessageA((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti),  \
2419                      TVIS_STATEIMAGEMASK))) >> 12) -1)
2420
2421 #define TreeView_SetLineColor(hwnd, clr) \
2422     (COLORREF)SendMessageA((hwnd), TVM_SETLINECOLOR, 0, (LPARAM)(clr))
2423
2424 #define TreeView_GetLineColor(hwnd) \
2425     (COLORREF)SendMessageA((hwnd), TVM_GETLINECOLOR, 0, 0)
2426
2427 #define TreeView_SetItemState(hwndTV, hti, data, _mask) \
2428 { TVITEM _TVi; \
2429   _TVi.mask = TVIF_STATE; \
2430   _TVi.hItem = hti; \
2431   _TVi.stateMask = _mask; \
2432   _TVi.state = data; \
2433   SendMessageA((hwndTV), TVM_SETITEM, 0, (LPARAM)(TV_ITEM *)&_TVi); \
2434 }
2435
2436
2437 /* Listview control */
2438
2439 #define WC_LISTVIEWA          "SysListView32"
2440 static const WCHAR WC_LISTVIEWW[] = { 'S','y','s',
2441   'L','i','s','t','V','i','e','w','3','2',0 };
2442 #define WC_LISTVIEW  WINELIB_NAME_AW(WC_LISTVIEW)
2443
2444 #define LVSCW_AUTOSIZE -1
2445 #define LVSCW_AUTOSIZE_USEHEADER -2
2446
2447 #define LVS_ICON                0x0000
2448 #define LVS_REPORT              0x0001
2449 #define LVS_SMALLICON           0x0002
2450 #define LVS_LIST                0x0003
2451 #define LVS_TYPEMASK            0x0003
2452 #define LVS_SINGLESEL           0x0004
2453 #define LVS_SHOWSELALWAYS       0x0008
2454 #define LVS_SORTASCENDING       0x0010
2455 #define LVS_SORTDESCENDING      0x0020
2456 #define LVS_SHAREIMAGELISTS     0x0040
2457 #define LVS_NOLABELWRAP         0x0080
2458 #define LVS_AUTOARRANGE         0x0100
2459 #define LVS_EDITLABELS          0x0200
2460 #define LVS_OWNERDATA           0x1000
2461 #define LVS_NOSCROLL            0x2000
2462 #define LVS_TYPESTYLEMASK       0xfc00
2463 #define LVS_ALIGNTOP            0x0000
2464 #define LVS_ALIGNLEFT           0x0800
2465 #define LVS_ALIGNMASK           0x0c00
2466 #define LVS_OWNERDRAWFIXED      0x0400
2467 #define LVS_NOCOLUMNHEADER      0x4000
2468 #define LVS_NOSORTHEADER        0x8000
2469
2470 #define LVS_EX_GRIDLINES        0x0001
2471 #define LVS_EX_SUBITEMIMAGES    0x0002
2472 #define LVS_EX_CHECKBOXES       0x0004
2473 #define LVS_EX_TRACKSELECT      0x0008
2474 #define LVS_EX_HEADERDRAGDROP   0x0010
2475 #define LVS_EX_FULLROWSELECT    0x0020
2476 #define LVS_EX_ONECLICKACTIVATE 0x0040
2477 #define LVS_EX_TWOCLICKACTIVATE 0x0080
2478 #define LVS_EX_FLATSB           0x0100
2479 #define LVS_EX_REGIONAL         0x0200
2480 #define LVS_EX_INFOTIP          0x0400
2481 #define LVS_EX_UNDERLINEHOT     0x0800
2482 #define LVS_EX_UNDERLINECOLD    0x1000
2483 #define LVS_EX_MULTIWORKAREAS   0x2000
2484
2485 #define LVCF_FMT                0x0001
2486 #define LVCF_WIDTH              0x0002
2487 #define LVCF_TEXT               0x0004
2488 #define LVCF_SUBITEM            0x0008
2489 #define LVCF_IMAGE              0x0010
2490 #define LVCF_ORDER              0x0020
2491
2492 #define LVCFMT_LEFT             0x0000
2493 #define LVCFMT_RIGHT            0x0001
2494 #define LVCFMT_CENTER           0x0002
2495 #define LVCFMT_JUSTIFYMASK      0x0003
2496 #define LVCFMT_IMAGE            0x0800
2497 #define LVCFMT_BITMAP_ON_RIGHT  0x1000
2498 #define LVCFMT_COL_HAS_IMAGES   0x8000
2499
2500 #define LVSIL_NORMAL            0
2501 #define LVSIL_SMALL             1
2502 #define LVSIL_STATE             2
2503
2504 /* following 2 flags only for LVS_OWNERDATA listviews */
2505 /* and only in report or list mode */
2506 #define LVSICF_NOINVALIDATEALL  0x0001
2507 #define LVSICF_NOSCROLL         0x0002
2508
2509
2510 #define LVFI_PARAM              0X0001
2511 #define LVFI_STRING             0X0002
2512 #define LVFI_PARTIAL            0X0008
2513 #define LVFI_WRAP               0X0020  
2514 #define LVFI_NEARESTXY          0X0040
2515
2516 #define LVIF_TEXT               0x0001
2517 #define LVIF_IMAGE              0x0002
2518 #define LVIF_PARAM              0x0004
2519 #define LVIF_STATE              0x0008
2520 #define LVIF_INDENT             0x0010
2521 #define LVIF_NORECOMPUTE        0x0800
2522 #define LVIF_DI_SETITEM         0x1000
2523
2524 #define LVIR_BOUNDS             0x0000
2525 #define LVIR_LABEL              0x0002
2526 #define LVIR_ICON               0x0001
2527 #define LVIR_SELECTBOUNDS       0x0003 
2528
2529 #define LVIS_FOCUSED            0x0001
2530 #define LVIS_SELECTED           0x0002
2531 #define LVIS_CUT                0x0004
2532 #define LVIS_DROPHILITED        0x0008
2533 #define LVIS_ACTIVATING         0x0020
2534
2535 #define LVIS_OVERLAYMASK        0x0F00
2536 #define LVIS_STATEIMAGEMASK     0xF000
2537
2538 #define LVNI_ALL                0x0000
2539 #define LVNI_FOCUSED            0x0001
2540 #define LVNI_SELECTED           0x0002
2541 #define LVNI_CUT                0x0004
2542 #define LVNI_DROPHILITED        0x0008
2543
2544 #define LVNI_ABOVE              0x0100
2545 #define LVNI_BELOW              0x0200
2546 #define LVNI_TOLEFT             0x0400
2547 #define LVNI_TORIGHT            0x0800
2548
2549 #define LVHT_NOWHERE            0x0001
2550 #define LVHT_ONITEMICON         0x0002
2551 #define LVHT_ONITEMLABEL        0x0004
2552 #define LVHT_ONITEMSTATEICON    0x0008
2553 #define LVHT_ONITEM             (LVHT_ONITEMICON|LVHT_ONITEMLABEL|LVHT_ONITEMSTATEICON)
2554
2555 #define LVHT_ABOVE              0x0008
2556 #define LVHT_BELOW              0x0010
2557 #define LVHT_TORIGHT            0x0020
2558 #define LVHT_TOLEFT             0x0040
2559
2560 #define LVM_FIRST               0x1000
2561 #define LVM_GETBKCOLOR          (LVM_FIRST+0)
2562 #define LVM_SETBKCOLOR          (LVM_FIRST+1)
2563 #define LVM_GETIMAGELIST        (LVM_FIRST+2)
2564 #define LVM_SETIMAGELIST        (LVM_FIRST+3)
2565 #define LVM_GETITEMCOUNT        (LVM_FIRST+4)
2566 #define LVM_GETITEMA          (LVM_FIRST+5)
2567 #define LVM_GETITEMW          (LVM_FIRST+75)
2568 #define LVM_GETITEM             WINELIB_NAME_AW(LVM_GETITEM)
2569 #define LVM_SETITEMA          (LVM_FIRST+6)
2570 #define LVM_SETITEMW          (LVM_FIRST+76)
2571 #define LVM_SETITEM             WINELIB_NAME_AW(LVM_SETITEM)
2572 #define LVM_INSERTITEMA       (LVM_FIRST+7)
2573 #define LVM_INSERTITEMW       (LVM_FIRST+77)
2574 #define LVM_INSERTITEM          WINELIB_NAME_AW(LVM_INSERTITEM)
2575 #define LVM_DELETEITEM          (LVM_FIRST+8)
2576 #define LVM_DELETEALLITEMS      (LVM_FIRST+9)
2577 #define LVM_GETCALLBACKMASK     (LVM_FIRST+10)
2578 #define LVM_SETCALLBACKMASK     (LVM_FIRST+11)
2579 #define LVM_GETNEXTITEM         (LVM_FIRST+12)
2580 #define LVM_FINDITEMA         (LVM_FIRST+13)
2581 #define LVM_FINDITEMW         (LVM_FIRST+83)
2582 #define LVM_FINDITEM            WINELIB_NAME_AW(LVM_FINDITEM)
2583 #define LVM_GETITEMRECT         (LVM_FIRST+14)
2584 #define LVM_SETITEMPOSITION     (LVM_FIRST+15)
2585 #define LVM_GETITEMPOSITION     (LVM_FIRST+16)
2586 #define LVM_GETSTRINGWIDTHA   (LVM_FIRST+17)
2587 #define LVM_GETSTRINGWIDTHW   (LVM_FIRST+87)
2588 #define LVM_GETSTRINGWIDTH      WINELIB_NAME_AW(LVM_GETSTRINGWIDTH)
2589 #define LVM_HITTEST             (LVM_FIRST+18)
2590 #define LVM_ENSUREVISIBLE       (LVM_FIRST+19)
2591 #define LVM_SCROLL              (LVM_FIRST+20)
2592 #define LVM_REDRAWITEMS         (LVM_FIRST+21)
2593 #define LVM_ARRANGE             (LVM_FIRST+22)
2594 #define LVM_EDITLABELA        (LVM_FIRST+23)
2595 #define LVM_EDITLABELW        (LVM_FIRST+118)
2596 #define LVM_EDITLABEL           WINELIB_NAME_AW(LVM_EDITLABEL)
2597 #define LVM_GETEDITCONTROL      (LVM_FIRST+24)
2598 #define LVM_GETCOLUMNA        (LVM_FIRST+25)
2599 #define LVM_GETCOLUMNW        (LVM_FIRST+95)
2600 #define LVM_GETCOLUMN           WINELIB_NAME_AW(LVM_GETCOLUMN)
2601 #define LVM_SETCOLUMNA        (LVM_FIRST+26)
2602 #define LVM_SETCOLUMNW        (LVM_FIRST+96)
2603 #define LVM_SETCOLUMN           WINELIB_NAME_AW(LVM_SETCOLUMN)
2604 #define LVM_INSERTCOLUMNA     (LVM_FIRST+27)
2605 #define LVM_INSERTCOLUMNW     (LVM_FIRST+97)
2606 #define LVM_INSERTCOLUMN        WINELIB_NAME_AW(LVM_INSERTCOLUMN)
2607 #define LVM_DELETECOLUMN        (LVM_FIRST+28)
2608 #define LVM_GETCOLUMNWIDTH      (LVM_FIRST+29)
2609 #define LVM_SETCOLUMNWIDTH      (LVM_FIRST+30)
2610 #define LVM_GETHEADER           (LVM_FIRST+31)
2611
2612 #define LVM_CREATEDRAGIMAGE     (LVM_FIRST+33)
2613 #define LVM_GETVIEWRECT         (LVM_FIRST+34)
2614 #define LVM_GETTEXTCOLOR        (LVM_FIRST+35)
2615 #define LVM_SETTEXTCOLOR        (LVM_FIRST+36)
2616 #define LVM_GETTEXTBKCOLOR      (LVM_FIRST+37)
2617 #define LVM_SETTEXTBKCOLOR      (LVM_FIRST+38)
2618 #define LVM_GETTOPINDEX         (LVM_FIRST+39)
2619 #define LVM_GETCOUNTPERPAGE     (LVM_FIRST+40)
2620 #define LVM_GETORIGIN           (LVM_FIRST+41)
2621 #define LVM_UPDATE              (LVM_FIRST+42)
2622 #define LVM_SETITEMSTATE        (LVM_FIRST+43)
2623 #define LVM_GETITEMSTATE        (LVM_FIRST+44)
2624 #define LVM_GETITEMTEXTA      (LVM_FIRST+45)
2625 #define LVM_GETITEMTEXTW      (LVM_FIRST+115)
2626 #define LVM_GETITEMTEXT         WINELIB_NAME_AW(LVM_GETITEMTEXT)
2627 #define LVM_SETITEMTEXTA      (LVM_FIRST+46)
2628 #define LVM_SETITEMTEXTW      (LVM_FIRST+116)
2629 #define LVM_SETITEMTEXT         WINELIB_NAME_AW(LVM_SETITEMTEXT)
2630 #define LVM_SETITEMCOUNT        (LVM_FIRST+47)
2631 #define LVM_SORTITEMS           (LVM_FIRST+48)
2632 #define LVM_SETITEMPOSITION32   (LVM_FIRST+49)
2633 #define LVM_GETSELECTEDCOUNT    (LVM_FIRST+50)
2634 #define LVM_GETITEMSPACING      (LVM_FIRST+51)
2635 #define LVM_GETISEARCHSTRINGA (LVM_FIRST+52)
2636 #define LVM_GETISEARCHSTRINGW (LVM_FIRST+117)
2637 #define LVM_GETISEARCHSTRING    WINELIB_NAME_AW(LVM_GETISEARCHSTRING)
2638 #define LVM_SETICONSPACING      (LVM_FIRST+53)
2639 #define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+54)
2640 #define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+55)
2641 #define LVM_GETSUBITEMRECT      (LVM_FIRST+56)
2642 #define LVM_SUBITEMHITTEST      (LVM_FIRST+57)
2643 #define LVM_SETCOLUMNORDERARRAY (LVM_FIRST+58)
2644 #define LVM_GETCOLUMNORDERARRAY (LVM_FIRST+59)
2645 #define LVM_SETHOTITEM          (LVM_FIRST+60)
2646 #define LVM_GETHOTITEM          (LVM_FIRST+61)
2647 #define LVM_SETHOTCURSOR        (LVM_FIRST+62)
2648 #define LVM_GETHOTCURSOR        (LVM_FIRST+63)
2649 #define LVM_APPROXIMATEVIEWRECT (LVM_FIRST+64)
2650 #define LVM_SETWORKAREAS        (LVM_FIRST+65)
2651 #define LVM_GETSELECTIONMARK    (LVM_FIRST+66)
2652 #define LVM_SETSELECTIONMARK    (LVM_FIRST+67)
2653 #define LVM_SETBKIMAGEA       (LVM_FIRST+68)
2654 #define LVM_SETBKIMAGEW       (LVM_FIRST+138)
2655 #define LVM_SETBKIMAGE          WINELIB_NAME_AW(LVM_SETBKIMAGE)
2656 #define LVM_GETBKIMAGEA       (LVM_FIRST+69)
2657 #define LVM_GETBKIMAGEW       (LVM_FIRST+139)
2658 #define LVM_GETBKIMAGE          WINELIB_NAME_AW(LVM_GETBKIMAGE)
2659 #define LVM_GETWORKAREAS        (LVM_FIRST+70)
2660 #define LVM_SETHOVERTIME        (LVM_FIRST+71)
2661 #define LVM_GETHOVERTIME        (LVM_FIRST+72)
2662 #define LVM_GETNUMBEROFWORKAREAS (LVM_FIRST+73)
2663 #define LVM_SETTOOLTIPS         (LVM_FIRST+74)
2664 #define LVM_GETTOOLTIPS         (LVM_FIRST+78)
2665
2666 #define LVN_FIRST               (0U-100U)
2667 #define LVN_LAST                (0U-199U)
2668 #define LVN_ITEMCHANGING        (LVN_FIRST-0)
2669 #define LVN_ITEMCHANGED         (LVN_FIRST-1)
2670 #define LVN_INSERTITEM          (LVN_FIRST-2)
2671 #define LVN_DELETEITEM          (LVN_FIRST-3)
2672 #define LVN_DELETEALLITEMS      (LVN_FIRST-4)
2673 #define LVN_BEGINLABELEDITA   (LVN_FIRST-5)
2674 #define LVN_BEGINLABELEDITW   (LVN_FIRST-75)
2675 #define LVN_BEGINLABELEDIT WINELIB_NAME_AW(LVN_BEGINLABELEDIT)
2676 #define LVN_ENDLABELEDITA     (LVN_FIRST-6)
2677 #define LVN_ENDLABELEDITW     (LVN_FIRST-76)
2678 #define LVN_ENDLABELEDIT WINELIB_NAME_AW(LVN_ENDLABELEDIT)
2679 #define LVN_COLUMNCLICK         (LVN_FIRST-8)
2680 #define LVN_BEGINDRAG           (LVN_FIRST-9)
2681 #define LVN_BEGINRDRAG          (LVN_FIRST-11)
2682 #define LVN_ODCACHEHINT         (LVN_FIRST-13)
2683 #define LVN_ITEMACTIVATE        (LVN_FIRST-14)
2684 #define LVN_ODSTATECHANGED      (LVN_FIRST-15)
2685 #define LVN_HOTTRACK            (LVN_FIRST-21)
2686 #define LVN_ODFINDITEMA         (LVN_FIRST-52)
2687 #define LVN_ODFINDITEMW         (LVN_FIRST-79)
2688 #define LVN_ODFINDITEM WINELIB_NAME_AW(LVN_ODFINDITEM)
2689 #define LVN_GETDISPINFOA      (LVN_FIRST-50)
2690 #define LVN_GETDISPINFOW      (LVN_FIRST-77)
2691 #define LVN_GETDISPINFO WINELIB_NAME_AW(LVN_GETDISPINFO)
2692 #define LVN_SETDISPINFOA      (LVN_FIRST-51)
2693 #define LVN_SETDISPINFOW      (LVN_FIRST-78)
2694 #define LVN_SETDISPINFO WINELIB_NAME_AW(LVN_SETDISPINFO)
2695 #define LVN_KEYDOWN             (LVN_FIRST-55)
2696 #define LVN_MARQUEEBEGIN        (LVN_FIRST-56)
2697 #define LVN_GETINFOTIPA         (LVN_FIRST-57)
2698 #define LVN_GETINFOTIPW         (LVN_FIRST-58)
2699 #define LVN_GETINFOTIP WINELIB_NAME_AW(LVN_GETINFOTIP)
2700
2701 #define LVA_ALIGNLEFT           0x0000
2702 #define LVA_DEFAULT             0x0001
2703 #define LVA_ALIGNTOP            0x0002
2704 #define LVA_SNAPTOGRID          0x0005
2705
2706 typedef struct tagLVITEMA
2707 {
2708     UINT mask;
2709     INT  iItem;
2710     INT  iSubItem;
2711     UINT state;
2712     UINT stateMask;
2713     LPSTR  pszText;
2714     INT  cchTextMax;
2715     INT  iImage;
2716     LPARAM lParam;
2717     INT  iIndent;       /* (_WIN32_IE >= 0x0300) */
2718 } LVITEMA, *LPLVITEMA;
2719
2720 typedef struct tagLVITEMW
2721 {
2722     UINT mask;
2723     INT  iItem;
2724     INT  iSubItem;
2725     UINT state;
2726     UINT stateMask;
2727     LPWSTR pszText;
2728     INT  cchTextMax;
2729     INT  iImage;
2730     LPARAM lParam;
2731     INT  iIndent;       /* (_WIN32_IE >= 0x0300) */
2732 } LVITEMW, *LPLVITEMW;
2733
2734 /* ListView background image structs and constants
2735    For _WIN32_IE version 0x400 and later. */
2736
2737 typedef struct tagLVBKIMAGEA
2738 {
2739     ULONG ulFlags;
2740     HBITMAP hbm;
2741     LPSTR pszImage;
2742     UINT cchImageMax;
2743     int xOffsetPercent;
2744     int yOffsetPercent;
2745 } LVBKIMAGEA, *LPLVBKIMAGEA;
2746
2747 typedef struct tagLVBKIMAGEW
2748 {
2749     ULONG ulFlags;
2750     HBITMAP hbm;
2751     LPWSTR pszImage;
2752     UINT cchImageMax;
2753     int xOffsetPercent;
2754     int yOffsetPercent;
2755 } LVBKIMAGEW, *LPLVBKIMAGEW;
2756
2757 #define LVBKIMAGE WINELIB_NAME_AW(LVBKIMAGE)
2758 #define LPLVBKIMAGE WINELIB_NAME_AW(LPLVBKIMAGE)
2759
2760 #define LVBKIF_SOURCE_NONE      0x00000000
2761 #define LVBKIF_SOURCE_HBITMAP   0x00000001
2762 #define LVBKIF_SOURCE_URL       0x00000002
2763 #define LVBKIF_SOURCE_MASK      0x00000003
2764 #define LVBKIF_STYLE_NORMAL     0x00000000
2765 #define LVBKIF_STYLE_TILE       0x00000010
2766 #define LVBKIF_STYLE_MASK       0x00000010
2767
2768 #define ListView_SetBkImage(hwnd, plvbki) \
2769     (BOOL)SNDMSG((hwnd), LVM_SETBKIMAGE, 0, (LPARAM)plvbki)
2770
2771 #define ListView_GetBkImage(hwnd, plvbki) \
2772     (BOOL)SNDMSG((hwnd), LVM_GETBKIMAGE, 0, (LPARAM)plvbki)
2773
2774 #define LVITEM   WINELIB_NAME_AW(LVITEM)
2775 #define LPLVITEM WINELIB_NAME_AW(LPLVITEM)
2776
2777 #define LVITEM_V1_SIZEA CCSIZEOF_STRUCT(LVITEMA, lParam)
2778 #define LVITEM_V1_SIZEW CCSIZEOF_STRUCT(LVITEMW, lParam)
2779 #define LVITEM_V1_SIZE WINELIB_NAME_AW(LVITEM_V1_SIZE)
2780
2781 #define LV_ITEM LVITEM
2782
2783 typedef struct tagLVCOLUMNA
2784 {
2785     UINT mask;
2786     INT  fmt;
2787     INT  cx;
2788     LPSTR  pszText;
2789     INT  cchTextMax;
2790     INT  iSubItem;
2791     INT  iImage;  /* (_WIN32_IE >= 0x0300) */
2792     INT  iOrder;  /* (_WIN32_IE >= 0x0300) */
2793 } LVCOLUMNA, *LPLVCOLUMNA;
2794
2795 typedef struct tagLVCOLUMNW
2796 {
2797     UINT mask;
2798     INT  fmt;
2799     INT  cx;
2800     LPWSTR pszText;
2801     INT  cchTextMax;
2802     INT  iSubItem;
2803     INT  iImage;        /* (_WIN32_IE >= 0x0300) */
2804     INT  iOrder;        /* (_WIN32_IE >= 0x0300) */
2805 } LVCOLUMNW, *LPLVCOLUMNW;
2806
2807 #define LVCOLUMN   WINELIB_NAME_AW(LVCOLUMN)
2808 #define LPLVCOLUMN WINELIB_NAME_AW(LPLVCOLUMN)
2809
2810 #define LVCOLUMN_V1_SIZEA CCSIZEOF_STRUCT(LVCOLUMNA, iSubItem)
2811 #define LVCOLUMN_V1_SIZEW CCSIZEOF_STRUCT(LVCOLUMNW, iSubItem)
2812 #define LVCOLUMN_V1_SIZE WINELIB_NAME_AW(LVCOLUMN_V1_SIZE)
2813
2814 #define LV_COLUMN       LVCOLUMN
2815
2816
2817 typedef struct tagNMLISTVIEW
2818 {
2819     NMHDR   hdr;
2820     INT   iItem;
2821     INT   iSubItem;
2822     UINT  uNewState;
2823     UINT  uOldState;
2824     UINT  uChanged;
2825     POINT ptAction;
2826     LPARAM  lParam;
2827 } NMLISTVIEW, *LPNMLISTVIEW;
2828
2829 #define NM_LISTVIEW     NMLISTVIEW
2830 #define LPNM_LISTVIEW   LPNMLISTVIEW
2831
2832 typedef struct tagNMITEMACTIVATE
2833 {
2834     NMHDR hdr;
2835     int iItem;
2836     int iSubItem;
2837     UINT uNewState;
2838     UINT uOldState;
2839     UINT uChanged;
2840     POINT ptAction;
2841     LPARAM lParam;
2842     UINT uKeyFlags;
2843 } NMITEMACTIVATE, *LPNMITEMACTIVATE;
2844
2845 typedef struct tagLVDISPINFO
2846 {
2847     NMHDR     hdr;
2848     LVITEMA item;
2849 } NMLVDISPINFOA, *LPNMLVDISPINFOA;
2850
2851 typedef struct tagLVDISPINFOW
2852 {
2853     NMHDR     hdr;
2854     LVITEMW item;
2855 } NMLVDISPINFOW, *LPNMLVDISPINFOW;
2856
2857 #define NMLVDISPINFO   WINELIB_NAME_AW(NMLVDISPINFO)
2858 #define LPNMLVDISPINFO WINELIB_NAME_AW(LPNMLVDISPINFO)
2859
2860 #define LV_DISPINFO     NMLVDISPINFO
2861
2862 typedef struct tagLVKEYDOWN
2863 {
2864   NMHDR hdr;
2865   WORD  wVKey;
2866   UINT flags;
2867 } NMLVKEYDOWN, *LPNMLVKEYDOWN;
2868
2869 #define LV_KEYDOWN     NMLVKEYDOWN
2870
2871 typedef struct tagNMLVGETINFOTIPA
2872 {
2873     NMHDR hdr;
2874     DWORD dwFlags;
2875     LPSTR pszText;
2876     int cchTextMax;
2877     int iItem;
2878     int iSubItem;
2879     LPARAM lParam;
2880 } NMLVGETINFOTIPA, *LPNMLVGETINFOTIPA;
2881
2882 typedef struct tagNMLVGETINFOTIPW
2883 {
2884     NMHDR hdr;
2885     DWORD dwFlags;
2886     LPWSTR pszText;
2887     int cchTextMax;
2888     int iItem;
2889     int iSubItem;
2890     LPARAM lParam;
2891 } NMLVGETINFOTIPW, *LPNMLVGETINFOTIPW;
2892
2893 #define NMLVGETINFOTIP WINELIB_NAME_AW(NMLVGETINFOTIP)
2894 #define LPNMLVGETINFOTIP WINELIB_NAME_AW(LPNMLVGETINFOTIP)
2895
2896 typedef struct tagLVHITTESTINFO
2897 {
2898     POINT pt;
2899     UINT  flags;
2900     INT   iItem;
2901     INT   iSubItem;
2902 } LVHITTESTINFO, *LPLVHITTESTINFO;
2903
2904 #define LV_HITTESTINFO LVHITTESTINFO
2905 #define _LV_HITTESTINFO tagLVHITTESTINFO
2906 #define LVHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(LVHITTESTINFO,iItem)
2907
2908 typedef struct tagLVFINDINFO
2909 {
2910         UINT flags;
2911         LPCSTR psz;
2912         LPARAM lParam;
2913         POINT pt;
2914         UINT vkDirection;
2915 } LVFINDINFO, *LPLVFINDINFO;
2916
2917 #define LV_FINDINFO LVFINDINFO
2918
2919 typedef struct tagTCHITTESTINFO
2920 {
2921         POINT pt;
2922         UINT flags;
2923 } TCHITTESTINFO, *LPTCHITTESTINFO;
2924
2925 #define TC_HITTESTINFO TCHITTESTINFO
2926
2927 typedef INT CALLBACK (*PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
2928
2929 #define NMLVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMLCUSTOMDRW, clrTextBk)
2930
2931 typedef struct tagNMLVCUSTOMDRAW
2932 {
2933     NMCUSTOMDRAW nmcd;
2934     COLORREF clrText;
2935     COLORREF clrTextBk;
2936     int iSubItem;
2937 } NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
2938
2939 typedef struct tagNMLVCACHEHINT
2940 {
2941         NMHDR   hdr;
2942         INT     iFrom;
2943         INT     iTo;
2944 } NMLVCACHEHINT, *LPNMLVCACHEHINT;
2945
2946 #define LPNM_CACHEHINT LPNMLVCACHEHINT
2947 #define PNM_CACHEHINT  LPNMLVCACHEHINT
2948 #define NM_CACHEHINT   NMLVCACHEHINT
2949
2950 typedef struct tagNMLVFINDITEM
2951 {
2952     NMHDR hdr;
2953     int iStart;
2954     LVFINDINFO lvfi;
2955 } NMLVFINDITEM, *LPNMLVFINDITEM;
2956
2957 #define NM_FINDITEM NMLVFINDITEM
2958 #define PNM_FINDITEM LPNMLVFINDITEM
2959 #define LPNM_FINDITEM LPNMLVFINDITEM
2960
2961 typedef struct tagNMLVODSTATECHANGE
2962 {
2963     NMHDR hdr;
2964     int iFrom;
2965     int iTo;
2966     UINT uNewState;
2967     UINT uOldState;
2968 } NMLVODSTATECHANGE, *LPNMLVODSTATECHANGE;
2969
2970 #define PNM_ODSTATECHANGE LPNMLVODSTATECHANGE
2971 #define LPNM_ODSTATECHANGE LPNMLVODSTATECHANGE
2972 #define NM_ODSTATECHANGE NMLVODSTATECHANGE
2973
2974 #define ListView_SetTextBkColor(hwnd,clrBk) \
2975     (BOOL)SendMessageA((hwnd),LVM_SETTEXTBKCOLOR,0,(LPARAM)(COLORREF)(clrBk))
2976 #define ListView_SetTextColor(hwnd,clrBk) \
2977     (BOOL)SendMessageA((hwnd),LVM_SETTEXTCOLOR,0,(LPARAM)(COLORREF)(clrBk))
2978 #define ListView_DeleteColumn(hwnd,col)\
2979     (LRESULT)SendMessageA((hwnd),LVM_DELETECOLUMN,0,(LPARAM)(INT)(col))
2980 #define ListView_GetColumnA(hwnd,x,col)\
2981     (LRESULT)SendMessageA((hwnd),LVM_GETCOLUMNA,(WPARAM)(INT)(x),(LPARAM)(LPLVCOLUMNA)(col))
2982 #define ListView_GetColumnW(hwnd,x,col)\
2983     (LRESULT)SendMessageW((hwnd),LVM_GETCOLUMNW,(WPARAM)(INT)(x),(LPARAM)(LPLVCOLUMNW)(col))
2984 #define ListView_GetColumn WINELIB_NAME_AW(ListView_GetColumn)
2985 #define ListView_SetColumnA(hwnd,x,col)\
2986     (LRESULT)SendMessageA((hwnd),LVM_SETCOLUMNA,(WPARAM)(INT)(x),(LPARAM)(LPLVCOLUMNA)(col))
2987 #define ListView_SetColumnW(hwnd,x,col)\
2988     (LRESULT)SendMessageW((hwnd),LVM_SETCOLUMNW,(WPARAM)(INT)(x),(LPARAM)(LPLVCOLUMNW)(col))
2989 #define ListView_SetColumn WINELIB_NAME_AW(ListView_SetColumn)
2990
2991
2992 #define ListView_GetNextItem(hwnd,nItem,flags) \
2993     (INT)SendMessageA((hwnd),LVM_GETNEXTITEM,(WPARAM)(INT)(nItem),(LPARAM)(MAKELPARAM(flags,0)))
2994 #define ListView_FindItem(hwnd,nItem,plvfi) \
2995     (INT)SendMessageA((hwnd),LVM_FINDITEMA,(WPARAM)(INT)(nItem),(LPARAM)(LVFINDINFO*)(plvfi))
2996 #define ListView_Arrange(hwnd,code) \
2997     (INT)SendMessageA((hwnd),LVM_ARRANGE,(WPARAM)(INT)(code),0L)
2998 #define ListView_GetItemPosition(hwnd,i,ppt) \
2999     (INT)SendMessageA((hwnd),LVM_GETITEMPOSITION,(WPARAM)(INT)(i),(LPARAM)(LPPOINT)(ppt))
3000 #define ListView_GetItemRect(hwnd,i,prc,code) \
3001         (BOOL)SendMessageA((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \
3002         ((prc) ? (((RECT*)(prc))->left = (code),(LPARAM)(RECT \
3003         *)(prc)) : (LPARAM)(RECT*)NULL))
3004 #define ListView_SetItemA(hwnd,pitem) \
3005     (INT)SendMessageA((hwnd),LVM_SETITEMA,0,(LPARAM)(const LVITEMA *)(pitem))
3006 #define ListView_SetItemW(hwnd,pitem) \
3007     (INT)SendMessageW((hwnd),LVM_SETITEMW,0,(LPARAM)(const LVITEMW *)(pitem))
3008 #define ListView_SetItem WINELIB_NAME_AW(ListView_SetItem)
3009 #define ListView_SetItemState(hwnd,i,pitem) \
3010     (BOOL)SendMessageA((hwnd),LVM_SETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(LPLVITEMA)(pitem))
3011 #define ListView_GetItemState(hwnd,i,mask) \
3012     (BOOL)SendMessageA((hwnd),LVM_GETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(UINT)(mask))
3013 #define ListView_GetCountPerPage(hwnd) \
3014     (BOOL)SendMessageW((hwnd),LVM_GETCOUNTPERPAGE,0,0L)
3015 #define ListView_GetImageList(hwnd,iImageList) \
3016     (HIMAGELIST)SendMessageA((hwnd),LVM_GETIMAGELIST,(WPARAM)(INT)(iImageList),0L)
3017 #define ListView_GetStringWidthA(hwnd,pstr) \
3018     (INT)SendMessageA((hwnd),LVM_GETSTRINGWIDTHA,0,(LPARAM)(LPCSTR)(pstr))
3019 #define ListView_GetStringWidthW(hwnd,pstr) \
3020     (INT)SendMessageW((hwnd),LVM_GETSTRINGWIDTHW,0,(LPARAM)(LPCWSTR)(pstr))
3021 #define ListView_GetStringWidth WINELIB_NAME_AW(ListView_GetStringWidth)
3022 #define ListView_GetTopIndex(hwnd) \
3023     (BOOL)SendMessageA((hwnd),LVM_GETTOPINDEX,0,0L)
3024 #define ListView_Scroll(hwnd,dx,dy) \
3025     (BOOL)SendMessageA((hwnd),LVM_SCROLL,(WPARAM)(INT)(dx),(LPARAM)(INT)(dy))
3026 #define ListView_EnsureVisible(hwnd,i,fPartialOk) \
3027     (BOOL)SendMessageA((hwnd),LVM_ENSUREVISIBLE,(WPARAM)(INT)i,(LPARAM)(BOOL)fPartialOk)
3028 #define ListView_SetBkColor(hwnd,clrBk) \
3029     (BOOL)SendMessageA((hwnd),LVM_SETBKCOLOR,0,(LPARAM)(COLORREF)(clrBk))
3030 #define ListView_SetImageList(hwnd,himl,iImageList) \
3031     (HIMAGELIST)(UINT)SendMessageA((hwnd),LVM_SETIMAGELIST,(WPARAM)(iImageList),(LPARAM)(UINT)(HIMAGELIST)(himl))
3032 #define ListView_GetItemCount(hwnd) \
3033     (INT)SendMessageA((hwnd),LVM_GETITEMCOUNT,0,0L)
3034
3035 #define ListView_GetItemA(hwnd,pitem) \
3036     (BOOL)SendMessageA((hwnd),LVM_GETITEMA,0,(LPARAM)(LVITEMA *)(pitem))
3037 #define ListView_GetItemW(hwnd,pitem) \
3038     (BOOL)SendMessageW((hwnd),LVM_GETITEMW,0,(LPARAM)(LVITEMW *)(pitem))
3039 #define ListView_GetItem WINELIB_NAME_AW(ListView_GetItem)
3040
3041 #define ListView_HitTest(hwnd,pinfo) \
3042     (INT)SendMessageA((hwnd),LVM_HITTEST,0,(LPARAM)(LPLVHITTESTINFO)(pinfo))
3043
3044 #define ListView_InsertItemA(hwnd,pitem) \
3045     (INT)SendMessageA((hwnd),LVM_INSERTITEMA,0,(LPARAM)(const LVITEMA *)(pitem))
3046 #define ListView_InsertItemW(hwnd,pitem) \
3047     (INT)SendMessageW((hwnd),LVM_INSERTITEMW,0,(LPARAM)(const LVITEMW *)(pitem))
3048 #define ListView_InsertItem WINELIB_NAME_AW(ListView_InsertItem)
3049
3050 #define ListView_DeleteAllItems(hwnd) \
3051     (BOOL)SendMessageA((hwnd),LVM_DELETEALLITEMS,0,0L)
3052
3053 #define ListView_InsertColumnA(hwnd,iCol,pcol) \
3054     (INT)SendMessageA((hwnd),LVM_INSERTCOLUMNA,(WPARAM)(INT)(iCol),(LPARAM)(const LVCOLUMNA *)(pcol))
3055 #define ListView_InsertColumnW(hwnd,iCol,pcol) \
3056     (INT)SendMessageW((hwnd),LVM_INSERTCOLUMNW,(WPARAM)(INT)(iCol),(LPARAM)(const LVCOLUMNW *)(pcol))
3057 #define ListView_InsertColumn WINELIB_NAME_AW(ListView_InsertColumn)
3058
3059 #define ListView_SortItems(hwndLV,_pfnCompare,_lPrm) \
3060     (BOOL)SendMessageA((hwndLV),LVM_SORTITEMS,(WPARAM)(LPARAM)_lPrm,(LPARAM)(PFNLVCOMPARE)_pfnCompare)
3061 #define ListView_SetItemPosition(hwndLV, i, x, y) \
3062     (BOOL)SendMessageA((hwndLV),LVM_SETITEMPOSITION,(WPARAM)(INT)(i),MAKELPARAM((x),(y)))
3063 #define ListView_GetSelectedCount(hwndLV) \
3064     (UINT)SendMessageA((hwndLV),LVM_GETSELECTEDCOUNT,0,0L)
3065
3066 #define ListView_EditLabelA(hwndLV, i) \
3067     (HWND)SendMessageA((hwndLV),LVM_EDITLABELA,(WPARAM)(int)(i), 0L)
3068 #define ListView_EditLabelW(hwndLV, i) \
3069     (HWND)SendMessageW((hwndLV),LVM_EDITLABELW,(WPARAM)(int)(i), 0L)
3070 #define ListView_EditLabel WINELIB_NAME_AW(ListView_EditLabel)
3071
3072 #define ListView_SetItemTextA(hwndLV, i, _iSubItem, _pszText) \
3073 { LVITEMA _LVi; _LVi.iSubItem = _iSubItem; _LVi.pszText = _pszText;\
3074   SendMessageA(hwndLV, LVM_SETITEMTEXTA, (WPARAM)i, (LPARAM) (LVITEMA*)&_LVi);}                
3075 #define ListView_SetItemTextW(hwndLV, i, _iSubItem, _pszText) \
3076 { LVITEMW _LVi; _LVi.iSubItem = _iSubItem; _LVi.pszText = _pszText;\
3077   SendMessageW(hwndLV, LVM_SETITEMTEXTW, (WPARAM)i, (LPARAM) (LVITEMW*)& _LVi);}                
3078 #define ListView_SetItemText WINELIB_NAME_AW(ListView_SetItemText)
3079
3080 #define ListView_DeleteItem(hwndLV, i) \
3081     (BOOL)SendMessageA(hwndLV, LVM_DELETEITEM, (WPARAM)(int)(i), 0L)
3082 #define ListView_Update(hwndLV, i) \
3083     (BOOL)SendMessageA((hwndLV), LVM_UPDATE, (WPARAM)(i), 0L)
3084 #define ListView_GetColumnOrderArray(hwndLV, iCount, pi) \
3085     (BOOL)SendMessageA((hwndLV), LVM_GETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
3086 #define ListView_GetExtendedListViewStyle(hwndLV) \
3087     (DWORD)SendMessageA((hwndLV), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0L)
3088 #define ListView_GetHotCursor(hwndLV) \
3089     (HCURSOR)SendMessageA((hwndLV), LVM_GETHOTCURSOR, 0, 0L)
3090 #define ListView_GetHotItem(hwndLV) \
3091     (int)SendMessageA((hwndLV), LVM_GETHOTITEM, 0, 0L)
3092 #define ListView_GetItemSpacing(hwndLV, fSmall) \
3093     (DWORD)SendMessageA((hwndLV), LVM_GETITEMSPACING, (WPARAM)fSmall, 0L)
3094 #define ListView_GetSubItemRect(hwndLV, iItem, iSubItem, code, prc) \
3095     (BOOL)SendMessageA((hwndLV), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
3096                        ((prc) ? (((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code):0), (LPARAM)prc)
3097 #define ListView_GetToolTips(hwndLV) \
3098     (HWND)SendMessageA((hwndLV), LVM_GETTOOLTIPS, 0, 0L)
3099 #define ListView_SetColumnOrderArray(hwndLV, iCount, pi) \
3100     (BOOL)SendMessageA((hwndLV), LVM_SETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
3101 #define ListView_SetExtendedListViewStyle(hwndLV, dw) \
3102     (DWORD)SendMessageA((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (LPARAM)dw)
3103 #define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw) \
3104     (DWORD)SendMessageA((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, (WPARAM)dwMask, (LPARAM)dw)
3105 #define ListView_SetHotCursor(hwndLV, hcur) \
3106     (HCURSOR)SendMessageA((hwndLV), LVM_SETHOTCURSOR, 0, (LPARAM)hcur)
3107 #define ListView_SetHotItem(hwndLV, i) \
3108     (int)SendMessageA((hwndLV), LVM_SETHOTITEM, (WPARAM)i, 0L)
3109 #define ListView_SetIconSpacing(hwndLV, cx, cy) \
3110     (DWORD)SendMessageA((hwndLV), LVM_SETICONSPACING, 0, MAKELONG(cx,cy))
3111 #define ListView_SetToolTips(hwndLV, hwndNewHwnd) \
3112     (HWND)SendMessageA((hwndLV), LVM_SETTOOLTIPS, (WPARAM)hwndNewHwnd, 0L)
3113 #define ListView_SubItemHitTest(hwndLV, plvhti) \
3114     (int)SendMessageA((hwndLV), LVM_SUBITEMHITTEST, 0, (LPARAM)(LPLVHITTESTINFO)(plvhti))
3115
3116
3117 /* Tab Control */
3118
3119 #define WC_TABCONTROL16 "SysTabControl"
3120 #define WC_TABCONTROLA          "SysTabControl32"
3121 static const WCHAR WC_TABCONTROLW[] = { 'S','y','s',
3122   'T','a','b','C','o','n','t','r','o','l','3','2',0 };
3123
3124 #define WC_TABCONTROL           WINELIB_NAME_AW(WC_TABCONTROL)
3125
3126 /* tab control styles */
3127 #define TCS_SCROLLOPPOSITE      0x0001   /* assumes multiline tab */
3128 #define TCS_BOTTOM              0x0002
3129 #define TCS_RIGHT               0x0002
3130 #define TCS_MULTISELECT         0x0004  /* allow multi-select in button mode */
3131 #define TCS_FLATBUTTONS         0x0008
3132 #define TCS_FORCEICONLEFT       0x0010
3133 #define TCS_FORCELABELLEFT      0x0020
3134 #define TCS_HOTTRACK            0x0040
3135 #define TCS_VERTICAL            0x0080
3136 #define TCS_TABS                0x0000
3137 #define TCS_BUTTONS             0x0100
3138 #define TCS_SINGLELINE          0x0000
3139 #define TCS_MULTILINE           0x0200
3140 #define TCS_RIGHTJUSTIFY        0x0000
3141 #define TCS_FIXEDWIDTH          0x0400
3142 #define TCS_RAGGEDRIGHT         0x0800
3143 #define TCS_FOCUSONBUTTONDOWN   0x1000
3144 #define TCS_OWNERDRAWFIXED      0x2000
3145 #define TCS_TOOLTIPS            0x4000
3146 #define TCS_FOCUSNEVER          0x8000
3147 #define TCS_EX_FLATSEPARATORS   0x00000001  /* to be used with */
3148 #define TCS_EX_REGISTERDROP     0x00000002  /* TCM_SETEXTENDEDSTYLE */
3149
3150
3151 #define TCM_FIRST               0x1300
3152
3153 #define TCM_GETIMAGELIST        (TCM_FIRST + 2)
3154 #define TCM_SETIMAGELIST        (TCM_FIRST + 3)
3155 #define TCM_GETITEMCOUNT        (TCM_FIRST + 4)
3156 #define TCM_GETITEM                             WINELIB_NAME_AW(TCM_GETITEM)
3157 #define TCM_GETITEMA                    (TCM_FIRST + 5)
3158 #define TCM_GETITEMW                    (TCM_FIRST + 60)
3159 #define TCM_SETITEMA                    (TCM_FIRST + 6)
3160 #define TCM_SETITEMW                    (TCM_FIRST + 61)
3161 #define TCM_SETITEM                             WINELIB_NAME_AW(TCM_SETITEM)
3162 #define TCM_INSERTITEMA         (TCM_FIRST + 7)
3163 #define TCM_INSERTITEMW         (TCM_FIRST + 62)
3164 #define TCM_INSERTITEM                  WINELIB_NAME_AW(TCM_INSERTITEM)
3165 #define TCM_DELETEITEM          (TCM_FIRST + 8)
3166 #define TCM_DELETEALLITEMS      (TCM_FIRST + 9)
3167 #define TCM_GETITEMRECT         (TCM_FIRST + 10)
3168 #define TCM_GETCURSEL           (TCM_FIRST + 11)
3169 #define TCM_SETCURSEL           (TCM_FIRST + 12)
3170 #define TCM_HITTEST             (TCM_FIRST + 13)
3171 #define TCM_SETITEMEXTRA        (TCM_FIRST + 14)
3172 #define TCM_ADJUSTRECT          (TCM_FIRST + 40)
3173 #define TCM_SETITEMSIZE         (TCM_FIRST + 41)
3174 #define TCM_REMOVEIMAGE         (TCM_FIRST + 42)
3175 #define TCM_SETPADDING          (TCM_FIRST + 43)
3176 #define TCM_GETROWCOUNT         (TCM_FIRST + 44)
3177 #define TCM_GETTOOLTIPS         (TCM_FIRST + 45)
3178 #define TCM_SETTOOLTIPS         (TCM_FIRST + 46)
3179 #define TCM_GETCURFOCUS         (TCM_FIRST + 47)
3180 #define TCM_SETCURFOCUS         (TCM_FIRST + 48)
3181 #define TCM_SETMINTABWIDTH     (TCM_FIRST + 49)
3182 #define TCM_DESELECTALL         (TCM_FIRST + 50)
3183 #define TCM_HIGHLIGHTITEM               (TCM_FIRST + 51)
3184 #define TCM_SETEXTENDEDSTYLE    (TCM_FIRST + 52)
3185 #define TCM_GETEXTENDEDSTYLE    (TCM_FIRST + 53)
3186 #define TCM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
3187 #define TCM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
3188
3189
3190 #define TCIF_TEXT               0x0001
3191 #define TCIF_IMAGE              0x0002
3192 #define TCIF_RTLREADING         0x0004
3193 #define TCIF_PARAM              0x0008
3194 #define TCIF_STATE              0x0010
3195
3196 #define TCIS_BUTTONPRESSED      0x0001
3197 #define TCIS_HIGHLIGHTED 0x0002
3198
3199 /* TabCtrl Macros */
3200 #define TabCtrl_GetImageList(hwnd) \
3201     (HIMAGELIST)SendMessageA((hwnd), TCM_GETIMAGELIST, 0, 0L)
3202 #define TabCtrl_SetImageList(hwnd, himl) \
3203     (HIMAGELIST)SendMessageA((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl))
3204 #define TabCtrl_GetItemCount(hwnd) \
3205     (int)SendMessageA((hwnd), TCM_GETITEMCOUNT, 0, 0L)
3206 #define TabCtrl_GetItemA(hwnd, iItem, pitem) \
3207     (BOOL)SendMessageA((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem))
3208 #define TabCtrl_GetItemW(hwnd, iItem, pitem) \
3209     (BOOL)SendMessageW((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem))
3210 #define TabCtrl_GetItem WINELIB_NAME_AW(TabCtrl_GetItem)
3211 #define TabCtrl_SetItemA(hwnd, iItem, pitem) \
3212     (BOOL)SendMessageA((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem))
3213 #define TabCtrl_SetItemW(hwnd, iItem, pitem) \
3214     (BOOL)SendMessageW((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM *)(pitem))
3215 #define TabCtrl_SetItem WINELIB_NAME_AW(TabCtrl_GetItem)
3216 #define TabCtrl_InsertItemA(hwnd, iItem, pitem)   \
3217     (int)SendMessageA((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM *)(pitem))
3218 #define TabCtrl_InsertItemW(hwnd, iItem, pitem)   \
3219     (int)SendMessageW((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM *)(pitem))
3220 #define TabCtrl_InsertItem WINELIB_NAME_AW(TabCtrl_InsertItem)
3221 #define TabCtrl_DeleteItem(hwnd, i) \
3222     (BOOL)SendMessageA((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L)
3223 #define TabCtrl_DeleteAllItems(hwnd) \
3224     (BOOL)SendMessageA((hwnd), TCM_DELETEALLITEMS, 0, 0L)
3225 #define TabCtrl_GetItemRect(hwnd, i, prc) \
3226     (BOOL)SendMessageA((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT *)(prc))
3227 #define TabCtrl_GetCurSel(hwnd) \
3228     (int)SendMessageA((hwnd), TCM_GETCURSEL, 0, 0)
3229 #define TabCtrl_SetCurSel(hwnd, i) \
3230     (int)SendMessageA((hwnd), TCM_SETCURSEL, (WPARAM)i, 0)
3231 #define TabCtrl_HitTest(hwndTC, pinfo) \
3232     (int)SendMessageA((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO *)(pinfo))
3233 #define TabCtrl_SetItemExtra(hwndTC, cb) \
3234     (BOOL)SendMessageA((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L)
3235 #define TabCtrl_AdjustRect(hwnd, bLarger, prc) \
3236     (int)SendMessageA(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT *)prc)
3237 #define TabCtrl_SetItemSize(hwnd, x, y) \
3238     (DWORD)SendMessageA((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y))
3239 #define TabCtrl_RemoveImage(hwnd, i) \
3240     (void)SendMessageA((hwnd), TCM_REMOVEIMAGE, i, 0L)
3241 #define TabCtrl_SetPadding(hwnd,  cx, cy) \
3242     (void)SendMessageA((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
3243 #define TabCtrl_GetRowCount(hwnd) \
3244     (int)SendMessageA((hwnd), TCM_GETROWCOUNT, 0, 0L)
3245 #define TabCtrl_GetToolTips(hwnd) \
3246     (HWND)SendMessageA((hwnd), TCM_GETTOOLTIPS, 0, 0L)
3247 #define TabCtrl_SetToolTips(hwnd, hwndTT) \
3248     (void)SendMessageA((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L)
3249 #define TabCtrl_GetCurFocus(hwnd) \
3250     (int)SendMessageA((hwnd), TCM_GETCURFOCUS, 0, 0)
3251 #define TabCtrl_SetCurFocus(hwnd, i) \
3252     SendMessageA((hwnd),TCM_SETCURFOCUS, i, 0)
3253 #define TabCtrl_SetMinTabWidth(hwnd, x) \
3254     (int)SendMessageA((hwnd), TCM_SETMINTABWIDTH, 0, x)
3255 #define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\
3256     (void)SendMessageA((hwnd), TCM_DESELECTALL, fExcludeFocus, 0)
3257
3258
3259 /* constants for TCHITTESTINFO */
3260
3261 #define TCHT_NOWHERE      0x01
3262 #define TCHT_ONITEMICON   0x02
3263 #define TCHT_ONITEMLABEL  0x04
3264 #define TCHT_ONITEM       (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
3265
3266
3267 typedef struct tagTCITEMA {
3268     UINT mask;
3269     UINT dwState;
3270     UINT dwStateMask;
3271     LPSTR  pszText;
3272     INT  cchTextMax;
3273     INT  iImage;
3274     LPARAM lParam;
3275 } TCITEMA, *LPTCITEMA;
3276
3277 typedef struct tagTCITEMW
3278 {
3279     UINT mask;
3280     DWORD  dwState;
3281     DWORD  dwStateMask;
3282     LPWSTR pszText;
3283     INT  cchTextMax;
3284     INT  iImage;
3285     LPARAM lParam;
3286 } TCITEMW, *LPTCITEMW;
3287
3288 #define TCITEM   WINELIB_NAME_AW(TCITEM)
3289 #define LPTCITEM WINELIB_NAME_AW(LPTCITEM)
3290 #define TC_ITEM  TCITEM
3291
3292 #define TCN_FIRST               (0U-550U)
3293 #define TCN_LAST                (0U-580U)
3294 #define TCN_KEYDOWN             (TCN_FIRST - 0)
3295 #define TCN_SELCHANGE           (TCN_FIRST - 1)
3296 #define TCN_SELCHANGING         (TCN_FIRST - 2)
3297 #define TCN_GETOBJECT      (TCN_FIRST - 3)
3298
3299 typedef struct tagTCKEYDOWN
3300 {
3301     NMHDR hdr;
3302     WORD wVKey;
3303     UINT flags;
3304 } NMTCKEYDOWN;
3305
3306 #define TC_KEYDOWN              NMTCKEYDOWN
3307
3308 /* ComboBoxEx control */
3309
3310 #define WC_COMBOBOXEXA        "ComboBoxEx32"
3311 static const WCHAR WC_COMBOBOXEXW[] = { 'C','o','m','b','o',
3312   'B','o','x','E','x','3','2',0 };
3313 #define WC_COMBOBOXEX           WINELIB_NAME_AW(WC_COMBOBOXEX)
3314
3315 #define CBEIF_TEXT              0x00000001
3316 #define CBEIF_IMAGE             0x00000002
3317 #define CBEIF_SELECTEDIMAGE     0x00000004
3318 #define CBEIF_OVERLAY           0x00000008
3319 #define CBEIF_INDENT            0x00000010
3320 #define CBEIF_LPARAM            0x00000020
3321 #define CBEIF_DI_SETITEM        0x10000000
3322
3323 #define CBEM_INSERTITEMA      (WM_USER+1)
3324 #define CBEM_INSERTITEMW      (WM_USER+11)
3325 #define CBEM_INSERTITEM         WINELIB_NAME_AW(CBEM_INSERTITEM)
3326 #define CBEM_SETIMAGELIST       (WM_USER+2)
3327 #define CBEM_GETIMAGELIST       (WM_USER+3)
3328 #define CBEM_GETITEMA         (WM_USER+4)
3329 #define CBEM_GETITEMW         (WM_USER+13)
3330 #define CBEM_GETITEM            WINELIB_NAME_AW(CBEM_GETITEM)
3331 #define CBEM_SETITEMA         (WM_USER+5)
3332 #define CBEM_SETITEMW         (WM_USER+12)
3333 #define CBEM_SETITEM            WINELIB_NAME_AW(CBEM_SETITEM)
3334 #define CBEM_DELETEITEM         CB_DELETESTRING
3335 #define CBEM_GETCOMBOCONTROL    (WM_USER+6)
3336 #define CBEM_GETEDITCONTROL     (WM_USER+7)
3337 #define CBEM_SETEXSTYLE         (WM_USER+8)
3338 #define CBEM_GETEXSTYLE         (WM_USER+9)
3339 #define CBEM_GETEXTENDEDSTYLE   (WM_USER+9)
3340 #define CBEM_SETEXTENDEDSTYLE   (WM_USER+14)
3341 #define CBEM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
3342 #define CBEM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
3343 #define CBEM_HASEDITCHANGED     (WM_USER+10)
3344 #define CBEM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
3345 #define CBEM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
3346
3347 #define CBEIF_TEXT              0x00000001
3348 #define CBEIF_IMAGE             0x00000002
3349 #define CBEIF_SELECTEDIMAGE     0x00000004
3350 #define CBEIF_OVERLAY           0x00000008
3351 #define CBEIF_INDENT            0x00000010
3352 #define CBEIF_LPARAM            0x00000020
3353 #define CBEIF_DI_SETITEM        0x10000000
3354
3355 #define CBEN_FIRST              (0U-800U)
3356 #define CBEN_LAST               (0U-830U)
3357
3358 #define CBEN_GETDISPINFOA       (CBEN_FIRST - 0)
3359 #define CBEN_GETDISPINFOW       (CBEN_FIRST - 7)
3360 #define CBEN_GETDISPINFO WINELIB_NAME_AW(CBEN_GETDISPINFO)
3361 #define CBEN_INSERTITEM         (CBEN_FIRST - 1)
3362 #define CBEN_DELETEITEM         (CBEN_FIRST - 2)
3363 #define CBEN_BEGINEDIT          (CBEN_FIRST - 4)
3364 #define CBEN_ENDEDITA           (CBEN_FIRST - 5)
3365 #define CBEN_ENDEDITW           (CBEN_FIRST - 6)
3366 #define CBEN_ENDEDIT WINELIB_NAME_AW(CBEN_ENDEDIT)
3367 #define CBEN_DRAGBEGINA         (CBEN_FIRST - 8)
3368 #define CBEN_DRAGBEGINW         (CBEN_FIRST - 9)
3369 #define CBEN_DRAGBEGIN WINELIB_NAME_AW(CBEN_DRAGBEGIN)
3370
3371 #define CBES_EX_NOEDITIMAGE          0x00000001
3372 #define CBES_EX_NOEDITIMAGEINDENT    0x00000002
3373 #define CBES_EX_PATHWORDBREAKPROC    0x00000004
3374 #define CBES_EX_NOSIZELIMIT          0x00000008
3375 #define CBES_EX_CASESENSITIVE        0x00000010
3376
3377
3378 typedef struct tagCOMBOBOXEXITEMA
3379 {
3380     UINT mask;
3381     int iItem;
3382     LPSTR pszText;
3383     int cchTextMax;
3384     int iImage;
3385     int iSelectedImage;
3386     int iOverlay;
3387     int iIndent;
3388     LPARAM lParam;
3389 } COMBOBOXEXITEMA, *PCOMBOBOXEXITEMA;
3390 typedef COMBOBOXEXITEMA CONST *PCCOMBOEXITEMA; /* Yes, there's a BOX missing */
3391
3392 typedef struct tagCOMBOBOXEXITEMW
3393 {
3394     UINT mask;
3395     int iItem;
3396     LPWSTR pszText;
3397     int cchTextMax;
3398     int iImage;
3399     int iSelectedImage;
3400     int iOverlay;
3401     int iIndent;
3402     LPARAM lParam;
3403 } COMBOBOXEXITEMW, *PCOMBOBOXEXITEMW;
3404 typedef COMBOBOXEXITEMW CONST *PCCOMBOEXITEMW; /* Yes, there's a BOX missing */
3405
3406 #define COMBOBOXEXITEM WINELIB_NAME_AW(COMBOBOXEXITEM)
3407 #define PCOMBOBOXEXITEM WINELIB_NAME_AW(PCOMBOBOXEXITEM)
3408 #define PCCOMBOBOXEXITEM WINELIB_NAME_AW(PCCOMBOEXITEM) /* Yes, there's a BOX missing */
3409
3410 #define CBENF_KILLFOCUS               1
3411 #define CBENF_RETURN                  2
3412 #define CBENF_ESCAPE                  3
3413 #define CBENF_DROPDOWN                4
3414
3415 #define CBEMAXSTRLEN 260
3416
3417 typedef struct tagNMCBEENDEDITW
3418 {
3419     NMHDR hdr;
3420     BOOL fChanged;
3421     int iNewSelection;
3422     WCHAR szText[CBEMAXSTRLEN];
3423     int iWhy;
3424 } NMCBEENDEDITW, *LPNMCBEENDEDITW, *PNMCBEENDEDITW;
3425
3426 typedef struct tagNMCBEENDEDITA
3427 {
3428     NMHDR hdr;
3429     BOOL fChanged;
3430     int iNewSelection;
3431     char szText[CBEMAXSTRLEN];
3432     int iWhy;
3433 } NMCBEENDEDITA, *LPNMCBEENDEDITA, *PNMCBEENDEDITA;
3434
3435 #define NMCBEENDEDIT WINELIB_NAME_AW(NMCBEENDEDIT)
3436 #define LPNMCBEENDEDIT WINELIB_NAME_AW(LPNMCBEENDEDIT)
3437 #define PNMCBEENDEDIT WINELIB_NAME_AW(PNMCBEENDEDIT)
3438
3439 typedef struct
3440 {
3441     NMHDR hdr;
3442     COMBOBOXEXITEMA ceItem;
3443 } NMCOMBOBOXEXA, *PNMCOMBOBOXEXA;
3444
3445 typedef struct
3446 {
3447     NMHDR hdr;
3448     COMBOBOXEXITEMW ceItem;
3449 } NMCOMBOBOXEXW, *PNMCOMBOBOXEXW;
3450
3451 #define NMCOMBOBOXEX WINELIB_NAME_AW(NMCOMBOBOXEX)
3452 #define PNMCOMBOBOXEX WINELIB_NAME_AW(PNMCOMBOBOXEX)
3453
3454 typedef struct
3455 {
3456     NMHDR hdr;
3457     int iItemid;
3458     char szText[CBEMAXSTRLEN];
3459 } NMCBEDRAGBEGINA, *PNMCBEDRAGBEGINA, *LPNMCBEDRAGBEGINA;
3460
3461 typedef struct
3462 {
3463     NMHDR hdr;
3464     int iItemid;
3465     WCHAR szText[CBEMAXSTRLEN];
3466 } NMCBEDRAGBEGINW, *PNMCBEDRAGBEGINW, *LPNMCBEDRAGBEGINW;
3467
3468 #define NMCBEDRAGBEGIN WINELIB_NAME_AW(NMCBEDRAGBEGIN)
3469 #define PNMCBEDRAGBEGIN WINELIB_NAME_AW(PNMCBEDRAGBEGIN)
3470 #define LPNMCBEDRAGBEGIN WINELIB_NAME_AW(LPNMCBEDRAGBEGIN)
3471
3472
3473 /* Hotkey control */
3474
3475 #define HOTKEY_CLASS16          "msctls_hotkey"
3476 #define HOTKEY_CLASSA           "msctls_hotkey32"
3477 static const WCHAR HOTKEY_CLASSW[] = { 'm','s','c','t','l','s','_',
3478   'h','o','t','k','e','y','3','2',0 };
3479 #define HOTKEY_CLASS            WINELIB_NAME_AW(HOTKEY_CLASS)
3480
3481 #define HOTKEYF_SHIFT           0x01
3482 #define HOTKEYF_CONTROL         0x02
3483 #define HOTKEYF_ALT             0x04
3484 #define HOTKEYF_EXT             0x08
3485
3486 #define HKCOMB_NONE             0x0001
3487 #define HKCOMB_S                0x0002
3488 #define HKCOMB_C                0x0004
3489 #define HKCOMB_A                0x0008
3490 #define HKCOMB_SC               0x0010
3491 #define HKCOMB_SA               0x0020
3492 #define HKCOMB_CA               0x0040
3493 #define HKCOMB_SCA              0x0080
3494
3495 #define HKM_SETHOTKEY           (WM_USER+1)
3496 #define HKM_GETHOTKEY           (WM_USER+2)
3497 #define HKM_SETRULES            (WM_USER+3)
3498
3499
3500 /* animate control */
3501
3502 #define ANIMATE_CLASSA        "SysAnimate32"
3503 static const WCHAR ANIMATE_CLASSW[] = { 'S','y','s',
3504   'A','n','i','m','a','t','e','3','2',0 };
3505 #define ANIMATE_CLASS           WINELIB_NAME_AW(ANIMATE_CLASS)
3506
3507 #define ACS_CENTER              0x0001
3508 #define ACS_TRANSPARENT         0x0002
3509 #define ACS_AUTOPLAY            0x0004
3510 #define ACS_TIMER               0x0008  /* no threads, just timers */
3511
3512 #define ACM_OPENA             (WM_USER+100)
3513 #define ACM_OPENW             (WM_USER+103)
3514 #define ACM_OPEN                WINELIB_NAME_AW(ACM_OPEN)
3515 #define ACM_PLAY                (WM_USER+101)
3516 #define ACM_STOP                (WM_USER+102)
3517
3518 #define ACN_START               1
3519 #define ACN_STOP                2
3520
3521 #define Animate_CreateA(hwndP,id,dwStyle,hInstance) \
3522     CreateWindowA(ANIMATE_CLASSA,NULL,dwStyle,0,0,0,0,hwndP,(HMENU)(id),hInstance,NULL)
3523 #define Animate_CreateW(hwndP,id,dwStyle,hInstance) \
3524     CreateWindowW(ANIMATE_CLASSW,NULL,dwStyle,0,0,0,0,hwndP,(HMENU)(id),hInstance,NULL)
3525 #define Animate_Create WINELIB_NAME_AW(Animate_Create)
3526 #define Animate_OpenA(hwnd,szName) \
3527     (BOOL)SendMessageA(hwnd,ACM_OPENA,0,(LPARAM)(LPSTR)(szName))
3528 #define Animate_OpenW(hwnd,szName) \
3529     (BOOL)SendMessageW(hwnd,ACM_OPENW,0,(LPARAM)(LPWSTR)(szName))
3530 #define Animate_Open WINELIB_NAME_AW(Animate_Open)
3531 #define Animate_OpenExA(hwnd,hInst,szName) \
3532     (BOOL)SendMessageA(hwnd,ACM_OPENA,(WPARAM)hInst,(LPARAM)(LPSTR)(szName))
3533 #define Animate_OpenExW(hwnd,hInst,szName) \
3534     (BOOL)SendMessageW(hwnd,ACM_OPENW,(WPARAM)hInst,(LPARAM)(LPWSTR)(szName))
3535 #define Animate_OpenEx WINELIB_NAME_AW(Animate_OpenEx)
3536 #define Animate_Play(hwnd,from,to,rep) \
3537     (BOOL)SendMessageA(hwnd,ACM_PLAY,(WPARAM)(UINT)(rep),(LPARAM)MAKELONG(from,to))
3538 #define Animate_Stop(hwnd) \
3539     (BOOL)SendMessageA(hwnd,ACM_STOP,0,0)
3540 #define Animate_Close(hwnd) \
3541     (BOOL)SendMessageA(hwnd,ACM_OPENA,0,0)
3542 #define Animate_Seek(hwnd,frame) \
3543     (BOOL)SendMessageA(hwnd,ACM_PLAY,1,(LPARAM)MAKELONG(frame,frame))
3544
3545
3546 /**************************************************************************
3547  * IP Address control
3548  */
3549
3550 #define WC_IPADDRESSA           "SysIPAddress32"
3551 static const WCHAR WC_IPADDRESSW[] = { 'S','y','s',
3552   'I','P','A','d','d','r','e','s','s','3','2',0 };
3553 #define WC_IPADDRESS            WINELIB_NAME_AW(WC_IPADDRESS)
3554
3555 #define IPM_CLEARADDRESS        (WM_USER+100)
3556 #define IPM_SETADDRESS          (WM_USER+101)
3557 #define IPM_GETADDRESS          (WM_USER+102)
3558 #define IPM_SETRANGE            (WM_USER+103)
3559 #define IPM_SETFOCUS            (WM_USER+104)
3560 #define IPM_ISBLANK             (WM_USER+105)
3561
3562 #define IPN_FIRST               (0U-860U)
3563 #define IPN_LAST                (0U-879U)
3564 #define IPN_FIELDCHANGED    (IPN_FIRST-0)
3565
3566 typedef struct tagNMIPADDRESS
3567 {
3568     NMHDR hdr;
3569     INT iField;
3570     INT iValue;
3571 } NMIPADDRESS, *LPNMIPADDRESS;
3572
3573 #define MAKEIPRANGE(low,high) \
3574     ((LPARAM)(WORD)(((BYTE)(high)<<8)+(BYTE)(low)))
3575 #define MAKEIPADDRESS(b1,b2,b3,b4) \
3576     ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<16)+((DWORD)(b3)<<8)+((DWORD)(b4))))
3577
3578 #define FIRST_IPADDRESS(x)      (((x)>>24)&0xff)
3579 #define SECOND_IPADDRESS(x)     (((x)>>16)&0xff)
3580 #define THIRD_IPADDRESS(x)      (((x)>>8)&0xff)
3581 #define FOURTH_IPADDRESS(x)     ((x)&0xff)
3582
3583
3584 /**************************************************************************
3585  * Native Font control
3586  */
3587
3588 #define WC_NATIVEFONTCTLA       "NativeFontCtl"
3589 static const WCHAR WC_NATIVEFONTCTLW[] = { 'N','a','t','i','v','e',
3590   'F','o','n','t','C','t','l',0 };
3591 #define WC_NATIVEFONTCTL        WINELIB_NAME_AW(WC_NATIVEFONTCTL)
3592
3593 #define NFS_EDIT                0x0001
3594 #define NFS_STATIC              0x0002
3595 #define NFS_LISTCOMBO           0x0004
3596 #define NFS_BUTTON              0x0008
3597 #define NFS_ALL                 0x0010
3598
3599
3600 /**************************************************************************
3601  * Month calendar control
3602  *
3603  */
3604
3605 #define MONTHCAL_CLASSA "SysMonthCal32"
3606 static const WCHAR MONTHCAL_CLASSW[] = { 'S','y','s',
3607   'M','o','n','t','h','C','a','l','3','2',0 };
3608 #define MONTHCAL_CLASS          WINELIB_NAME_AW(MONTHCAL_CLASS)
3609
3610 #define MCM_FIRST             0x1000
3611 #define MCN_FIRST             (0U-750U)
3612 #define MCN_LAST              (0U-759U)
3613
3614
3615 #define MCM_GETCURSEL         (MCM_FIRST + 1)
3616 #define MCM_SETCURSEL         (MCM_FIRST + 2)
3617 #define MCM_GETMAXSELCOUNT    (MCM_FIRST + 3)
3618 #define MCM_SETMAXSELCOUNT    (MCM_FIRST + 4)
3619 #define MCM_GETSELRANGE       (MCM_FIRST + 5)
3620 #define MCM_SETSELRANGE       (MCM_FIRST + 6)
3621 #define MCM_GETMONTHRANGE     (MCM_FIRST + 7)
3622 #define MCM_SETDAYSTATE       (MCM_FIRST + 8)
3623 #define MCM_GETMINREQRECT     (MCM_FIRST + 9)
3624 #define MCM_SETCOLOR          (MCM_FIRST + 10)
3625 #define MCM_GETCOLOR          (MCM_FIRST + 11)
3626 #define MCM_SETTODAY          (MCM_FIRST + 12)
3627 #define MCM_GETTODAY          (MCM_FIRST + 13)
3628 #define MCM_HITTEST           (MCM_FIRST + 14)
3629 #define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15)
3630 #define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16)
3631 #define MCM_GETRANGE          (MCM_FIRST + 17)
3632 #define MCM_SETRANGE          (MCM_FIRST + 18)
3633 #define MCM_GETMONTHDELTA     (MCM_FIRST + 19)
3634 #define MCM_SETMONTHDELTA     (MCM_FIRST + 20)
3635 #define MCM_GETMAXTODAYWIDTH  (MCM_FIRST + 21)
3636 #define MCM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
3637 #define MCM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
3638
3639
3640 /* Notifications */
3641
3642 #define MCN_SELCHANGE         (MCN_FIRST + 1)
3643 #define MCN_GETDAYSTATE       (MCN_FIRST + 3)
3644 #define MCN_SELECT            (MCN_FIRST + 4)
3645
3646 #define MCSC_BACKGROUND   0   
3647 #define MCSC_TEXT         1   
3648 #define MCSC_TITLEBK      2   
3649 #define MCSC_TITLETEXT    3
3650 #define MCSC_MONTHBK      4   
3651 #define MCSC_TRAILINGTEXT 5   
3652
3653 #define MCS_DAYSTATE           0x0001
3654 #define MCS_MULTISELECT        0x0002
3655 #define MCS_WEEKNUMBERS        0x0004
3656 #define MCS_NOTODAY            0x0010
3657 #define MCS_NOTODAYCIRCLE      0x0008
3658
3659 #define MCHT_TITLE             0x00010000
3660 #define MCHT_CALENDAR          0x00020000
3661 #define MCHT_TODAYLINK         0x00030000
3662
3663 #define MCHT_NEXT              0x01000000   
3664 #define MCHT_PREV              0x02000000  
3665 #define MCHT_NOWHERE           0x00000000
3666 #define MCHT_TITLEBK           (MCHT_TITLE)
3667 #define MCHT_TITLEMONTH        (MCHT_TITLE | 0x0001)
3668 #define MCHT_TITLEYEAR         (MCHT_TITLE | 0x0002)
3669 #define MCHT_TITLEBTNNEXT      (MCHT_TITLE | MCHT_NEXT | 0x0003)
3670 #define MCHT_TITLEBTNPREV      (MCHT_TITLE | MCHT_PREV | 0x0003)
3671
3672 #define MCHT_CALENDARBK        (MCHT_CALENDAR)
3673 #define MCHT_CALENDARDATE      (MCHT_CALENDAR | 0x0001)
3674 #define MCHT_CALENDARDATENEXT  (MCHT_CALENDARDATE | MCHT_NEXT)
3675 #define MCHT_CALENDARDATEPREV  (MCHT_CALENDARDATE | MCHT_PREV)
3676 #define MCHT_CALENDARDAY       (MCHT_CALENDAR | 0x0002)
3677 #define MCHT_CALENDARWEEKNUM   (MCHT_CALENDAR | 0x0003)
3678
3679
3680
3681 #define GMR_VISIBLE     0      
3682 #define GMR_DAYSTATE    1     
3683
3684
3685 /*  Month calendar's structures */
3686
3687
3688 typedef struct {
3689         UINT cbSize;
3690         POINT pt;
3691         UINT uHit;   
3692         SYSTEMTIME st;
3693 } MCHITTESTINFO, *PMCHITTESTINFO;
3694
3695 typedef struct tagNMSELCHANGE
3696 {
3697     NMHDR           nmhdr; 
3698     SYSTEMTIME      stSelStart;
3699     SYSTEMTIME      stSelEnd;
3700 } NMSELCHANGE, *LPNMSELCHANGE;
3701
3702 typedef NMSELCHANGE NMSELECT, *LPNMSELECT;
3703 typedef DWORD MONTHDAYSTATE, *LPMONTHDAYSTATE;
3704
3705 typedef struct tagNMDAYSTATE
3706 {
3707     NMHDR           nmhdr;  
3708     SYSTEMTIME      stStart;
3709     int             cDayState;
3710     LPMONTHDAYSTATE prgDayState;
3711 } NMDAYSTATE, *LPNMDAYSTATE;
3712
3713
3714 /* macros */
3715
3716 #define MonthCal_GetCurSel(hmc, pst) \
3717                 (BOOL)SendMessageA(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst))
3718 #define MonthCal_SetCurSel(hmc, pst)  \
3719                 (BOOL)SendMessageA(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst))
3720 #define MonthCal_GetMaxSelCount(hmc) \
3721                 (DWORD)SendMessageA(hmc, MCM_GETMAXSELCOUNT, 0, 0L)
3722 #define MonthCal_SetMaxSelCount(hmc, n) \
3723                 (BOOL)SendMessageA(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L)
3724 #define MonthCal_GetSelRange(hmc, rgst) \
3725                 SendMessageA(hmc, MCM_GETSELRANGE, 0, (LPARAM) (rgst))
3726 #define MonthCal_SetSelRange(hmc, rgst) \
3727                 SendMessageA(hmc, MCM_SETSELRANGE, 0, (LPARAM) (rgst))
3728 #define MonthCal_GetMonthRange(hmc, gmr, rgst) \
3729                 (DWORD)SendMessageA(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst))
3730 #define MonthCal_SetDayState(hmc, cbds, rgds) \
3731                 SendMessageA(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds))
3732 #define MonthCal_GetMinReqRect(hmc, prc) \
3733                 SendMessageA(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc))
3734 #define MonthCal_SetColor(hmc, iColor, clr)\
3735         SendMessageA(hmc, MCM_SETCOLOR, iColor, clr)
3736 #define MonthCal_GetColor(hmc, iColor) \
3737                 SendMessageA(hmc, MCM_SETCOLOR, iColor, 0)
3738 #define MonthCal_GetToday(hmc, pst)\
3739                 (BOOL)SendMessageA(hmc, MCM_GETTODAY, 0, (LPARAM)pst)
3740 #define MonthCal_SetToday(hmc, pst)\
3741                 SendMessageA(hmc, MCM_SETTODAY, 0, (LPARAM)pst)
3742 #define MonthCal_HitTest(hmc, pinfo) \
3743         SendMessageA(hmc, MCM_HITTEST, 0, (LPARAM)(PMCHITTESTINFO)pinfo)
3744 #define MonthCal_SetFirstDayOfWeek(hmc, iDay) \
3745         SendMessageA(hmc, MCM_SETFIRSTDAYOFWEEK, 0, iDay)
3746 #define MonthCal_GetFirstDayOfWeek(hmc) \
3747         (DWORD)SendMessageA(hmc, MCM_GETFIRSTDAYOFWEEK, 0, 0)
3748 #define MonthCal_GetRange(hmc, rgst) \
3749         (DWORD)SendMessageA(hmc, MCM_GETRANGE, 0, (LPARAM)(rgst))
3750 #define MonthCal_SetRange(hmc, gd, rgst) \
3751         (BOOL)SendMessageA(hmc, MCM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
3752 #define MonthCal_GetMonthDelta(hmc) \
3753         (int)SendMessageA(hmc, MCM_GETMONTHDELTA, 0, 0)
3754 #define MonthCal_SetMonthDelta(hmc, n) \
3755         (int)SendMessageA(hmc, MCM_SETMONTHDELTA, n, 0)
3756 #define MonthCal_GetMaxTodayWidth(hmc) \
3757         (DWORD)SendMessageA(hmc, MCM_GETMAXTODAYWIDTH, 0, 0)
3758 #define MonthCal_SetUnicodeFormat(hwnd, fUnicode)  \
3759         (BOOL)SendMessageA((hwnd), MCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
3760 #define MonthCal_GetUnicodeFormat(hwnd)  \
3761         (BOOL)SendMessageA((hwnd), MCM_GETUNICODEFORMAT, 0, 0)
3762
3763
3764 /**************************************************************************
3765  * Date and time picker control
3766  */
3767
3768 #define DATETIMEPICK_CLASSA     "SysDateTimePick32"
3769 static const WCHAR DATETIMEPICK_CLASSW[] = { 'S','y','s',
3770   'D','a','t','e','T','i','m','e','P','i','c','k','3','2',0 };
3771 #define DATETIMEPICK_CLASS      WINELIB_NAME_AW(DATETIMEPICK_CLASS)
3772
3773 #define DTM_FIRST        0x1000
3774 #define DTN_FIRST       (0U-760U)
3775 #define DTN_LAST        (0U-799U)
3776
3777
3778 #define DTM_GETSYSTEMTIME       (DTM_FIRST+1)
3779 #define DTM_SETSYSTEMTIME       (DTM_FIRST+2)
3780 #define DTM_GETRANGE            (DTM_FIRST+3)
3781 #define DTM_SETRANGE            (DTM_FIRST+4)
3782 #define DTM_SETFORMATA      (DTM_FIRST+5)
3783 #define DTM_SETFORMATW      (DTM_FIRST + 50)
3784 #define DTM_SETFORMAT           WINELIB_NAME_AW(DTM_SETFORMAT)
3785 #define DTM_SETMCCOLOR          (DTM_FIRST+6)
3786 #define DTM_GETMCCOLOR          (DTM_FIRST+7)
3787 #define DTM_GETMONTHCAL         (DTM_FIRST+8)
3788 #define DTM_SETMCFONT           (DTM_FIRST+9)
3789 #define DTM_GETMCFONT           (DTM_FIRST+10)
3790
3791
3792 /* Datetime Notifications */
3793
3794 #define DTN_DATETIMECHANGE  (DTN_FIRST + 1) 
3795 #define DTN_USERSTRINGA     (DTN_FIRST + 2) 
3796 #define DTN_WMKEYDOWNA      (DTN_FIRST + 3) 
3797 #define DTN_FORMATA         (DTN_FIRST + 4) 
3798 #define DTN_FORMATQUERYA    (DTN_FIRST + 5) 
3799 #define DTN_DROPDOWN        (DTN_FIRST + 6)
3800 #define DTN_CLOSEUP         (DTN_FIRST + 7) 
3801 #define DTN_USERSTRINGW     (DTN_FIRST + 15)
3802 #define DTN_WMKEYDOWNW      (DTN_FIRST + 16)
3803 #define DTN_FORMATW         (DTN_FIRST + 17)
3804 #define DTN_FORMATQUERYW    (DTN_FIRST + 18)
3805
3806 #define DTN_USERSTRING      WINELIB_NAME_AW(DTN_USERSTRING)
3807 #define DTN_WMKEYDOWN       WINELIB_NAME_AW(DTN_WMKEYDOWN)
3808 #define DTN_FORMAT          WINELIB_NAME_AW(DTN_FORMAT)
3809 #define DTN_FORMATQUERY     WINELIB_NAME_AW(DTN_FORMATQUERY)
3810
3811 #define DTS_SHORTDATEFORMAT 0x0000 
3812 #define DTS_UPDOWN          0x0001 
3813 #define DTS_SHOWNONE        0x0002 
3814 #define DTS_LONGDATEFORMAT  0x0004 
3815 #define DTS_TIMEFORMAT      0x0009 
3816 #define DTS_APPCANPARSE     0x0010 
3817 #define DTS_RIGHTALIGN      0x0020 
3818
3819 typedef struct tagNMDATETIMECHANGE
3820 {
3821     NMHDR       nmhdr;
3822     DWORD       dwFlags;    
3823     SYSTEMTIME  st;         
3824 } NMDATETIMECHANGE, *LPNMDATETIMECHANGE;
3825
3826 typedef struct tagNMDATETIMESTRINGA
3827 {
3828     NMHDR      nmhdr;
3829     LPCSTR     pszUserString; 
3830     SYSTEMTIME st;      
3831     DWORD      dwFlags;  
3832 } NMDATETIMESTRINGA, *LPNMDATETIMESTRINGA;
3833
3834 typedef struct tagNMDATETIMESTRINGW
3835 {
3836     NMHDR      nmhdr;
3837     LPCWSTR    pszUserString;
3838     SYSTEMTIME st;          
3839     DWORD      dwFlags;    
3840 } NMDATETIMESTRINGW, *LPNMDATETIMESTRINGW;
3841
3842 DECL_WINELIB_TYPE_AW(NMDATETIMESTRING)
3843 DECL_WINELIB_TYPE_AW(LPNMDATETIMESTRING)
3844
3845 typedef struct tagNMDATETIMEWMKEYDOWNA
3846 {
3847     NMHDR      nmhdr;
3848     int        nVirtKey;  
3849     LPCSTR     pszFormat; 
3850     SYSTEMTIME st;       
3851 } NMDATETIMEWMKEYDOWNA, *LPNMDATETIMEWMKEYDOWNA;
3852
3853 typedef struct tagNMDATETIMEWMKEYDOWNW
3854 {
3855     NMHDR      nmhdr;
3856     int        nVirtKey;  
3857     LPCWSTR    pszFormat; 
3858     SYSTEMTIME st;       
3859 } NMDATETIMEWMKEYDOWNW, *LPNMDATETIMEWMKEYDOWNW;
3860
3861 DECL_WINELIB_TYPE_AW(NMDATETIMEWMKEYDOWN)
3862 DECL_WINELIB_TYPE_AW(LPNMDATETIMEWMKEYDOWN)
3863
3864 typedef struct tagNMDATETIMEFORMATA
3865 {
3866     NMHDR nmhdr;
3867     LPCSTR  pszFormat;   
3868     SYSTEMTIME st;      
3869     LPCSTR pszDisplay;  
3870     CHAR szDisplay[64]; 
3871 } NMDATETIMEFORMATA, *LPNMDATETIMEFORMATA;
3872
3873
3874 typedef struct tagNMDATETIMEFORMATW
3875 {
3876     NMHDR nmhdr;
3877     LPCWSTR pszFormat;  
3878     SYSTEMTIME st;     
3879     LPCWSTR pszDisplay;
3880     WCHAR szDisplay[64];
3881 } NMDATETIMEFORMATW, *LPNMDATETIMEFORMATW;
3882
3883 DECL_WINELIB_TYPE_AW(NMDATETIMEFORMAT)
3884 DECL_WINELIB_TYPE_AW(LPNMDATETIMEFORMAT)
3885
3886 typedef struct tagNMDATETIMEFORMATQUERYA
3887 {
3888     NMHDR nmhdr;
3889     LPCSTR pszFormat; 
3890     SIZE szMax;       
3891 } NMDATETIMEFORMATQUERYA, *LPNMDATETIMEFORMATQUERYA;
3892
3893 typedef struct tagNMDATETIMEFORMATQUERYW
3894 {
3895     NMHDR nmhdr;
3896     LPCWSTR pszFormat; 
3897     SIZE szMax;        
3898 } NMDATETIMEFORMATQUERYW, *LPNMDATETIMEFORMATQUERYW;
3899
3900 DECL_WINELIB_TYPE_AW(NMDATETIMEFORMATQUERY)
3901 DECL_WINELIB_TYPE_AW(LPNMDATETIMEFORMATQUERY)
3902
3903
3904
3905 #define GDT_ERROR    -1
3906 #define GDT_VALID    0
3907 #define GDT_NONE     1
3908
3909 #define GDTR_MIN     0x0001
3910 #define GDTR_MAX     0x0002
3911
3912
3913 #define DateTime_GetSystemtime(hdp, pst)   \
3914   (DWORD)SendMessageA (hdp, DTM_GETSYSTEMTIME , 0, (LPARAM)(pst)) 
3915 #define DateTime_SetSystemtime(hdp, gd, pst)   \
3916   (BOOL)SendMessageA (hdp, DTM_SETSYSTEMTIME, (LPARAM)(gd), (LPARAM)(pst))
3917 #define DateTime_GetRange(hdp, rgst)  \
3918   (DWORD)SendMessageA (hdp, DTM_GETRANGE, 0, (LPARAM)(rgst)) 
3919 #define DateTime_SetRange(hdp, gd, rgst) \
3920    (BOOL)SendMessageA (hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
3921 #define DateTime_SetFormat WINELIB_NAME_AW(DateTime_SetFormat)
3922 #define DateTime_SetFormatA(hdp, sz)  \
3923   (BOOL)SendMessageA (hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
3924 #define DateTime_SetFormatW(hdp, sz)  \
3925   (BOOL)SendMessageW (hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
3926 #define DateTime_GetMonthCalColor(hdp, iColor) \
3927   SendMessageA (hdp, DTM_GETMCCOLOR, iColor, 0)
3928 #define DateTime_GetMonthCal(hdp)  \
3929   (HWND) SendMessageA (hdp, DTM_GETMONTHCAL, 0, 0)
3930 #define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) \
3931   SendMessageA (hdp, DTM_SETMCFONT, (WPARAM)hfont, (LPARAM)fRedraw)
3932 #define DateTime_GetMonthCalFont(hdp) \
3933   SendMessageA (hdp, DTM_GETMCFONT, 0, 0)
3934
3935
3936
3937
3938
3939
3940 /**************************************************************************
3941  *  UNDOCUMENTED functions
3942  */
3943
3944 /* private heap memory functions */
3945
3946 LPVOID WINAPI COMCTL32_Alloc (DWORD);
3947 LPVOID WINAPI COMCTL32_ReAlloc (LPVOID, DWORD);
3948 BOOL WINAPI COMCTL32_Free (LPVOID);
3949 DWORD  WINAPI COMCTL32_GetSize (LPVOID);
3950
3951 LPWSTR WINAPI COMCTL32_StrChrW (LPCWSTR, WORD);
3952
3953
3954 INT  WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
3955 BOOL WINAPI Str_SetPtrA (LPSTR *, LPCSTR);
3956 INT  WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
3957 BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR);
3958 #define Str_GetPtr WINELIB_NAME_AW(Str_GetPtr)
3959 #define Str_SetPtr WINELIB_NAME_AW(Str_SetPtr)
3960
3961
3962 /* Dynamic Storage Array */
3963
3964 typedef struct _DSA
3965 {
3966     INT  nItemCount;
3967     LPVOID pData;
3968     INT  nMaxCount;
3969     INT  nItemSize;
3970     INT  nGrow;
3971 } DSA, *HDSA;
3972
3973 HDSA   WINAPI DSA_Create (INT, INT);
3974 BOOL WINAPI DSA_DeleteAllItems (const HDSA);
3975 INT  WINAPI DSA_DeleteItem (const HDSA, INT);
3976 BOOL WINAPI DSA_Destroy (const HDSA);
3977 BOOL WINAPI DSA_GetItem (const HDSA, INT, LPVOID);
3978 LPVOID WINAPI DSA_GetItemPtr (const HDSA, INT);
3979 INT  WINAPI DSA_InsertItem (const HDSA, INT, LPVOID);
3980 BOOL WINAPI DSA_SetItem (const HDSA, INT, LPVOID);
3981
3982 typedef INT CALLBACK (*DSAENUMPROC)(LPVOID, DWORD);
3983 VOID   WINAPI DSA_EnumCallback (const HDSA, DSAENUMPROC, LPARAM);
3984 BOOL WINAPI DSA_DestroyCallback (const HDSA, DSAENUMPROC, LPARAM);
3985
3986
3987 /* Dynamic Pointer Array */
3988
3989 typedef struct _DPA
3990 {
3991     INT    nItemCount;
3992     LPVOID   *ptrs; 
3993     HANDLE hHeap;
3994     INT    nGrow;
3995     INT    nMaxCount;
3996 } DPA, *HDPA;
3997
3998 HDPA   WINAPI DPA_Create (INT);
3999 HDPA   WINAPI DPA_CreateEx (INT, HANDLE);
4000 BOOL WINAPI DPA_Destroy (const HDPA);
4001 HDPA   WINAPI DPA_Clone (const HDPA, const HDPA);
4002 LPVOID WINAPI DPA_GetPtr (const HDPA, INT);
4003 INT  WINAPI DPA_GetPtrIndex (const HDPA, LPVOID);
4004 BOOL WINAPI DPA_Grow (const HDPA, INT);
4005 BOOL WINAPI DPA_SetPtr (const HDPA, INT, LPVOID);
4006 INT  WINAPI DPA_InsertPtr (const HDPA, INT, LPVOID);
4007 LPVOID WINAPI DPA_DeletePtr (const HDPA, INT);
4008 BOOL WINAPI DPA_DeleteAllPtrs (const HDPA);
4009
4010 typedef INT CALLBACK (*PFNDPACOMPARE)(LPVOID, LPVOID, LPARAM);
4011 BOOL WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM);
4012
4013 #define DPAS_SORTED             0x0001
4014 #define DPAS_INSERTBEFORE       0x0002
4015 #define DPAS_INSERTAFTER        0x0004
4016  
4017 INT  WINAPI DPA_Search (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
4018
4019 #define DPAM_SORT               0x0001
4020
4021 typedef PVOID CALLBACK (*PFNDPAMERGE)(DWORD,PVOID,PVOID,LPARAM);
4022 BOOL WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM);
4023
4024 typedef INT CALLBACK (*DPAENUMPROC)(LPVOID, DWORD);
4025 VOID   WINAPI DPA_EnumCallback (const HDPA, DPAENUMPROC, LPARAM);
4026 BOOL WINAPI DPA_DestroyCallback (const HDPA, DPAENUMPROC, LPARAM);
4027
4028
4029 #define DPA_GetPtrCount(hdpa)  (*(INT*)(hdpa))
4030 #define DPA_GetPtrPtr(hdpa)    (*((LPVOID**)((BYTE*)(hdpa)+sizeof(INT))))
4031 #define DPA_FastGetPtr(hdpa,i) (DPA_GetPtrPtr(hdpa)[i])
4032
4033
4034 /* notification helper functions */
4035
4036 LRESULT WINAPI COMCTL32_SendNotify (HWND, HWND, UINT, LPNMHDR);
4037
4038 /* type and functionality of last parameter is still unknown */
4039 LRESULT WINAPI COMCTL32_SendNotifyEx (HWND, HWND, UINT, LPNMHDR, DWORD);
4040
4041 #ifdef __cplusplus
4042 }
4043 #endif
4044
4045 #endif  /* __WINE_COMMCTRL_H */
4046
4047