home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / COMMCTRL.H < prev    next >
C/C++ Source or Header  |  1997-01-16  |  81KB  |  2,678 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * commctrl.h - - Interface for the Windows Common Controls                    *
  4. *                                                                             *
  5. * Version 1.0                                                                 *
  6. *                                                                             *
  7. * Copyright (c) 1991-1996, Microsoft Corp.      All rights reserved.          *
  8. *                                                                             *
  9. \*****************************************************************************/
  10.  
  11. #ifndef _INC_COMMCTRL
  12. #define _INC_COMMCTRL
  13.  
  14. #ifndef NOUSER
  15.  
  16.  
  17. //
  18. // Define API decoration for direct importing of DLL references.
  19. //
  20. #ifndef WINCOMMCTRLAPI
  21. #if !defined(_COMCTL32_) && defined(_WIN32)
  22. #define WINCOMMCTRLAPI DECLSPEC_IMPORT
  23. #else
  24. #define WINCOMMCTRLAPI
  25. #endif
  26. #endif // WINCOMMCTRLAPI
  27.  
  28. //
  29. // For compilers that don't support nameless unions
  30. //
  31. #ifndef DUMMYUNIONNAME
  32. #ifdef NONAMELESSUNION
  33. #define DUMMYUNIONNAME   u
  34. #define DUMMYUNIONNAME2  u2
  35. #define DUMMYUNIONNAME3  u3
  36. #else
  37. #define DUMMYUNIONNAME
  38. #define DUMMYUNIONNAME2
  39. #define DUMMYUNIONNAME3
  40. #endif
  41. #endif // DUMMYUNIONNAME
  42.  
  43. #ifdef _WIN32
  44. #include <pshpack1.h>
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. //
  52. // Users of this header may define any number of these constants to avoid
  53. // the definitions of each functional group.
  54. //
  55. //    NOTOOLBAR    Customizable bitmap-button toolbar control.
  56. //    NOUPDOWN     Up and Down arrow increment/decrement control.
  57. //    NOSTATUSBAR  Status bar control.
  58. //    NOMENUHELP   APIs to help manage menus, especially with a status bar.
  59. //    NOTRACKBAR   Customizable column-width tracking control.
  60. //    NODRAGLIST   APIs to make a listbox source and sink drag&drop actions.
  61. //    NOPROGRESS   Progress gas gauge.
  62. //    NOHOTKEY     HotKey control
  63. //    NOHEADER     Header bar control.
  64. //    NOIMAGEAPIS  ImageList apis.
  65. //    NOLISTVIEW   ListView control.
  66. //    NOTREEVIEW   TreeView control.
  67. //    NOTABCONTROL Tab control.
  68. //    NOANIMATE    Animate control.
  69. //
  70. //=============================================================================
  71.  
  72. #include <prsht.h>
  73.  
  74.  
  75. #ifdef __cplusplus
  76. #define SNDMSG ::SendMessage
  77. #else
  78. #define SNDMSG SendMessage
  79. #endif
  80.  
  81.  
  82. WINCOMMCTRLAPI void WINAPI InitCommonControls(void);
  83.  
  84. #define ODT_HEADER              100
  85. #define ODT_TAB                 101
  86. #define ODT_LISTVIEW            102
  87.  
  88.  
  89. //====== Ranges for control message IDs =======================================
  90.  
  91. #define LVM_FIRST               0x1000      // ListView messages
  92. #define TV_FIRST                0x1100      // TreeView messages
  93. #define HDM_FIRST               0x1200      // Header messages
  94.  
  95. //====== WM_NOTIFY Macros =====================================================
  96.  
  97. #define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \
  98.     (fn)((hwnd), (int)(wParam), (NMHDR FAR*)(lParam))
  99. #define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) \
  100.     (LRESULT)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(idFrom), (LPARAM)(NMHDR FAR*)(pnmhdr))
  101.  
  102.  
  103. //====== Generic WM_NOTIFY notification codes =================================
  104.  
  105. #define NM_OUTOFMEMORY          (NM_FIRST-1)
  106. #define NM_CLICK                (NM_FIRST-2)
  107. #define NM_DBLCLK               (NM_FIRST-3)
  108. #define NM_RETURN               (NM_FIRST-4)
  109. #define NM_RCLICK               (NM_FIRST-5)
  110. #define NM_RDBLCLK              (NM_FIRST-6)
  111. #define NM_SETFOCUS             (NM_FIRST-7)
  112. #define NM_KILLFOCUS            (NM_FIRST-8)
  113.  
  114.  
  115. //====== WM_NOTIFY codes (NMHDR.code values) ==================================
  116.  
  117. #define NM_FIRST                (0U-  0U)       // generic to all controls
  118. #define NM_LAST                 (0U- 99U)
  119.  
  120. #define LVN_FIRST               (0U-100U)       // listview
  121. #define LVN_LAST                (0U-199U)
  122.  
  123. #define HDN_FIRST               (0U-300U)       // header
  124. #define HDN_LAST                (0U-399U)
  125.  
  126. #define TVN_FIRST               (0U-400U)       // treeview
  127. #define TVN_LAST                (0U-499U)
  128.  
  129. #define TTN_FIRST               (0U-520U)       // tooltips
  130. #define TTN_LAST                (0U-549U)
  131.  
  132. #define TCN_FIRST               (0U-550U)       // tab control
  133. #define TCN_LAST                (0U-580U)
  134.  
  135. // Shell reserved               (0U-580U) -  (0U-589U)
  136.  
  137. #define CDN_FIRST               (0U-601U)       // common dialog (new)
  138. #define CDN_LAST                (0U-699U)
  139.  
  140. #define TBN_FIRST               (0U-700U)       // toolbar
  141. #define TBN_LAST                (0U-720U)
  142.  
  143. #define UDN_FIRST               (0U-721)        // updown
  144. #define UDN_LAST                (0U-740)
  145.  
  146. #define MSGF_COMMCTRL_BEGINDRAG     0x4200
  147. #define MSGF_COMMCTRL_SIZEHEADER    0x4201
  148. #define MSGF_COMMCTRL_DRAGSELECT    0x4202
  149. #define MSGF_COMMCTRL_TOOLBARCUST   0x4203
  150.  
  151.  
  152.  
  153. //====== IMAGE APIS ===========================================================
  154.  
  155. #ifndef NOIMAGEAPIS
  156.  
  157. #define CLR_NONE                0xFFFFFFFFL
  158. #define CLR_DEFAULT             0xFF000000L
  159.  
  160. struct _IMAGELIST;
  161. typedef struct _IMAGELIST NEAR* HIMAGELIST;
  162.  
  163. #define ILC_MASK                0x0001
  164. #define ILC_COLOR               0x0000
  165. #define ILC_COLORDDB            0x00FE
  166. #define ILC_COLOR4              0x0004
  167. #define ILC_COLOR8              0x0008
  168. #define ILC_COLOR16             0x0010
  169. #define ILC_COLOR24             0x0018
  170. #define ILC_COLOR32             0x0020
  171. #define ILC_PALETTE             0x0800
  172.  
  173. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow);
  174. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Destroy(HIMAGELIST himl);
  175. WINCOMMCTRLAPI int         WINAPI ImageList_GetImageCount(HIMAGELIST himl);
  176. WINCOMMCTRLAPI int         WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask);
  177. WINCOMMCTRLAPI int         WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, int i, HICON hicon);
  178. WINCOMMCTRLAPI COLORREF    WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk);
  179. WINCOMMCTRLAPI COLORREF    WINAPI ImageList_GetBkColor(HIMAGELIST himl);
  180. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetOverlayImage(HIMAGELIST himl, int iImage, int iOverlay);
  181.  
  182. #define     ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon)
  183.  
  184. #define ILD_NORMAL              0x0000
  185. #define ILD_TRANSPARENT         0x0001
  186. #define ILD_MASK                0x0010
  187. #define ILD_IMAGE               0x0020
  188. #define ILD_BLEND25             0x0002
  189. #define ILD_BLEND50             0x0004
  190. #define ILD_OVERLAYMASK         0x0F00
  191. #define INDEXTOOVERLAYMASK(i)   ((i) << 8)
  192.  
  193. #define ILD_SELECTED            ILD_BLEND50
  194. #define ILD_FOCUS               ILD_BLEND25
  195. #define ILD_BLEND               ILD_BLEND50
  196. #define CLR_HILIGHT             CLR_DEFAULT
  197.  
  198. WINCOMMCTRLAPI BOOL WINAPI ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle);
  199.  
  200.  
  201. #ifdef _WIN32
  202.  
  203. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Replace(HIMAGELIST himl, int i, HBITMAP hbmImage, HBITMAP hbmMask);
  204. WINCOMMCTRLAPI int         WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask);
  205. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
  206. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Remove(HIMAGELIST himl, int i);
  207. WINCOMMCTRLAPI HICON       WINAPI ImageList_GetIcon(HIMAGELIST himl, int i, UINT flags);
  208. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_LoadImageA(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  209. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  210.  
  211. #ifdef UNICODE
  212. #define ImageList_LoadImage     ImageList_LoadImageW
  213. #else
  214. #define ImageList_LoadImage     ImageList_LoadImageA
  215. #endif
  216.  
  217. WINCOMMCTRLAPI BOOL        WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, int iTrack, int dxHotspot, int dyHotspot);
  218. WINCOMMCTRLAPI void        WINAPI ImageList_EndDrag();
  219. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragEnter(HWND hwndLock, int x, int y);
  220. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragLeave(HWND hwndLock);
  221. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragMove(int x, int y);
  222. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag, int iDrag, int dxHotspot, int dyHotspot);
  223.  
  224. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragShowNolock(BOOL fShow);
  225. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_GetDragImage(POINT FAR* ppt,POINT FAR* pptHotspot);
  226.  
  227. #define     ImageList_RemoveAll(himl) ImageList_Remove(himl, -1)
  228. #define     ImageList_ExtractIcon(hi, himl, i) ImageList_GetIcon(himl, i, 0)
  229. #define     ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask) ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0)
  230.  
  231. #ifdef __IStream_INTERFACE_DEFINED__
  232. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
  233. WINCOMMCTRLAPI BOOL       WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM pstm);
  234. #endif
  235.  
  236. typedef struct _IMAGEINFO
  237. {
  238.     HBITMAP hbmImage;
  239.     HBITMAP hbmMask;
  240.     int     Unused1;
  241.     int     Unused2;
  242.     RECT    rcImage;
  243. } IMAGEINFO;
  244.  
  245. WINCOMMCTRLAPI BOOL        WINAPI ImageList_GetIconSize(HIMAGELIST himl, int FAR *cx, int FAR *cy);
  246. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetIconSize(HIMAGELIST himl, int cx, int cy);
  247. WINCOMMCTRLAPI BOOL        WINAPI ImageList_GetImageInfo(HIMAGELIST himl, int i, IMAGEINFO FAR* pImageInfo);
  248. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy);
  249.  
  250. #endif
  251.  
  252. #endif
  253.  
  254.  
  255. //====== HEADER CONTROL =======================================================
  256.  
  257. #ifndef NOHEADER
  258.  
  259. #ifdef _WIN32
  260. #define WC_HEADERA              "SysHeader32"
  261. #define WC_HEADERW              L"SysHeader32"
  262.  
  263. #ifdef UNICODE
  264. #define WC_HEADER               WC_HEADERW
  265. #else
  266. #define WC_HEADER               WC_HEADERA
  267. #endif
  268.  
  269. #else
  270. #define WC_HEADER               "SysHeader"
  271. #endif
  272.  
  273. #define HDS_HORZ                0x00000000
  274. #define HDS_BUTTONS             0x00000002
  275. #define HDS_HIDDEN              0x00000008
  276.  
  277. typedef struct _HD_ITEMA
  278. {
  279.     UINT    mask;
  280.     int     cxy;
  281.     LPSTR   pszText;
  282.     HBITMAP hbm;
  283.     int     cchTextMax;
  284.     int     fmt;
  285.     LPARAM  lParam;
  286. } HD_ITEMA;
  287.  
  288. typedef struct _HD_ITEMW
  289. {
  290.     UINT    mask;
  291.     int     cxy;
  292.     LPWSTR   pszText;
  293.     HBITMAP hbm;
  294.     int     cchTextMax;
  295.     int     fmt;
  296.     LPARAM  lParam;
  297. } HD_ITEMW;
  298.  
  299. #ifdef UNICODE
  300. #define HD_ITEM HD_ITEMW
  301. #else
  302. #define HD_ITEM HD_ITEMA
  303. #endif
  304.  
  305.  
  306. #define HDI_WIDTH               0x0001
  307. #define HDI_HEIGHT              HDI_WIDTH
  308. #define HDI_TEXT                0x0002
  309. #define HDI_FORMAT              0x0004
  310. #define HDI_LPARAM              0x0008
  311. #define HDI_BITMAP              0x0010
  312.  
  313. #define HDF_LEFT                0
  314. #define HDF_RIGHT               1
  315. #define HDF_CENTER              2
  316. #define HDF_JUSTIFYMASK         0x0003
  317. #define HDF_RTLREADING          4
  318.  
  319. #define HDF_OWNERDRAW           0x8000
  320. #define HDF_STRING              0x4000
  321. #define HDF_BITMAP              0x2000
  322.  
  323.  
  324. #define HDM_GETITEMCOUNT        (HDM_FIRST + 0)
  325. #define Header_GetItemCount(hwndHD) \
  326.     (int)SNDMSG((hwndHD), HDM_GETITEMCOUNT, 0, 0L)
  327.  
  328.  
  329. #define HDM_INSERTITEMA         (HDM_FIRST + 1)
  330. #define HDM_INSERTITEMW         (HDM_FIRST + 10)
  331.  
  332. #ifdef UNICODE
  333. #define HDM_INSERTITEM          HDM_INSERTITEMW
  334. #else
  335. #define HDM_INSERTITEM          HDM_INSERTITEMA
  336. #endif
  337.  
  338. #define Header_InsertItem(hwndHD, i, phdi) \
  339.     (int)SNDMSG((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  340.  
  341.  
  342. #define HDM_DELETEITEM          (HDM_FIRST + 2)
  343. #define Header_DeleteItem(hwndHD, i) \
  344.     (BOOL)SNDMSG((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(i), 0L)
  345.  
  346.  
  347. #define HDM_GETITEMA            (HDM_FIRST + 3)
  348. #define HDM_GETITEMW            (HDM_FIRST + 11)
  349.  
  350. #ifdef UNICODE
  351. #define HDM_GETITEM             HDM_GETITEMW
  352. #else
  353. #define HDM_GETITEM             HDM_GETITEMA
  354. #endif
  355.  
  356. #define Header_GetItem(hwndHD, i, phdi) \
  357.     (BOOL)SNDMSG((hwndHD), HDM_GETITEM, (WPARAM)(int)(i), (LPARAM)(HD_ITEM FAR*)(phdi))
  358.  
  359.  
  360. #define HDM_SETITEMA            (HDM_FIRST + 4)
  361. #define HDM_SETITEMW            (HDM_FIRST + 12)
  362.  
  363. #ifdef UNICODE
  364. #define HDM_SETITEM             HDM_SETITEMW
  365. #else
  366. #define HDM_SETITEM             HDM_SETITEMA
  367. #endif
  368.  
  369. #define Header_SetItem(hwndHD, i, phdi) \
  370.     (BOOL)SNDMSG((hwndHD), HDM_SETITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  371.  
  372.  
  373. typedef struct _HD_LAYOUT
  374. {
  375.     RECT FAR* prc;
  376.     WINDOWPOS FAR* pwpos;
  377. } HD_LAYOUT;
  378.  
  379.  
  380. #define HDM_LAYOUT              (HDM_FIRST + 5)
  381. #define Header_Layout(hwndHD, playout) \
  382.     (BOOL)SNDMSG((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout))
  383.  
  384.  
  385. #define HHT_NOWHERE             0x0001
  386. #define HHT_ONHEADER            0x0002
  387. #define HHT_ONDIVIDER           0x0004
  388. #define HHT_ONDIVOPEN           0x0008
  389. #define HHT_ABOVE               0x0100
  390. #define HHT_BELOW               0x0200
  391. #define HHT_TORIGHT             0x0400
  392. #define HHT_TOLEFT              0x0800
  393.  
  394. typedef struct _HD_HITTESTINFO
  395. {
  396.     POINT pt;
  397.     UINT flags;
  398.     int iItem;
  399. } HD_HITTESTINFO;
  400. #define HDM_HITTEST             (HDM_FIRST + 6)
  401.  
  402.  
  403. #define HDN_ITEMCHANGINGA       (HDN_FIRST-0)
  404. #define HDN_ITEMCHANGINGW       (HDN_FIRST-20)
  405. #define HDN_ITEMCHANGEDA        (HDN_FIRST-1)
  406. #define HDN_ITEMCHANGEDW        (HDN_FIRST-21)
  407. #define HDN_ITEMCLICKA          (HDN_FIRST-2)
  408. #define HDN_ITEMCLICKW          (HDN_FIRST-22)
  409. #define HDN_ITEMDBLCLICKA       (HDN_FIRST-3)
  410. #define HDN_ITEMDBLCLICKW       (HDN_FIRST-23)
  411. #define HDN_DIVIDERDBLCLICKA    (HDN_FIRST-5)
  412. #define HDN_DIVIDERDBLCLICKW    (HDN_FIRST-25)
  413. #define HDN_BEGINTRACKA         (HDN_FIRST-6)
  414. #define HDN_BEGINTRACKW         (HDN_FIRST-26)
  415. #define HDN_ENDTRACKA           (HDN_FIRST-7)
  416. #define HDN_ENDTRACKW           (HDN_FIRST-27)
  417. #define HDN_TRACKA              (HDN_FIRST-8)
  418. #define HDN_TRACKW              (HDN_FIRST-28)
  419.  
  420. #ifdef UNICODE
  421. #define HDN_ITEMCHANGING         HDN_ITEMCHANGINGW
  422. #define HDN_ITEMCHANGED          HDN_ITEMCHANGEDW
  423. #define HDN_ITEMCLICK            HDN_ITEMCLICKW
  424. #define HDN_ITEMDBLCLICK         HDN_ITEMDBLCLICKW
  425. #define HDN_DIVIDERDBLCLICK      HDN_DIVIDERDBLCLICKW
  426. #define HDN_BEGINTRACK           HDN_BEGINTRACKW
  427. #define HDN_ENDTRACK             HDN_ENDTRACKW
  428. #define HDN_TRACK                HDN_TRACKW
  429. #else
  430. #define HDN_ITEMCHANGING         HDN_ITEMCHANGINGA
  431. #define HDN_ITEMCHANGED          HDN_ITEMCHANGEDA
  432. #define HDN_ITEMCLICK            HDN_ITEMCLICKA
  433. #define HDN_ITEMDBLCLICK         HDN_ITEMDBLCLICKA
  434. #define HDN_DIVIDERDBLCLICK      HDN_DIVIDERDBLCLICKA
  435. #define HDN_BEGINTRACK           HDN_BEGINTRACKA
  436. #define HDN_ENDTRACK             HDN_ENDTRACKA
  437. #define HDN_TRACK                HDN_TRACKA
  438. #endif
  439.  
  440.  
  441. typedef struct _HD_NOTIFY
  442. {
  443.     NMHDR   hdr;
  444.     int     iItem;
  445.     int     iButton;
  446.     HD_ITEMA FAR* pitem;
  447. } HD_NOTIFYA;
  448.  
  449. typedef struct _HD_NOTIFYW
  450. {
  451.     NMHDR   hdr;
  452.     int     iItem;
  453.     int     iButton;
  454.     HD_ITEMW FAR* pitem;
  455. } HD_NOTIFYW;
  456.  
  457. #ifdef UNICODE
  458. #define  HD_NOTIFY              HD_NOTIFYW
  459. #else
  460. #define  HD_NOTIFY              HD_NOTIFYA
  461. #endif
  462.  
  463. #endif
  464.  
  465.  
  466. //====== TOOLBAR CONTROL ======================================================
  467.  
  468. #ifndef NOTOOLBAR
  469.  
  470. #ifdef _WIN32
  471. #define TOOLBARCLASSNAMEW       L"ToolbarWindow32"
  472. #define TOOLBARCLASSNAMEA       "ToolbarWindow32"
  473.  
  474. #ifdef  UNICODE
  475. #define TOOLBARCLASSNAME        TOOLBARCLASSNAMEW
  476. #else
  477. #define TOOLBARCLASSNAME        TOOLBARCLASSNAMEA
  478. #endif
  479.  
  480. #else
  481. #define TOOLBARCLASSNAME        "ToolbarWindow"
  482. #endif
  483.  
  484. typedef struct _TBBUTTON {
  485.     int iBitmap;
  486.     int idCommand;
  487.     BYTE fsState;
  488.     BYTE fsStyle;
  489. #ifdef _WIN32
  490.     BYTE bReserved[2];
  491. #endif
  492.     DWORD dwData;
  493.     int iString;
  494. } TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
  495. typedef const TBBUTTON FAR* LPCTBBUTTON;
  496.  
  497. typedef struct _COLORMAP {
  498.     COLORREF from;
  499.     COLORREF to;
  500. } COLORMAP, FAR* LPCOLORMAP;
  501.  
  502. WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps,
  503.                         HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons,
  504.                         int iNumButtons, int dxButton, int dyButton,
  505.                         int dxBitmap, int dyBitmap, UINT uStructSize);
  506.  
  507. WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, int idBitmap,
  508.                                   UINT wFlags, LPCOLORMAP lpColorMap,
  509.                                   int iNumMaps);
  510.  
  511. #define CMB_MASKED              0x02
  512.  
  513. #define TBSTATE_CHECKED         0x01
  514. #define TBSTATE_PRESSED         0x02
  515. #define TBSTATE_ENABLED         0x04
  516. #define TBSTATE_HIDDEN          0x08
  517. #define TBSTATE_INDETERMINATE   0x10
  518. #define TBSTATE_WRAP            0x20
  519.  
  520. #define TBSTYLE_BUTTON          0x00
  521. #define TBSTYLE_SEP             0x01
  522. #define TBSTYLE_CHECK           0x02
  523. #define TBSTYLE_GROUP           0x04
  524. #define TBSTYLE_CHECKGROUP      (TBSTYLE_GROUP | TBSTYLE_CHECK)
  525.  
  526. #define TBSTYLE_TOOLTIPS        0x0100
  527. #define TBSTYLE_WRAPABLE        0x0200
  528. #define TBSTYLE_ALTDRAG         0x0400
  529.  
  530. #define TB_ENABLEBUTTON         (WM_USER + 1)
  531. #define TB_CHECKBUTTON          (WM_USER + 2)
  532. #define TB_PRESSBUTTON          (WM_USER + 3)
  533. #define TB_HIDEBUTTON           (WM_USER + 4)
  534. #define TB_INDETERMINATE        (WM_USER + 5)
  535. #define TB_ISBUTTONENABLED      (WM_USER + 9)
  536. #define TB_ISBUTTONCHECKED      (WM_USER + 10)
  537. #define TB_ISBUTTONPRESSED      (WM_USER + 11)
  538. #define TB_ISBUTTONHIDDEN       (WM_USER + 12)
  539. #define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
  540. #define TB_SETSTATE             (WM_USER + 17)
  541. #define TB_GETSTATE             (WM_USER + 18)
  542. #define TB_ADDBITMAP            (WM_USER + 19)
  543.  
  544. #ifdef _WIN32
  545. typedef struct tagTBADDBITMAP {
  546.         HINSTANCE       hInst;
  547.         UINT            nID;
  548. } TBADDBITMAP, *LPTBADDBITMAP;
  549.  
  550. #define HINST_COMMCTRL          ((HINSTANCE)-1)
  551. #define IDB_STD_SMALL_COLOR     0
  552. #define IDB_STD_LARGE_COLOR     1
  553. #define IDB_VIEW_SMALL_COLOR    4
  554. #define IDB_VIEW_LARGE_COLOR    5
  555.  
  556. // icon indexes for standard bitmap
  557.  
  558. #define STD_CUT                 0
  559. #define STD_COPY                1
  560. #define STD_PASTE               2
  561. #define STD_UNDO                3
  562. #define STD_REDOW               4
  563. #define STD_DELETE              5
  564. #define STD_FILENEW             6
  565. #define STD_FILEOPEN            7
  566. #define STD_FILESAVE            8
  567. #define STD_PRINTPRE            9
  568. #define STD_PROPERTIES          10
  569. #define STD_HELP                11
  570. #define STD_FIND                12
  571. #define STD_REPLACE             13
  572. #define STD_PRINT               14
  573.  
  574. // icon indexes for standard view bitmap
  575.  
  576. #define VIEW_LARGEICONS         0
  577. #define VIEW_SMALLICONS         1
  578. #define VIEW_LIST               2
  579. #define VIEW_DETAILS            3
  580. #define VIEW_SORTNAME           4
  581. #define VIEW_SORTSIZE           5
  582. #define VIEW_SORTDATE           6
  583. #define VIEW_SORTTYPE           7
  584. #define VIEW_PARENTFOLDER       8
  585. #define VIEW_NETCONNECT         9
  586. #define VIEW_NETDISCONNECT      10
  587. #define VIEW_NEWFOLDER          11
  588.  
  589.  
  590. #endif
  591.  
  592. #define TB_ADDBUTTONS           (WM_USER + 20)
  593. #define TB_INSERTBUTTON         (WM_USER + 21)
  594. #define TB_DELETEBUTTON         (WM_USER + 22)
  595. #define TB_GETBUTTON            (WM_USER + 23)
  596. #define TB_BUTTONCOUNT          (WM_USER + 24)
  597. #define TB_COMMANDTOINDEX       (WM_USER + 25)
  598.  
  599. #ifdef _WIN32
  600.  
  601. typedef struct tagTBSAVEPARAMSA {
  602.     HKEY hkr;
  603.     LPCSTR pszSubKey;
  604.     LPCSTR pszValueName;
  605. } TBSAVEPARAMSA;
  606.  
  607. typedef struct tagTBSAVEPARAMSW {
  608.     HKEY hkr;
  609.     LPCWSTR pszSubKey;
  610.     LPCWSTR pszValueName;
  611. } TBSAVEPARAMSW;
  612.  
  613. #ifdef UNICODE
  614. #define TBSAVEPARAMS            TBSAVEPARAMSW
  615. #else
  616. #define TBSAVEPARAMS            TBSAVEPARAMSA
  617. #endif
  618.  
  619. #endif
  620.  
  621. #define TB_SAVERESTOREA         (WM_USER + 26)
  622. #define TB_SAVERESTOREW         (WM_USER + 76)
  623. #define TB_CUSTOMIZE            (WM_USER + 27)
  624. #define TB_ADDSTRINGA           (WM_USER + 28)
  625. #define TB_ADDSTRINGW           (WM_USER + 77)
  626. #define TB_GETITEMRECT          (WM_USER + 29)
  627. #define TB_BUTTONSTRUCTSIZE     (WM_USER + 30)
  628. #define TB_SETBUTTONSIZE        (WM_USER + 31)
  629. #define TB_SETBITMAPSIZE        (WM_USER + 32)
  630. #define TB_AUTOSIZE             (WM_USER + 33)
  631. #define TB_GETTOOLTIPS          (WM_USER + 35)
  632. #define TB_SETTOOLTIPS          (WM_USER + 36)
  633. #define TB_SETPARENT            (WM_USER + 37)
  634. #define TB_SETROWS              (WM_USER + 39)
  635. #define TB_GETROWS              (WM_USER + 40)
  636. #define TB_SETCMDID             (WM_USER + 42)
  637. #define TB_CHANGEBITMAP         (WM_USER + 43)
  638. #define TB_GETBITMAP            (WM_USER + 44)
  639. #define TB_GETBUTTONTEXTA       (WM_USER + 45)
  640. #define TB_GETBUTTONTEXTW       (WM_USER + 75)
  641. #define TB_REPLACEBITMAP        (WM_USER + 46)
  642. #define TB_SETINDENT            (WM_USER + 47)
  643.  
  644.  
  645. #ifdef UNICODE
  646. #define TB_GETBUTTONTEXT        TB_GETBUTTONTEXTW
  647. #define TB_SAVERESTORE          TB_SAVERESTOREW
  648. #define TB_ADDSTRING            TB_ADDSTRINGW
  649. #else
  650. #define TB_GETBUTTONTEXT        TB_GETBUTTONTEXTA
  651. #define TB_SAVERESTORE          TB_SAVERESTOREA
  652. #define TB_ADDSTRING            TB_ADDSTRINGA
  653. #endif
  654.  
  655. typedef struct {
  656.         HINSTANCE       hInstOld;
  657.         UINT            nIDOld;
  658.         HINSTANCE       hInstNew;
  659.         UINT            nIDNew;
  660.         int             nButtons;
  661. } TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
  662.  
  663. #ifdef _WIN32
  664.  
  665. #define TBBF_LARGE              0x0001
  666.  
  667. #define TB_GETBITMAPFLAGS       (WM_USER + 41)
  668.  
  669. #define TBN_GETBUTTONINFOA      (TBN_FIRST-0)
  670. #define TBN_GETBUTTONINFOW      (TBN_FIRST-20)
  671. #define TBN_BEGINDRAG           (TBN_FIRST-1)
  672. #define TBN_ENDDRAG             (TBN_FIRST-2)
  673. #define TBN_BEGINADJUST         (TBN_FIRST-3)
  674. #define TBN_ENDADJUST           (TBN_FIRST-4)
  675. #define TBN_RESET               (TBN_FIRST-5)
  676. #define TBN_QUERYINSERT         (TBN_FIRST-6)
  677. #define TBN_QUERYDELETE         (TBN_FIRST-7)
  678. #define TBN_TOOLBARCHANGE       (TBN_FIRST-8)
  679. #define TBN_CUSTHELP            (TBN_FIRST-9)
  680.  
  681. #ifdef UNICODE
  682. #define TBN_GETBUTTONINFO       TBN_GETBUTTONINFOW
  683. #else
  684. #define TBN_GETBUTTONINFO       TBN_GETBUTTONINFOA
  685. #endif
  686.  
  687. typedef struct tagTBNOTIFYA {
  688.     NMHDR   hdr;
  689.     int     iItem;
  690.     TBBUTTON tbButton;
  691.     int     cchText;
  692.     LPSTR   pszText;
  693. } TBNOTIFYA, FAR *LPTBNOTIFYA;
  694.  
  695. typedef struct tagTBNOTIFYW {
  696.     NMHDR   hdr;
  697.     int     iItem;
  698.     TBBUTTON tbButton;
  699.     int     cchText;
  700.     LPWSTR   pszText;
  701. } TBNOTIFYW, FAR *LPTBNOTIFYW;
  702.  
  703. #ifdef UNICODE
  704. #define TBNOTIFY                TBNOTIFYW
  705. #define LPTBNOTIFY              LPTBNOTIFYW
  706. #else
  707. #define TBNOTIFY                TBNOTIFYA
  708. #define LPTBNOTIFY              LPTBNOTIFYA
  709. #endif
  710.  
  711. #endif
  712.  
  713. #endif
  714.  
  715.  
  716. //====== TOOLTIPS CONTROL =====================================================
  717.  
  718. #ifndef NOTOOLTIPS
  719.  
  720. #ifdef _WIN32
  721.  
  722. #define TOOLTIPS_CLASSW         L"tooltips_class32"
  723. #define TOOLTIPS_CLASSA         "tooltips_class32"
  724.  
  725. #ifdef UNICODE
  726. #define TOOLTIPS_CLASS          TOOLTIPS_CLASSW
  727. #else
  728. #define TOOLTIPS_CLASS          TOOLTIPS_CLASSA
  729. #endif
  730.  
  731. #else
  732. #define TOOLTIPS_CLASS          "tooltips_class"
  733. #endif
  734.  
  735. typedef struct tagTOOLINFOA {
  736.     UINT cbSize;
  737.     UINT uFlags;
  738.     HWND hwnd;
  739.     UINT uId;
  740.     RECT rect;
  741.     HINSTANCE hinst;
  742.     LPSTR lpszText;
  743. } TOOLINFOA, NEAR *PTOOLINFOA, FAR *LPTOOLINFOA;
  744.  
  745. typedef struct tagTOOLINFOW {
  746.     UINT cbSize;
  747.     UINT uFlags;
  748.     HWND hwnd;
  749.     UINT uId;
  750.     RECT rect;
  751.     HINSTANCE hinst;
  752.     LPWSTR lpszText;
  753. } TOOLINFOW, NEAR *PTOOLINFOW, FAR *LPTOOLINFOW;
  754.  
  755. #ifdef UNICODE
  756. #define TOOLINFO                TOOLINFOW
  757. #define PTOOLINFO               PTOOLINFOW
  758. #define LPTOOLINFO              LPTOOLINFOW
  759. #else
  760. #define TOOLINFO                TOOLINFOA
  761. #define PTOOLINFO               PTOOLINFOA
  762. #define LPTOOLINFO              LPTOOLINFOA
  763. #endif
  764.  
  765.  
  766. #define TTS_ALWAYSTIP           0x01
  767. #define TTS_NOPREFIX            0x02
  768.  
  769. #define TTF_IDISHWND            0x0001
  770. #define TTF_CENTERTIP           0x0002
  771. #define TTF_RTLREADING          0x0004
  772. #define TTF_SUBCLASS            0x0010
  773.  
  774.  
  775. #define TTDT_AUTOMATIC          0
  776. #define TTDT_RESHOW             1
  777. #define TTDT_AUTOPOP            2
  778. #define TTDT_INITIAL            3
  779.  
  780. #define TTM_ACTIVATE            (WM_USER + 1)
  781. #define TTM_SETDELAYTIME        (WM_USER + 3)
  782. #define TTM_ADDTOOLA            (WM_USER + 4)
  783. #define TTM_ADDTOOLW            (WM_USER + 50)
  784. #define TTM_DELTOOLA            (WM_USER + 5)
  785. #define TTM_DELTOOLW            (WM_USER + 51)
  786. #define TTM_NEWTOOLRECTA        (WM_USER + 6)
  787. #define TTM_NEWTOOLRECTW        (WM_USER + 52)
  788. #define TTM_RELAYEVENT          (WM_USER + 7)                           
  789.  
  790. #define TTM_GETTOOLINFOA        (WM_USER + 8)
  791. #define TTM_GETTOOLINFOW        (WM_USER + 53)
  792.  
  793. #define TTM_SETTOOLINFOA        (WM_USER + 9)
  794. #define TTM_SETTOOLINFOW        (WM_USER + 54)
  795.  
  796. #define TTM_HITTESTA            (WM_USER +10)
  797. #define TTM_HITTESTW            (WM_USER +55)
  798. #define TTM_GETTEXTA            (WM_USER +11)
  799. #define TTM_GETTEXTW            (WM_USER +56)
  800. #define TTM_UPDATETIPTEXTA      (WM_USER +12)
  801. #define TTM_UPDATETIPTEXTW      (WM_USER +57)
  802. #define TTM_GETTOOLCOUNT        (WM_USER +13)
  803. #define TTM_ENUMTOOLSA          (WM_USER +14)
  804. #define TTM_ENUMTOOLSW          (WM_USER +58)
  805. #define TTM_GETCURRENTTOOLA     (WM_USER + 15)
  806. #define TTM_GETCURRENTTOOLW     (WM_USER + 59)
  807. #define TTM_WINDOWFROMPOINT     (WM_USER + 16)
  808.  
  809.  
  810. #ifdef UNICODE
  811. #define TTM_ADDTOOL             TTM_ADDTOOLW
  812. #define TTM_DELTOOL             TTM_DELTOOLW
  813. #define TTM_NEWTOOLRECT         TTM_NEWTOOLRECTW
  814. #define TTM_GETTOOLINFO         TTM_GETTOOLINFOW
  815. #define TTM_SETTOOLINFO         TTM_SETTOOLINFOW
  816. #define TTM_HITTEST             TTM_HITTESTW
  817. #define TTM_GETTEXT             TTM_GETTEXTW
  818. #define TTM_UPDATETIPTEXT       TTM_UPDATETIPTEXTW
  819. #define TTM_ENUMTOOLS           TTM_ENUMTOOLSW
  820. #define TTM_GETCURRENTTOOL      TTM_GETCURRENTTOOLW
  821. #else
  822. #define TTM_ADDTOOL             TTM_ADDTOOLA
  823. #define TTM_DELTOOL             TTM_DELTOOLA
  824. #define TTM_NEWTOOLRECT         TTM_NEWTOOLRECTA
  825. #define TTM_GETTOOLINFO         TTM_GETTOOLINFOA
  826. #define TTM_SETTOOLINFO         TTM_SETTOOLINFOA
  827. #define TTM_HITTEST             TTM_HITTESTA
  828. #define TTM_GETTEXT             TTM_GETTEXTA
  829. #define TTM_UPDATETIPTEXT       TTM_UPDATETIPTEXTA
  830. #define TTM_ENUMTOOLS           TTM_ENUMTOOLSA
  831. #define TTM_GETCURRENTTOOL      TTM_GETCURRENTTOOLA
  832. #endif
  833.  
  834.  
  835. typedef struct _TT_HITTESTINFOA {
  836.     HWND hwnd;
  837.     POINT pt;
  838.     TOOLINFOA ti;
  839. } TTHITTESTINFOA, FAR * LPHITTESTINFOA;
  840.  
  841. typedef struct _TT_HITTESTINFOW {
  842.     HWND hwnd;
  843.     POINT pt;
  844.     TOOLINFOW ti;
  845. } TTHITTESTINFOW, FAR * LPHITTESTINFOW;
  846.  
  847.  
  848. #ifdef UNICODE
  849. #define TTHITTESTINFO           TTHITTESTINFOW
  850. #define LPHITTESTINFO           LPHITTESTINFOW
  851. #else
  852. #define TTHITTESTINFO           TTHITTESTINFOA
  853. #define LPHITTESTINFO           LPHITTESTINFOA
  854. #endif
  855.  
  856.  
  857. #define TTN_NEEDTEXTA           (TTN_FIRST - 0)
  858. #define TTN_NEEDTEXTW           (TTN_FIRST - 10)
  859. #define TTN_SHOW                (TTN_FIRST - 1)
  860. #define TTN_POP                 (TTN_FIRST - 2)
  861.  
  862. #ifdef UNICODE
  863. #define TTN_NEEDTEXT            TTN_NEEDTEXTW
  864. #else
  865. #define TTN_NEEDTEXT            TTN_NEEDTEXTA
  866. #endif
  867.  
  868. typedef struct tagTOOLTIPTEXTA {
  869.     NMHDR hdr;
  870.     LPSTR lpszText;
  871.     char szText[80];
  872.     HINSTANCE hinst;
  873.     UINT uFlags;
  874. } TOOLTIPTEXTA, FAR *LPTOOLTIPTEXTA;
  875.  
  876. typedef struct tagTOOLTIPTEXTW {
  877.     NMHDR hdr;
  878.     LPWSTR lpszText;
  879.     WCHAR szText[80];
  880.     HINSTANCE hinst;
  881.     UINT uFlags;
  882. } TOOLTIPTEXTW, FAR *LPTOOLTIPTEXTW;
  883.  
  884. #ifdef UNICODE
  885. #define TOOLTIPTEXT             TOOLTIPTEXTW
  886. #define LPTOOLTIPTEXT           LPTOOLTIPTEXTW
  887. #else
  888. #define TOOLTIPTEXT             TOOLTIPTEXTA
  889. #define LPTOOLTIPTEXT           LPTOOLTIPTEXTA
  890. #endif
  891.  
  892. #endif
  893.  
  894.  
  895. //====== STATUS BAR CONTROL ===================================================
  896.  
  897. #ifndef NOSTATUSBAR
  898.  
  899. #define SBARS_SIZEGRIP          0x0100
  900.  
  901.  
  902. WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR pszText, UINT uFlags);
  903. WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR pszText, UINT uFlags);
  904.  
  905. WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID);
  906. WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID);
  907.  
  908. #ifdef UNICODE
  909. #define CreateStatusWindow      CreateStatusWindowW
  910. #define DrawStatusText          DrawStatusTextW
  911. #else
  912. #define CreateStatusWindow      CreateStatusWindowA
  913. #define DrawStatusText          DrawStatusTextA
  914. #endif
  915.  
  916. #ifdef _WIN32
  917. #define STATUSCLASSNAMEW        L"msctls_statusbar32"
  918. #define STATUSCLASSNAMEA        "msctls_statusbar32"
  919.  
  920. #ifdef UNICODE
  921. #define STATUSCLASSNAME         STATUSCLASSNAMEW
  922. #else
  923. #define STATUSCLASSNAME         STATUSCLASSNAMEA
  924. #endif
  925.  
  926. #else
  927. #define STATUSCLASSNAME         "msctls_statusbar"
  928. #endif
  929.  
  930. #define SB_SETTEXTA             (WM_USER+1)
  931. #define SB_SETTEXTW             (WM_USER+11)
  932. #define SB_GETTEXTA             (WM_USER+2)
  933. #define SB_GETTEXTW             (WM_USER+13)
  934. #define SB_GETTEXTLENGTHA       (WM_USER+3)
  935. #define SB_GETTEXTLENGTHW       (WM_USER+12)
  936.  
  937. #ifdef UNICODE
  938. #define SB_GETTEXT              SB_GETTEXTW
  939. #define SB_SETTEXT              SB_SETTEXTW
  940. #define SB_GETTEXTLENGTH        SB_GETTEXTLENGTHW
  941. #else
  942. #define SB_GETTEXT              SB_GETTEXTA
  943. #define SB_SETTEXT              SB_SETTEXTA
  944. #define SB_GETTEXTLENGTH        SB_GETTEXTLENGTHA
  945. #endif
  946.  
  947.  
  948. #define SB_SETPARTS             (WM_USER+4)
  949. #define SB_GETPARTS             (WM_USER+6)
  950. #define SB_GETBORDERS           (WM_USER+7)
  951. #define SB_SETMINHEIGHT         (WM_USER+8)
  952. #define SB_SIMPLE               (WM_USER+9)
  953. #define SB_GETRECT              (WM_USER+10)
  954.  
  955.  
  956. #define SBT_OWNERDRAW            0x1000
  957. #define SBT_NOBORDERS            0x0100
  958. #define SBT_POPOUT               0x0200
  959. #define SBT_RTLREADING           0x0400
  960.  
  961. #endif
  962.  
  963. //====== MENU HELP ============================================================
  964.  
  965. #ifndef NOMENUHELP
  966.  
  967. WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT FAR *lpwIDs);
  968. WINCOMMCTRLAPI BOOL WINAPI ShowHideMenuCtl(HWND hWnd, UINT uFlags, LPINT lpInfo);
  969. WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo);
  970.  
  971. #define MINSYSCOMMAND   SC_SIZE
  972.  
  973. #endif
  974.  
  975.  
  976. //====== TRACKBAR CONTROL =====================================================
  977.  
  978. #ifndef NOTRACKBAR
  979.  
  980. #ifdef _WIN32
  981.  
  982. #define TRACKBAR_CLASSA         "msctls_trackbar32"
  983. #define TRACKBAR_CLASSW         L"msctls_trackbar32"
  984.  
  985. #ifdef UNICODE
  986. #define  TRACKBAR_CLASS         TRACKBAR_CLASSW
  987. #else
  988. #define  TRACKBAR_CLASS         TRACKBAR_CLASSA
  989. #endif
  990.  
  991. #else
  992. #define TRACKBAR_CLASS          "msctls_trackbar"
  993. #endif
  994.  
  995.  
  996. #define TBS_AUTOTICKS           0x0001
  997. #define TBS_VERT                0x0002
  998. #define TBS_HORZ                0x0000
  999. #define TBS_TOP                 0x0004
  1000. #define TBS_BOTTOM              0x0000
  1001. #define TBS_LEFT                0x0004
  1002. #define TBS_RIGHT               0x0000
  1003. #define TBS_BOTH                0x0008
  1004. #define TBS_NOTICKS             0x0010
  1005. #define TBS_ENABLESELRANGE      0x0020
  1006. #define TBS_FIXEDLENGTH         0x0040
  1007. #define TBS_NOTHUMB             0x0080
  1008.  
  1009.  
  1010. #define TBM_GETPOS              (WM_USER)
  1011. #define TBM_GETRANGEMIN         (WM_USER+1)
  1012. #define TBM_GETRANGEMAX         (WM_USER+2)
  1013. #define TBM_GETTIC              (WM_USER+3)
  1014. #define TBM_SETTIC              (WM_USER+4)
  1015. #define TBM_SETPOS              (WM_USER+5)
  1016. #define TBM_SETRANGE            (WM_USER+6)
  1017. #define TBM_SETRANGEMIN         (WM_USER+7)
  1018. #define TBM_SETRANGEMAX         (WM_USER+8)
  1019. #define TBM_CLEARTICS           (WM_USER+9)
  1020. #define TBM_SETSEL              (WM_USER+10)
  1021. #define TBM_SETSELSTART         (WM_USER+11)
  1022. #define TBM_SETSELEND           (WM_USER+12)
  1023. #define TBM_GETPTICS            (WM_USER+14)
  1024. #define TBM_GETTICPOS           (WM_USER+15)
  1025. #define TBM_GETNUMTICS          (WM_USER+16)
  1026. #define TBM_GETSELSTART         (WM_USER+17)
  1027. #define TBM_GETSELEND           (WM_USER+18)
  1028. #define TBM_CLEARSEL            (WM_USER+19)
  1029. #define TBM_SETTICFREQ          (WM_USER+20)
  1030. #define TBM_SETPAGESIZE         (WM_USER+21)
  1031. #define TBM_GETPAGESIZE         (WM_USER+22)
  1032. #define TBM_SETLINESIZE         (WM_USER+23)
  1033. #define TBM_GETLINESIZE         (WM_USER+24)
  1034. #define TBM_GETTHUMBRECT        (WM_USER+25)
  1035. #define TBM_GETCHANNELRECT      (WM_USER+26)
  1036. #define TBM_SETTHUMBLENGTH      (WM_USER+27)
  1037. #define TBM_GETTHUMBLENGTH      (WM_USER+28)
  1038.  
  1039.  
  1040. #define TB_LINEUP               0
  1041. #define TB_LINEDOWN             1
  1042. #define TB_PAGEUP               2
  1043. #define TB_PAGEDOWN             3
  1044. #define TB_THUMBPOSITION        4
  1045. #define TB_THUMBTRACK           5
  1046. #define TB_TOP                  6
  1047. #define TB_BOTTOM               7
  1048. #define TB_ENDTRACK             8
  1049.  
  1050. #endif
  1051.  
  1052. //====== DRAG LIST CONTROL ====================================================
  1053.  
  1054. #ifndef NODRAGLIST
  1055.  
  1056. typedef struct tagDRAGLISTINFO {
  1057.     UINT uNotification;
  1058.     HWND hWnd;
  1059.     POINT ptCursor;
  1060. } DRAGLISTINFO, FAR *LPDRAGLISTINFO;
  1061.  
  1062. #define DL_BEGINDRAG            (WM_USER+133)
  1063. #define DL_DRAGGING             (WM_USER+134)
  1064. #define DL_DROPPED              (WM_USER+135)
  1065. #define DL_CANCELDRAG           (WM_USER+136)
  1066.  
  1067. #define DL_CURSORSET            0
  1068. #define DL_STOPCURSOR           1
  1069. #define DL_COPYCURSOR           2
  1070. #define DL_MOVECURSOR           3
  1071.  
  1072. #define DRAGLISTMSGSTRING       TEXT("commctrl_DragListMsg")
  1073.  
  1074. WINCOMMCTRLAPI BOOL WINAPI MakeDragList(HWND hLB);
  1075. WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent, HWND hLB, int nItem);
  1076. WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB, POINT pt, BOOL bAutoScroll);
  1077.  
  1078. #endif
  1079.  
  1080.  
  1081. //====== UPDOWN CONTROL =======================================================
  1082.  
  1083. #ifndef NOUPDOWN
  1084.  
  1085. #ifdef _WIN32
  1086.  
  1087. #define UPDOWN_CLASSA           "msctls_updown32"
  1088. #define UPDOWN_CLASSW           L"msctls_updown32"
  1089.  
  1090. #ifdef UNICODE
  1091. #define  UPDOWN_CLASS           UPDOWN_CLASSW
  1092. #else
  1093. #define  UPDOWN_CLASS           UPDOWN_CLASSA
  1094. #endif
  1095.  
  1096. #else
  1097. #define UPDOWN_CLASS            "msctls_updown"
  1098. #endif
  1099.  
  1100.  
  1101. typedef struct _UDACCEL {
  1102.     UINT nSec;
  1103.     UINT nInc;
  1104. } UDACCEL, FAR *LPUDACCEL;
  1105.  
  1106. #define UD_MAXVAL               0x7fff
  1107. #define UD_MINVAL               (-UD_MAXVAL)
  1108.  
  1109.  
  1110. #define UDS_WRAP                0x0001
  1111. #define UDS_SETBUDDYINT         0x0002
  1112. #define UDS_ALIGNRIGHT          0x0004
  1113. #define UDS_ALIGNLEFT           0x0008
  1114. #define UDS_AUTOBUDDY           0x0010
  1115. #define UDS_ARROWKEYS           0x0020
  1116. #define UDS_HORZ                0x0040
  1117. #define UDS_NOTHOUSANDS         0x0080
  1118.  
  1119.  
  1120. #define UDM_SETRANGE            (WM_USER+101)
  1121. #define UDM_GETRANGE            (WM_USER+102)
  1122. #define UDM_SETPOS              (WM_USER+103)
  1123. #define UDM_GETPOS              (WM_USER+104)
  1124. #define UDM_SETBUDDY            (WM_USER+105)
  1125. #define UDM_GETBUDDY            (WM_USER+106)
  1126. #define UDM_SETACCEL            (WM_USER+107)
  1127. #define UDM_GETACCEL            (WM_USER+108)
  1128. #define UDM_SETBASE             (WM_USER+109)
  1129. #define UDM_GETBASE             (WM_USER+110)
  1130.  
  1131.  
  1132. WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy,
  1133.                                 HWND hParent, int nID, HINSTANCE hInst,
  1134.                                 HWND hBuddy,
  1135.                                 int nUpper, int nLower, int nPos);
  1136.  
  1137. typedef struct _NM_UPDOWN
  1138. {
  1139.     NMHDR hdr;
  1140.     int iPos;
  1141.     int iDelta;
  1142. } NM_UPDOWN, FAR *LPNM_UPDOWN;
  1143.  
  1144. #define UDN_DELTAPOS (UDN_FIRST - 1)
  1145.  
  1146. #endif
  1147.  
  1148.  
  1149. //====== PROGRESS CONTROL =====================================================
  1150.  
  1151. #ifndef NOPROGRESS
  1152.  
  1153. #ifdef _WIN32
  1154.  
  1155. #define PROGRESS_CLASSA         "msctls_progress32"
  1156. #define PROGRESS_CLASSW         L"msctls_progress32"
  1157.  
  1158. #ifdef UNICODE
  1159. #define  PROGRESS_CLASS         PROGRESS_CLASSW
  1160. #else
  1161. #define  PROGRESS_CLASS         PROGRESS_CLASSA
  1162. #endif
  1163.  
  1164. #else
  1165. #define PROGRESS_CLASS          "msctls_progress"
  1166. #endif
  1167.  
  1168.  
  1169. #define PBM_SETRANGE            (WM_USER+1)
  1170. #define PBM_SETPOS              (WM_USER+2)
  1171. #define PBM_DELTAPOS            (WM_USER+3)
  1172. #define PBM_SETSTEP             (WM_USER+4)
  1173. #define PBM_STEPIT              (WM_USER+5)
  1174.  
  1175. #endif
  1176.  
  1177.  
  1178. //====== HOTKEY CONTROL =======================================================
  1179.  
  1180. #ifndef NOHOTKEY
  1181.  
  1182. #define HOTKEYF_SHIFT           0x01
  1183. #define HOTKEYF_CONTROL         0x02
  1184. #define HOTKEYF_ALT             0x04
  1185. #define HOTKEYF_EXT             0x08
  1186.  
  1187. #define HKCOMB_NONE             0x0001
  1188. #define HKCOMB_S                0x0002
  1189. #define HKCOMB_C                0x0004
  1190. #define HKCOMB_A                0x0008
  1191. #define HKCOMB_SC               0x0010
  1192. #define HKCOMB_SA               0x0020
  1193. #define HKCOMB_CA               0x0040
  1194. #define HKCOMB_SCA              0x0080
  1195.  
  1196.  
  1197. #define HKM_SETHOTKEY           (WM_USER+1)
  1198. #define HKM_GETHOTKEY           (WM_USER+2)
  1199. #define HKM_SETRULES            (WM_USER+3)
  1200.  
  1201. #ifdef _WIN32
  1202.  
  1203. #define HOTKEY_CLASSA           "msctls_hotkey32"
  1204. #define HOTKEY_CLASSW           L"msctls_hotkey32"
  1205.  
  1206. #ifdef UNICODE
  1207. #define HOTKEY_CLASS            HOTKEY_CLASSW
  1208. #else
  1209. #define HOTKEY_CLASS            HOTKEY_CLASSA
  1210. #endif
  1211.  
  1212. #else
  1213. #define HOTKEY_CLASS            "msctls_hotkey"
  1214. #endif
  1215.  
  1216. #endif
  1217.  
  1218.  
  1219. //====== COMMON CONTROL STYLES ================================================
  1220.  
  1221. #define CCS_TOP                 0x00000001L
  1222. #define CCS_NOMOVEY             0x00000002L
  1223. #define CCS_BOTTOM              0x00000003L
  1224. #define CCS_NORESIZE            0x00000004L
  1225. #define CCS_NOPARENTALIGN       0x00000008L
  1226. #define CCS_ADJUSTABLE          0x00000020L
  1227. #define CCS_NODIVIDER           0x00000040L
  1228.  
  1229.  
  1230. //====== LISTVIEW CONTROL =====================================================
  1231.  
  1232. #ifndef NOLISTVIEW
  1233.  
  1234. #ifdef _WIN32
  1235.  
  1236. #define WC_LISTVIEWA            "SysListView32"
  1237. #define WC_LISTVIEWW            L"SysListView32"
  1238.  
  1239. #ifdef UNICODE
  1240. #define WC_LISTVIEW             WC_LISTVIEWW
  1241. #else
  1242. #define WC_LISTVIEW             WC_LISTVIEWA
  1243. #endif
  1244.  
  1245. #else
  1246. #define WC_LISTVIEW             "SysListView"
  1247. #endif
  1248.  
  1249. #define LVS_ICON                0x0000
  1250. #define LVS_REPORT              0x0001
  1251. #define LVS_SMALLICON           0x0002
  1252. #define LVS_LIST                0x0003
  1253. #define LVS_TYPEMASK            0x0003
  1254. #define LVS_SINGLESEL           0x0004
  1255. #define LVS_SHOWSELALWAYS       0x0008
  1256. #define LVS_SORTASCENDING       0x0010
  1257. #define LVS_SORTDESCENDING      0x0020
  1258. #define LVS_SHAREIMAGELISTS     0x0040
  1259. #define LVS_NOLABELWRAP         0x0080
  1260. #define LVS_AUTOARRANGE         0x0100
  1261. #define LVS_EDITLABELS          0x0200
  1262. #define LVS_OWNERDATA           0x1000
  1263. #define LVS_NOSCROLL            0x2000
  1264.  
  1265. #define LVS_TYPESTYLEMASK       0xfc00
  1266.  
  1267. #define LVS_ALIGNTOP            0x0000
  1268. #define LVS_ALIGNLEFT           0x0800
  1269. #define LVS_ALIGNMASK           0x0c00
  1270.  
  1271. #define LVS_OWNERDRAWFIXED      0x0400
  1272. #define LVS_NOCOLUMNHEADER      0x4000
  1273. #define LVS_NOSORTHEADER        0x8000
  1274.  
  1275. #define LVM_GETBKCOLOR          (LVM_FIRST + 0)
  1276. #define ListView_GetBkColor(hwnd)  \
  1277.     (COLORREF)SNDMSG((hwnd), LVM_GETBKCOLOR, 0, 0L)
  1278.  
  1279. #define LVM_SETBKCOLOR          (LVM_FIRST + 1)
  1280. #define ListView_SetBkColor(hwnd, clrBk) \
  1281.     (BOOL)SNDMSG((hwnd), LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk))
  1282.  
  1283. #define LVM_GETIMAGELIST        (LVM_FIRST + 2)
  1284. #define ListView_GetImageList(hwnd, iImageList) \
  1285.     (HIMAGELIST)SNDMSG((hwnd), LVM_GETIMAGELIST, (WPARAM)(INT)(iImageList), 0L)
  1286.  
  1287. #define LVSIL_NORMAL            0
  1288. #define LVSIL_SMALL             1
  1289. #define LVSIL_STATE             2
  1290.  
  1291. #define LVM_SETIMAGELIST        (LVM_FIRST + 3)
  1292. #define ListView_SetImageList(hwnd, himl, iImageList) \
  1293.     (HIMAGELIST)(UINT)SNDMSG((hwnd), LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(UINT)(HIMAGELIST)(himl))
  1294.  
  1295. #define LVM_GETITEMCOUNT        (LVM_FIRST + 4)
  1296. #define ListView_GetItemCount(hwnd) \
  1297.     (int)SNDMSG((hwnd), LVM_GETITEMCOUNT, 0, 0L)
  1298.  
  1299. #define LVIF_TEXT               0x0001
  1300. #define LVIF_IMAGE              0x0002
  1301. #define LVIF_PARAM              0x0004
  1302. #define LVIF_STATE              0x0008
  1303.  
  1304. #define LVIS_FOCUSED            0x0001
  1305. #define LVIS_SELECTED           0x0002
  1306. #define LVIS_CUT                0x0004
  1307. #define LVIS_DROPHILITED        0x0008
  1308.  
  1309.  
  1310. #define LVIS_OVERLAYMASK        0x0F00
  1311. #define LVIS_STATEIMAGEMASK     0xF000
  1312.  
  1313. #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12)
  1314.  
  1315. typedef struct _LV_ITEMA
  1316. {
  1317.     UINT mask;
  1318.     int iItem;
  1319.     int iSubItem;
  1320.     UINT state;
  1321.     UINT stateMask;
  1322.     LPSTR pszText;
  1323.     int cchTextMax;
  1324.     int iImage;
  1325.     LPARAM lParam;
  1326. } LV_ITEMA;
  1327.  
  1328. typedef struct _LV_ITEMW
  1329. {
  1330.     UINT mask;
  1331.     int iItem;
  1332.     int iSubItem;
  1333.     UINT state;
  1334.     UINT stateMask;
  1335.     LPWSTR pszText;
  1336.     int cchTextMax;
  1337.     int iImage;
  1338.     LPARAM lParam;
  1339. } LV_ITEMW;
  1340.  
  1341. #ifdef UNICODE
  1342. #define LV_ITEM    LV_ITEMW
  1343. #else
  1344. #define LV_ITEM    LV_ITEMA
  1345. #endif
  1346.  
  1347. #define LPSTR_TEXTCALLBACKW     ((LPWSTR)-1L)
  1348. #define LPSTR_TEXTCALLBACKA     ((LPSTR)-1L)
  1349. #ifdef UNICODE
  1350. #define LPSTR_TEXTCALLBACK      LPSTR_TEXTCALLBACKW
  1351. #else
  1352. #define LPSTR_TEXTCALLBACK      LPSTR_TEXTCALLBACKA
  1353. #endif
  1354.  
  1355. #define I_IMAGECALLBACK         (-1)
  1356.  
  1357. #define LVM_GETITEMA            (LVM_FIRST + 5)
  1358. #define LVM_GETITEMW            (LVM_FIRST + 75)
  1359. #ifdef UNICODE
  1360. #define LVM_GETITEM             LVM_GETITEMW
  1361. #else
  1362. #define LVM_GETITEM             LVM_GETITEMA
  1363. #endif
  1364.  
  1365. #define ListView_GetItem(hwnd, pitem) \
  1366.     (BOOL)SNDMSG((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM FAR*)(pitem))
  1367.  
  1368.  
  1369. #define LVM_SETITEMA            (LVM_FIRST + 6)
  1370. #define LVM_SETITEMW            (LVM_FIRST + 76)
  1371. #ifdef UNICODE
  1372. #define LVM_SETITEM             LVM_SETITEMW
  1373. #else
  1374. #define LVM_SETITEM             LVM_SETITEMA
  1375. #endif
  1376.  
  1377. #define ListView_SetItem(hwnd, pitem) \
  1378.     (BOOL)SNDMSG((hwnd), LVM_SETITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  1379.  
  1380.  
  1381. #define LVM_INSERTITEMA         (LVM_FIRST + 7)
  1382. #define LVM_INSERTITEMW         (LVM_FIRST + 77)
  1383. #ifdef UNICODE
  1384. #define LVM_INSERTITEM          LVM_INSERTITEMW
  1385. #else
  1386. #define LVM_INSERTITEM          LVM_INSERTITEMA
  1387. #endif
  1388. #define ListView_InsertItem(hwnd, pitem)   \
  1389.     (int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  1390.  
  1391.  
  1392. #define LVM_DELETEITEM          (LVM_FIRST + 8)
  1393. #define ListView_DeleteItem(hwnd, i) \
  1394.     (BOOL)SNDMSG((hwnd), LVM_DELETEITEM, (WPARAM)(int)(i), 0L)
  1395.  
  1396.  
  1397. #define LVM_DELETEALLITEMS      (LVM_FIRST + 9)
  1398. #define ListView_DeleteAllItems(hwnd) \
  1399.     (BOOL)SNDMSG((hwnd), LVM_DELETEALLITEMS, 0, 0L)
  1400.  
  1401.  
  1402. #define LVM_GETCALLBACKMASK     (LVM_FIRST + 10)
  1403. #define ListView_GetCallbackMask(hwnd) \
  1404.     (BOOL)SNDMSG((hwnd), LVM_GETCALLBACKMASK, 0, 0)
  1405.  
  1406.  
  1407. #define LVM_SETCALLBACKMASK     (LVM_FIRST + 11)
  1408. #define ListView_SetCallbackMask(hwnd, mask) \
  1409.     (BOOL)SNDMSG((hwnd), LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0)
  1410.  
  1411.  
  1412. #define LVNI_ALL                0x0000
  1413. #define LVNI_FOCUSED            0x0001
  1414. #define LVNI_SELECTED           0x0002
  1415. #define LVNI_CUT                0x0004
  1416. #define LVNI_DROPHILITED        0x0008
  1417.  
  1418. #define LVNI_ABOVE              0x0100
  1419. #define LVNI_BELOW              0x0200
  1420. #define LVNI_TOLEFT             0x0400
  1421. #define LVNI_TORIGHT            0x0800
  1422.  
  1423.  
  1424. #define LVM_GETNEXTITEM         (LVM_FIRST + 12)
  1425. #define ListView_GetNextItem(hwnd, i, flags) \
  1426.     (int)SNDMSG((hwnd), LVM_GETNEXTITEM, (WPARAM)(int)(i), MAKELPARAM((flags), 0))
  1427.  
  1428.  
  1429. #define LVFI_PARAM              0x0001
  1430. #define LVFI_STRING             0x0002
  1431. #define LVFI_PARTIAL            0x0008
  1432. #define LVFI_WRAP               0x0020
  1433. #define LVFI_NEARESTXY          0x0040
  1434.  
  1435. typedef struct _LV_FINDINFOA
  1436. {
  1437.     UINT flags;
  1438.     LPCSTR psz;
  1439.     LPARAM lParam;
  1440.     POINT pt;
  1441.     UINT vkDirection;
  1442. } LV_FINDINFOA;
  1443.  
  1444. typedef struct _LV_FINDINFOW
  1445. {
  1446.     UINT flags;
  1447.     LPCWSTR psz;
  1448.     LPARAM lParam;
  1449.     POINT pt;
  1450.     UINT vkDirection;
  1451. } LV_FINDINFOW;
  1452.  
  1453. #ifdef UNICODE
  1454. #define  LV_FINDINFO            LV_FINDINFOW
  1455. #else
  1456. #define  LV_FINDINFO            LV_FINDINFOA
  1457. #endif
  1458.  
  1459. #define LVM_FINDITEMA           (LVM_FIRST + 13)
  1460. #define LVM_FINDITEMW           (LVM_FIRST + 83)
  1461. #ifdef UNICODE
  1462. #define  LVM_FINDITEM           LVM_FINDITEMW
  1463. #else
  1464. #define  LVM_FINDITEM           LVM_FINDITEMA
  1465. #endif
  1466.  
  1467. #define ListView_FindItem(hwnd, iStart, plvfi) \
  1468.     (int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
  1469.  
  1470. #define LVIR_BOUNDS             0
  1471. #define LVIR_ICON               1
  1472. #define LVIR_LABEL              2
  1473. #define LVIR_SELECTBOUNDS       3
  1474.  
  1475.  
  1476. #define LVM_GETITEMRECT         (LVM_FIRST + 14)
  1477. #define ListView_GetItemRect(hwnd, i, prc, code) \
  1478.      (BOOL)SNDMSG((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \
  1479.            ((prc) ? (((RECT FAR *)(prc))->left = (code),(LPARAM)(RECT FAR*)(prc)) : (LPARAM)(RECT FAR*)NULL))
  1480.  
  1481.  
  1482. #define LVM_SETITEMPOSITION     (LVM_FIRST + 15)
  1483. #define ListView_SetItemPosition(hwndLV, i, x, y) \
  1484.     (BOOL)SNDMSG((hwndLV), LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y)))
  1485.  
  1486.  
  1487. #define LVM_GETITEMPOSITION     (LVM_FIRST + 16)
  1488. #define ListView_GetItemPosition(hwndLV, i, ppt) \
  1489.     (BOOL)SNDMSG((hwndLV), LVM_GETITEMPOSITION, (WPARAM)(int)(i), (LPARAM)(POINT FAR*)(ppt))
  1490.  
  1491.  
  1492. #define LVM_GETSTRINGWIDTHA     (LVM_FIRST + 17)
  1493. #define LVM_GETSTRINGWIDTHW     (LVM_FIRST + 87)
  1494. #ifdef UNICODE
  1495. #define  LVM_GETSTRINGWIDTH     LVM_GETSTRINGWIDTHW
  1496. #else
  1497. #define  LVM_GETSTRINGWIDTH     LVM_GETSTRINGWIDTHA
  1498. #endif
  1499.  
  1500. #define ListView_GetStringWidth(hwndLV, psz) \
  1501.     (int)SNDMSG((hwndLV), LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)(psz))
  1502.  
  1503.  
  1504. #define LVHT_NOWHERE            0x0001
  1505. #define LVHT_ONITEMICON         0x0002
  1506. #define LVHT_ONITEMLABEL        0x0004
  1507. #define LVHT_ONITEMSTATEICON    0x0008
  1508. #define LVHT_ONITEM             (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
  1509.  
  1510. #define LVHT_ABOVE              0x0008
  1511. #define LVHT_BELOW              0x0010
  1512. #define LVHT_TORIGHT            0x0020
  1513. #define LVHT_TOLEFT             0x0040
  1514.  
  1515. typedef struct _LV_HITTESTINFO
  1516. {
  1517.     POINT pt;
  1518.     UINT flags;
  1519.     int iItem;
  1520. } LV_HITTESTINFO;
  1521.  
  1522. #define LVM_HITTEST             (LVM_FIRST + 18)
  1523. #define ListView_HitTest(hwndLV, pinfo) \
  1524.     (int)SNDMSG((hwndLV), LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO FAR*)(pinfo))
  1525.  
  1526.  
  1527. #define LVM_ENSUREVISIBLE       (LVM_FIRST + 19)
  1528. #define ListView_EnsureVisible(hwndLV, i, fPartialOK) \
  1529.     (BOOL)SNDMSG((hwndLV), LVM_ENSUREVISIBLE, (WPARAM)(int)(i), MAKELPARAM((fPartialOK), 0))
  1530.  
  1531.  
  1532. #define LVM_SCROLL              (LVM_FIRST + 20)
  1533. #define ListView_Scroll(hwndLV, dx, dy) \
  1534.     (BOOL)SNDMSG((hwndLV), LVM_SCROLL, (WPARAM)(int)dx, (LPARAM)(int)dy)
  1535.  
  1536.  
  1537. #define LVM_REDRAWITEMS         (LVM_FIRST + 21)
  1538. #define ListView_RedrawItems(hwndLV, iFirst, iLast) \
  1539.     (BOOL)SNDMSG((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)iFirst, (LPARAM)(int)iLast)
  1540.  
  1541.  
  1542. #define LVA_DEFAULT             0x0000
  1543. #define LVA_ALIGNLEFT           0x0001
  1544. #define LVA_ALIGNTOP            0x0002
  1545. #define LVA_SNAPTOGRID          0x0005
  1546.  
  1547.  
  1548. #define LVM_ARRANGE             (LVM_FIRST + 22)
  1549. #define ListView_Arrange(hwndLV, code) \
  1550.     (BOOL)SNDMSG((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0L)
  1551.  
  1552.  
  1553. #define LVM_EDITLABELA          (LVM_FIRST + 23)
  1554. #define LVM_EDITLABELW          (LVM_FIRST + 118)
  1555. #ifdef UNICODE
  1556. #define LVM_EDITLABEL           LVM_EDITLABELW
  1557. #else
  1558. #define LVM_EDITLABEL           LVM_EDITLABELA
  1559. #endif
  1560.  
  1561. #define ListView_EditLabel(hwndLV, i) \
  1562.     (HWND)SNDMSG((hwndLV), LVM_EDITLABEL, (WPARAM)(int)(i), 0L)
  1563.  
  1564.  
  1565. #define LVM_GETEDITCONTROL      (LVM_FIRST + 24)
  1566. #define ListView_GetEditControl(hwndLV) \
  1567.     (HWND)SNDMSG((hwndLV), LVM_GETEDITCONTROL, 0, 0L)
  1568.  
  1569.  
  1570. typedef struct _LV_COLUMNA
  1571. {
  1572.     UINT mask;
  1573.     int fmt;
  1574.     int cx;
  1575.     LPSTR pszText;
  1576.     int cchTextMax;
  1577.     int iSubItem;
  1578. } LV_COLUMNA;
  1579.  
  1580. typedef struct _LV_COLUMNW
  1581. {
  1582.     UINT mask;
  1583.     int fmt;
  1584.     int cx;
  1585.     LPWSTR pszText;
  1586.     int cchTextMax;
  1587.     int iSubItem;
  1588. } LV_COLUMNW;
  1589.  
  1590. #ifdef UNICODE
  1591. #define  LV_COLUMN              LV_COLUMNW
  1592. #else
  1593. #define  LV_COLUMN              LV_COLUMNA
  1594. #endif
  1595.  
  1596.  
  1597. #define LVCF_FMT                0x0001
  1598. #define LVCF_WIDTH              0x0002
  1599. #define LVCF_TEXT               0x0004
  1600. #define LVCF_SUBITEM            0x0008
  1601.  
  1602. #define LVCFMT_LEFT             0x0000
  1603. #define LVCFMT_RIGHT            0x0001
  1604. #define LVCFMT_CENTER           0x0002
  1605. #define LVCFMT_JUSTIFYMASK      0x0003
  1606.  
  1607.  
  1608. #define LVM_GETCOLUMNA         (LVM_FIRST + 25)
  1609. #define LVM_GETCOLUMNW         (LVM_FIRST + 95)
  1610. #ifdef UNICODE
  1611. #define  LVM_GETCOLUMN          LVM_GETCOLUMNW
  1612. #else
  1613. #define  LVM_GETCOLUMN          LVM_GETCOLUMNA
  1614. #endif
  1615.  
  1616. #define ListView_GetColumn(hwnd, iCol, pcol) \
  1617.     (BOOL)SNDMSG((hwnd), LVM_GETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(LV_COLUMN FAR*)(pcol))
  1618.  
  1619.  
  1620. #define LVM_SETCOLUMNA          (LVM_FIRST + 26)
  1621. #define LVM_SETCOLUMNW          (LVM_FIRST + 96)
  1622. #ifdef UNICODE
  1623. #define  LVM_SETCOLUMN          LVM_SETCOLUMNW
  1624. #else
  1625. #define  LVM_SETCOLUMN          LVM_SETCOLUMNA
  1626. #endif
  1627.  
  1628. #define ListView_SetColumn(hwnd, iCol, pcol) \
  1629.     (BOOL)SNDMSG((hwnd), LVM_SETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  1630.  
  1631.  
  1632. #define LVM_INSERTCOLUMNA       (LVM_FIRST + 27)
  1633. #define LVM_INSERTCOLUMNW       (LVM_FIRST + 97)
  1634. #ifdef UNICODE
  1635. #   define  LVM_INSERTCOLUMN    LVM_INSERTCOLUMNW
  1636. #else
  1637. #   define  LVM_INSERTCOLUMN    LVM_INSERTCOLUMNA
  1638. #endif
  1639.  
  1640. #define ListView_InsertColumn(hwnd, iCol, pcol) \
  1641.     (int)SNDMSG((hwnd), LVM_INSERTCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  1642.  
  1643.  
  1644. #define LVM_DELETECOLUMN        (LVM_FIRST + 28)
  1645. #define ListView_DeleteColumn(hwnd, iCol) \
  1646.     (BOOL)SNDMSG((hwnd), LVM_DELETECOLUMN, (WPARAM)(int)(iCol), 0)
  1647.  
  1648.  
  1649. #define LVM_GETCOLUMNWIDTH      (LVM_FIRST + 29)
  1650. #define ListView_GetColumnWidth(hwnd, iCol) \
  1651.     (int)SNDMSG((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0)
  1652.  
  1653.  
  1654. #define LVSCW_AUTOSIZE              -1
  1655. #define LVSCW_AUTOSIZE_USEHEADER    -2
  1656. #define LVM_SETCOLUMNWIDTH          (LVM_FIRST + 30)
  1657.  
  1658. #define ListView_SetColumnWidth(hwnd, iCol, cx) \
  1659.     (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0))
  1660.  
  1661.  
  1662. #define LVM_CREATEDRAGIMAGE     (LVM_FIRST + 33)
  1663. #define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \
  1664.     (HIMAGELIST)SNDMSG((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft))
  1665.  
  1666.  
  1667. #define LVM_GETVIEWRECT         (LVM_FIRST + 34)
  1668. #define ListView_GetViewRect(hwnd, prc) \
  1669.     (BOOL)SNDMSG((hwnd), LVM_GETVIEWRECT, 0, (LPARAM)(RECT FAR*)(prc))
  1670.  
  1671.  
  1672. #define LVM_GETTEXTCOLOR        (LVM_FIRST + 35)
  1673. #define ListView_GetTextColor(hwnd)  \
  1674.     (COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0L)
  1675.  
  1676.  
  1677. #define LVM_SETTEXTCOLOR        (LVM_FIRST + 36)
  1678. #define ListView_SetTextColor(hwnd, clrText) \
  1679.     (BOOL)SNDMSG((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText))
  1680.  
  1681.  
  1682. #define LVM_GETTEXTBKCOLOR      (LVM_FIRST + 37)
  1683. #define ListView_GetTextBkColor(hwnd)  \
  1684.     (COLORREF)SNDMSG((hwnd), LVM_GETTEXTBKCOLOR, 0, 0L)
  1685.  
  1686.  
  1687. #define LVM_SETTEXTBKCOLOR      (LVM_FIRST + 38)
  1688. #define ListView_SetTextBkColor(hwnd, clrTextBk) \
  1689.     (BOOL)SNDMSG((hwnd), LVM_SETTEXTBKCOLOR, 0, (LPARAM)(COLORREF)(clrTextBk))
  1690.  
  1691.  
  1692. #define LVM_GETTOPINDEX         (LVM_FIRST + 39)
  1693. #define ListView_GetTopIndex(hwndLV) \
  1694.     (int)SNDMSG((hwndLV), LVM_GETTOPINDEX, 0, 0)
  1695.  
  1696.  
  1697. #define LVM_GETCOUNTPERPAGE     (LVM_FIRST + 40)
  1698. #define ListView_GetCountPerPage(hwndLV) \
  1699.     (int)SNDMSG((hwndLV), LVM_GETCOUNTPERPAGE, 0, 0)
  1700.  
  1701.  
  1702. #define LVM_GETORIGIN           (LVM_FIRST + 41)
  1703. #define ListView_GetOrigin(hwndLV, ppt) \
  1704.     (BOOL)SNDMSG((hwndLV), LVM_GETORIGIN, (WPARAM)0, (LPARAM)(POINT FAR*)(ppt))
  1705.  
  1706.  
  1707. #define LVM_UPDATE              (LVM_FIRST + 42)
  1708. #define ListView_Update(hwndLV, i) \
  1709.     (BOOL)SNDMSG((hwndLV), LVM_UPDATE, (WPARAM)i, 0L)
  1710.  
  1711.  
  1712. #define LVM_SETITEMSTATE        (LVM_FIRST + 43)
  1713. #define ListView_SetItemState(hwndLV, i, data, mask) \
  1714. { LV_ITEM _ms_lvi;\
  1715.   _ms_lvi.stateMask = mask;\
  1716.   _ms_lvi.state = data;\
  1717.   SNDMSG((hwndLV), LVM_SETITEMSTATE, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  1718. }
  1719.  
  1720.  
  1721. #define LVM_GETITEMSTATE        (LVM_FIRST + 44)
  1722. #define ListView_GetItemState(hwndLV, i, mask) \
  1723.    (UINT)SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, (LPARAM)mask)
  1724.  
  1725.  
  1726. #define LVM_GETITEMTEXTA        (LVM_FIRST + 45)
  1727. #define LVM_GETITEMTEXTW        (LVM_FIRST + 115)
  1728.  
  1729. #ifdef UNICODE
  1730. #define  LVM_GETITEMTEXT        LVM_GETITEMTEXTW
  1731. #else
  1732. #define  LVM_GETITEMTEXT        LVM_GETITEMTEXTA
  1733. #endif
  1734.  
  1735. #define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
  1736. { LV_ITEM _ms_lvi;\
  1737.   _ms_lvi.iSubItem = iSubItem_;\
  1738.   _ms_lvi.cchTextMax = cchTextMax_;\
  1739.   _ms_lvi.pszText = pszText_;\
  1740.   SNDMSG((hwndLV), LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  1741. }
  1742.  
  1743.  
  1744. #define LVM_SETITEMTEXTA        (LVM_FIRST + 46)
  1745. #define LVM_SETITEMTEXTW        (LVM_FIRST + 116)
  1746.  
  1747. #ifdef UNICODE
  1748. #define  LVM_SETITEMTEXT        LVM_SETITEMTEXTW
  1749. #else
  1750. #define  LVM_SETITEMTEXT        LVM_SETITEMTEXTA
  1751. #endif
  1752.  
  1753. #define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) \
  1754. { LV_ITEM _ms_lvi;\
  1755.   _ms_lvi.iSubItem = iSubItem_;\
  1756.   _ms_lvi.pszText = pszText_;\
  1757.   SNDMSG((hwndLV), LVM_SETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  1758. }
  1759.  
  1760.  
  1761. #define LVM_SETITEMCOUNT        (LVM_FIRST + 47)
  1762. #define ListView_SetItemCount(hwndLV, cItems) \
  1763.   SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, 0)
  1764.  
  1765.  
  1766. typedef int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
  1767.  
  1768.  
  1769. #define LVM_SORTITEMS           (LVM_FIRST + 48)
  1770. #define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) \
  1771.   (BOOL)SNDMSG((hwndLV), LVM_SORTITEMS, (WPARAM)(LPARAM)_lPrm, \
  1772.   (LPARAM)(PFNLVCOMPARE)_pfnCompare)
  1773.  
  1774.  
  1775. #define LVM_SETITEMPOSITION32   (LVM_FIRST + 49)
  1776. #define ListView_SetItemPosition32(hwndLV, i, x, y) \
  1777. { POINT ptNewPos = {x,y}; \
  1778.     SNDMSG((hwndLV), LVM_SETITEMPOSITION32, (WPARAM)(int)(i), (LPARAM)&ptNewPos); \
  1779. }
  1780.  
  1781.  
  1782. #define LVM_GETSELECTEDCOUNT    (LVM_FIRST + 50)
  1783. #define ListView_GetSelectedCount(hwndLV) \
  1784.     (UINT)SNDMSG((hwndLV), LVM_GETSELECTEDCOUNT, 0, 0L)
  1785.  
  1786.  
  1787. #define LVM_GETITEMSPACING      (LVM_FIRST + 51)
  1788. #define ListView_GetItemSpacing(hwndLV, fSmall) \
  1789.         (DWORD)SNDMSG((hwndLV), LVM_GETITEMSPACING, fSmall, 0L)
  1790.  
  1791.  
  1792. #define LVM_GETISEARCHSTRINGA   (LVM_FIRST + 52)
  1793. #define LVM_GETISEARCHSTRINGW   (LVM_FIRST + 117)
  1794.  
  1795. #ifdef UNICODE
  1796. #define LVM_GETISEARCHSTRING   LVM_GETISEARCHSTRINGW
  1797. #else
  1798. #define LVM_GETISEARCHSTRING   LVM_GETISEARCHSTRINGA
  1799. #endif
  1800.  
  1801. #define ListView_GetISearchString(hwndLV, lpsz) \
  1802.         (BOOL)SNDMSG((hwndLV), LVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
  1803.  
  1804.  
  1805. typedef struct _NM_LISTVIEW
  1806. {
  1807.     NMHDR   hdr;
  1808.     int     iItem;
  1809.     int     iSubItem;
  1810.     UINT    uNewState;
  1811.     UINT    uOldState;
  1812.     UINT    uChanged;
  1813.     POINT   ptAction;
  1814.     LPARAM  lParam;
  1815. } NM_LISTVIEW, FAR *LPNM_LISTVIEW;
  1816.  
  1817. typedef struct _NM_CACHEHINT
  1818. {
  1819.     NMHDR   hdr;
  1820.     int     iFrom;
  1821.     int     iTo;
  1822. } NM_CACHEHINT, FAR *LPNM_CACHEHINT, FAR *PNM_CACHEHINT;
  1823.  
  1824. typedef struct _NM_FINDITEM
  1825. {
  1826.     NMHDR   hdr;
  1827.     int     iStart;
  1828.     LV_FINDINFO lvfi;
  1829. } NM_FINDITEM, FAR *LPNM_FINDITEM, FAR *PNM_FINDITEM;
  1830.  
  1831.  
  1832. #define LVN_ITEMCHANGING        (LVN_FIRST-0)
  1833. #define LVN_ITEMCHANGED         (LVN_FIRST-1)
  1834. #define LVN_INSERTITEM          (LVN_FIRST-2)
  1835. #define LVN_DELETEITEM          (LVN_FIRST-3)
  1836. #define LVN_DELETEALLITEMS      (LVN_FIRST-4)
  1837. #define LVN_BEGINLABELEDITA     (LVN_FIRST-5)
  1838. #define LVN_BEGINLABELEDITW     (LVN_FIRST-75)
  1839. #define LVN_ENDLABELEDITA       (LVN_FIRST-6)
  1840. #define LVN_ENDLABELEDITW       (LVN_FIRST-76)
  1841. #define LVN_COLUMNCLICK         (LVN_FIRST-8)
  1842. #define LVN_BEGINDRAG           (LVN_FIRST-9)
  1843. #define LVN_BEGINRDRAG          (LVN_FIRST-11)
  1844.  
  1845. #define LVN_ODCACHEHINT         (LVN_FIRST-13)
  1846. #define LVN_ODFINDITEMA         (LVN_FIRST-52)
  1847. #define LVN_ODFINDITEMW         (LVN_FIRST-79)
  1848.  
  1849. #ifdef UNICODE
  1850. #define LVN_ODFINDITEM          LVN_ODFINDITEMW
  1851. #else
  1852. #define LVN_ODFINDITEM          LVN_ODFINDITEMA
  1853. #endif
  1854.  
  1855.  
  1856.  
  1857. #define LVN_GETDISPINFOA        (LVN_FIRST-50)
  1858. #define LVN_GETDISPINFOW        (LVN_FIRST-77)
  1859. #define LVN_SETDISPINFOA        (LVN_FIRST-51)
  1860. #define LVN_SETDISPINFOW        (LVN_FIRST-78)
  1861.  
  1862. #ifdef UNICODE
  1863. #define LVN_BEGINLABELEDIT      LVN_BEGINLABELEDITW
  1864. #define LVN_ENDLABELEDIT        LVN_ENDLABELEDITW
  1865. #define LVN_GETDISPINFO         LVN_GETDISPINFOW
  1866. #define LVN_SETDISPINFO         LVN_SETDISPINFOW
  1867. #else
  1868. #define LVN_BEGINLABELEDIT      LVN_BEGINLABELEDITA
  1869. #define LVN_ENDLABELEDIT        LVN_ENDLABELEDITA
  1870. #define LVN_GETDISPINFO         LVN_GETDISPINFOA
  1871. #define LVN_SETDISPINFO         LVN_SETDISPINFOA
  1872. #endif
  1873.  
  1874.  
  1875.  
  1876.  
  1877. #define LVIF_DI_SETITEM         0x1000
  1878.  
  1879. typedef struct _LV_DISPINFO {
  1880.     NMHDR hdr;
  1881.     LV_ITEMA item;
  1882. } LV_DISPINFOA;
  1883.  
  1884. typedef struct _LV_DISPINFOW {
  1885.     NMHDR hdr;
  1886.     LV_ITEMW item;
  1887. } LV_DISPINFOW;
  1888.  
  1889. #ifdef UNICODE                                                       
  1890. #define  LV_DISPINFO            LV_DISPINFOW                         
  1891. #else                                                                
  1892. #define  LV_DISPINFO            LV_DISPINFOA                         
  1893. #endif                                                               
  1894.                                                                      
  1895. #define LVN_KEYDOWN             (LVN_FIRST-55)
  1896.  
  1897. typedef struct _LV_KEYDOWN
  1898. {
  1899.     NMHDR hdr;
  1900.     WORD wVKey;
  1901.     UINT flags;
  1902. } LV_KEYDOWN;
  1903.  
  1904. #endif
  1905.  
  1906. //====== TREEVIEW CONTROL =====================================================
  1907.  
  1908. #ifndef NOTREEVIEW
  1909.  
  1910. #ifdef _WIN32
  1911. #define WC_TREEVIEWA            "SysTreeView32"
  1912. #define WC_TREEVIEWW            L"SysTreeView32"
  1913.  
  1914. #ifdef UNICODE
  1915. #define  WC_TREEVIEW            WC_TREEVIEWW
  1916. #else
  1917. #define  WC_TREEVIEW            WC_TREEVIEWA
  1918. #endif
  1919.  
  1920. #else
  1921. #define WC_TREEVIEW             "SysTreeView"
  1922. #endif
  1923.  
  1924. #define TVS_HASBUTTONS          0x0001
  1925. #define TVS_HASLINES            0x0002
  1926. #define TVS_LINESATROOT         0x0004
  1927. #define TVS_EDITLABELS          0x0008
  1928. #define TVS_DISABLEDRAGDROP     0x0010
  1929. #define TVS_SHOWSELALWAYS       0x0020
  1930.  
  1931. typedef struct _TREEITEM FAR* HTREEITEM;
  1932.  
  1933. #define TVIF_TEXT               0x0001
  1934. #define TVIF_IMAGE              0x0002
  1935. #define TVIF_PARAM              0x0004
  1936. #define TVIF_STATE              0x0008
  1937. #define TVIF_HANDLE             0x0010
  1938. #define TVIF_SELECTEDIMAGE      0x0020
  1939. #define TVIF_CHILDREN           0x0040
  1940.  
  1941. #define TVIS_FOCUSED            0x0001
  1942. #define TVIS_SELECTED           0x0002
  1943. #define TVIS_CUT                0x0004
  1944. #define TVIS_DROPHILITED        0x0008
  1945. #define TVIS_BOLD               0x0010
  1946. #define TVIS_EXPANDED           0x0020
  1947. #define TVIS_EXPANDEDONCE       0x0040
  1948.  
  1949. #define TVIS_OVERLAYMASK        0x0F00
  1950. #define TVIS_STATEIMAGEMASK     0xF000
  1951. #define TVIS_USERMASK           0xF000
  1952.  
  1953.  
  1954. #define I_CHILDRENCALLBACK  (-1)
  1955.  
  1956. typedef struct _TV_ITEMA {
  1957.     UINT      mask;
  1958.     HTREEITEM hItem;
  1959.     UINT      state;
  1960.     UINT      stateMask;
  1961.     LPSTR     pszText;
  1962.     int       cchTextMax;
  1963.     int       iImage;
  1964.     int       iSelectedImage;
  1965.     int       cChildren;
  1966.     LPARAM    lParam;
  1967. } TV_ITEMA, FAR *LPTV_ITEMA;
  1968.  
  1969. typedef struct _TV_ITEMW {
  1970.     UINT      mask;
  1971.     HTREEITEM hItem;
  1972.     UINT      state;
  1973.     UINT      stateMask;
  1974.     LPWSTR    pszText;
  1975.     int       cchTextMax;
  1976.     int       iImage;
  1977.     int       iSelectedImage;
  1978.     int       cChildren;
  1979.     LPARAM    lParam;
  1980. } TV_ITEMW, FAR *LPTV_ITEMW;
  1981.  
  1982. #ifdef UNICODE
  1983. #define  TV_ITEM                TV_ITEMW
  1984. #define  LPTV_ITEM              LPTV_ITEMW
  1985. #else
  1986. #define  TV_ITEM                TV_ITEMA
  1987. #define  LPTV_ITEM              LPTV_ITEMA
  1988. #endif
  1989.  
  1990.  
  1991. #define TVI_ROOT                ((HTREEITEM)0xFFFF0000)
  1992. #define TVI_FIRST               ((HTREEITEM)0xFFFF0001)
  1993. #define TVI_LAST                ((HTREEITEM)0xFFFF0002)
  1994. #define TVI_SORT                ((HTREEITEM)0xFFFF0003)
  1995.  
  1996. typedef struct _TV_INSERTSTRUCTA {
  1997.     HTREEITEM hParent;
  1998.     HTREEITEM hInsertAfter;
  1999.     TV_ITEMA item;
  2000. } TV_INSERTSTRUCTA, FAR *LPTV_INSERTSTRUCTA;
  2001.  
  2002. typedef struct _TV_INSERTSTRUCTW {
  2003.     HTREEITEM hParent;
  2004.     HTREEITEM hInsertAfter;
  2005.     TV_ITEMW item;
  2006. } TV_INSERTSTRUCTW, FAR *LPTV_INSERTSTRUCTW;
  2007.  
  2008. #ifdef UNICODE
  2009. #define  TV_INSERTSTRUCT        TV_INSERTSTRUCTW
  2010. #define  LPTV_INSERTSTRUCT      LPTV_INSERTSTRUCTW
  2011. #else
  2012. #define  TV_INSERTSTRUCT        TV_INSERTSTRUCTA
  2013. #define  LPTV_INSERTSTRUCT      LPTV_INSERTSTRUCTA
  2014. #endif
  2015.  
  2016. #define TVM_INSERTITEMA         (TV_FIRST + 0)
  2017. #define TVM_INSERTITEMW         (TV_FIRST + 50)
  2018. #ifdef UNICODE
  2019. #define  TVM_INSERTITEM         TVM_INSERTITEMW
  2020. #else
  2021. #define  TVM_INSERTITEM         TVM_INSERTITEMA
  2022. #endif
  2023.  
  2024. #define TreeView_InsertItem(hwnd, lpis) \
  2025.     (HTREEITEM)SNDMSG((hwnd), TVM_INSERTITEM, 0, (LPARAM)(LPTV_INSERTSTRUCT)(lpis))
  2026.  
  2027.  
  2028. #define TVM_DELETEITEM          (TV_FIRST + 1)
  2029. #define TreeView_DeleteItem(hwnd, hitem) \
  2030.     (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hitem))
  2031.  
  2032.  
  2033. #define TreeView_DeleteAllItems(hwnd) \
  2034.     (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT)
  2035.  
  2036.  
  2037. #define TVM_EXPAND              (TV_FIRST + 2)
  2038. #define TreeView_Expand(hwnd, hitem, code) \
  2039.     (BOOL)SNDMSG((hwnd), TVM_EXPAND, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2040.  
  2041.  
  2042. #define TVE_COLLAPSE            0x0001
  2043. #define TVE_EXPAND              0x0002
  2044. #define TVE_TOGGLE              0x0003
  2045. #define TVE_COLLAPSERESET       0x8000
  2046.  
  2047.  
  2048. #define TVM_GETITEMRECT         (TV_FIRST + 4)
  2049. #define TreeView_GetItemRect(hwnd, hitem, prc, code) \
  2050.     (*(HTREEITEM FAR *)prc = (hitem), (BOOL)SNDMSG((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT FAR*)(prc)))
  2051.  
  2052.  
  2053. #define TVM_GETCOUNT            (TV_FIRST + 5)
  2054. #define TreeView_GetCount(hwnd) \
  2055.     (UINT)SNDMSG((hwnd), TVM_GETCOUNT, 0, 0)
  2056.  
  2057.  
  2058. #define TVM_GETINDENT           (TV_FIRST + 6)
  2059. #define TreeView_GetIndent(hwnd) \
  2060.     (UINT)SNDMSG((hwnd), TVM_GETINDENT, 0, 0)
  2061.  
  2062.  
  2063. #define TVM_SETINDENT           (TV_FIRST + 7)
  2064. #define TreeView_SetIndent(hwnd, indent) \
  2065.     (BOOL)SNDMSG((hwnd), TVM_SETINDENT, (WPARAM)indent, 0)
  2066.  
  2067.  
  2068. #define TVM_GETIMAGELIST        (TV_FIRST + 8)
  2069. #define TreeView_GetImageList(hwnd, iImage) \
  2070.     (HIMAGELIST)SNDMSG((hwnd), TVM_GETIMAGELIST, iImage, 0)
  2071.  
  2072.  
  2073. #define TVSIL_NORMAL            0
  2074. #define TVSIL_STATE             2
  2075.  
  2076.  
  2077. #define TVM_SETIMAGELIST        (TV_FIRST + 9)
  2078. #define TreeView_SetImageList(hwnd, himl, iImage) \
  2079.     (HIMAGELIST)SNDMSG((hwnd), TVM_SETIMAGELIST, iImage, (LPARAM)(UINT)(HIMAGELIST)(himl))
  2080.  
  2081.  
  2082. #define TVM_GETNEXTITEM         (TV_FIRST + 10)
  2083. #define TreeView_GetNextItem(hwnd, hitem, code) \
  2084.     (HTREEITEM)SNDMSG((hwnd), TVM_GETNEXTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2085.  
  2086.  
  2087. #define TVGN_ROOT               0x0000
  2088. #define TVGN_NEXT               0x0001
  2089. #define TVGN_PREVIOUS           0x0002
  2090. #define TVGN_PARENT             0x0003
  2091. #define TVGN_CHILD              0x0004
  2092. #define TVGN_FIRSTVISIBLE       0x0005
  2093. #define TVGN_NEXTVISIBLE        0x0006
  2094. #define TVGN_PREVIOUSVISIBLE    0x0007
  2095. #define TVGN_DROPHILITE         0x0008
  2096. #define TVGN_CARET              0x0009
  2097.  
  2098. #define TreeView_GetChild(hwnd, hitem)          TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD)
  2099. #define TreeView_GetNextSibling(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT)
  2100. #define TreeView_GetPrevSibling(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS)
  2101. #define TreeView_GetParent(hwnd, hitem)         TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT)
  2102. #define TreeView_GetFirstVisible(hwnd)          TreeView_GetNextItem(hwnd, NULL,  TVGN_FIRSTVISIBLE)
  2103. #define TreeView_GetNextVisible(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE)
  2104. #define TreeView_GetPrevVisible(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE)
  2105. #define TreeView_GetSelection(hwnd)             TreeView_GetNextItem(hwnd, NULL,  TVGN_CARET)
  2106. #define TreeView_GetDropHilight(hwnd)           TreeView_GetNextItem(hwnd, NULL,  TVGN_DROPHILITE)
  2107. #define TreeView_GetRoot(hwnd)                  TreeView_GetNextItem(hwnd, NULL,  TVGN_ROOT)
  2108.  
  2109.  
  2110. #define TVM_SELECTITEM          (TV_FIRST + 11)
  2111. #define TreeView_Select(hwnd, hitem, code) \
  2112.     (HTREEITEM)SNDMSG((hwnd), TVM_SELECTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2113.  
  2114.  
  2115. #define TreeView_SelectItem(hwnd, hitem)            TreeView_Select(hwnd, hitem, TVGN_CARET)
  2116. #define TreeView_SelectDropTarget(hwnd, hitem)      TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
  2117. #define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
  2118.  
  2119.  
  2120. #define TVM_GETITEMA            (TV_FIRST + 12)
  2121. #define TVM_GETITEMW            (TV_FIRST + 62)
  2122.  
  2123. #ifdef UNICODE
  2124. #define  TVM_GETITEM            TVM_GETITEMW
  2125. #else
  2126. #define  TVM_GETITEM            TVM_GETITEMA
  2127. #endif
  2128.  
  2129. #define TreeView_GetItem(hwnd, pitem) \
  2130.     (BOOL)SNDMSG((hwnd), TVM_GETITEM, 0, (LPARAM)(TV_ITEM FAR*)(pitem))
  2131.  
  2132.  
  2133. #define TVM_SETITEMA            (TV_FIRST + 13)
  2134. #define TVM_SETITEMW            (TV_FIRST + 63)
  2135.  
  2136. #ifdef UNICODE
  2137. #define  TVM_SETITEM            TVM_SETITEMW
  2138. #else
  2139. #define  TVM_SETITEM            TVM_SETITEMA
  2140. #endif
  2141.  
  2142. #define TreeView_SetItem(hwnd, pitem) \
  2143.     (BOOL)SNDMSG((hwnd), TVM_SETITEM, 0, (LPARAM)(const TV_ITEM FAR*)(pitem))
  2144.  
  2145.  
  2146. #define TVM_EDITLABELA          (TV_FIRST + 14)
  2147. #define TVM_EDITLABELW          (TV_FIRST + 65)
  2148. #ifdef UNICODE
  2149. #define TVM_EDITLABEL           TVM_EDITLABELW
  2150. #else
  2151. #define TVM_EDITLABEL           TVM_EDITLABELA
  2152. #endif
  2153.  
  2154. #define TreeView_EditLabel(hwnd, hitem) \
  2155.     (HWND)SNDMSG((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
  2156.  
  2157.  
  2158. #define TVM_GETEDITCONTROL      (TV_FIRST + 15)
  2159. #define TreeView_GetEditControl(hwnd) \
  2160.     (HWND)SNDMSG((hwnd), TVM_GETEDITCONTROL, 0, 0)
  2161.  
  2162.  
  2163. #define TVM_GETVISIBLECOUNT     (TV_FIRST + 16)
  2164. #define TreeView_GetVisibleCount(hwnd) \
  2165.     (UINT)SNDMSG((hwnd), TVM_GETVISIBLECOUNT, 0, 0)
  2166.  
  2167.  
  2168. #define TVM_HITTEST             (TV_FIRST + 17)
  2169. #define TreeView_HitTest(hwnd, lpht) \
  2170.     (HTREEITEM)SNDMSG((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht))
  2171.  
  2172.  
  2173. typedef struct _TV_HITTESTINFO {
  2174.     POINT       pt;
  2175.     UINT        flags;
  2176.     HTREEITEM   hItem;
  2177. } TV_HITTESTINFO, FAR *LPTV_HITTESTINFO;
  2178.  
  2179. #define TVHT_NOWHERE            0x0001
  2180. #define TVHT_ONITEMICON         0x0002
  2181. #define TVHT_ONITEMLABEL        0x0004
  2182. #define TVHT_ONITEM             (TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON)
  2183. #define TVHT_ONITEMINDENT       0x0008
  2184. #define TVHT_ONITEMBUTTON       0x0010
  2185. #define TVHT_ONITEMRIGHT        0x0020
  2186. #define TVHT_ONITEMSTATEICON    0x0040
  2187.  
  2188. #define TVHT_ABOVE              0x0100
  2189. #define TVHT_BELOW              0x0200
  2190. #define TVHT_TORIGHT            0x0400
  2191. #define TVHT_TOLEFT             0x0800
  2192.  
  2193.  
  2194. #define TVM_CREATEDRAGIMAGE     (TV_FIRST + 18)
  2195. #define TreeView_CreateDragImage(hwnd, hitem) \
  2196.     (HIMAGELIST)SNDMSG((hwnd), TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(hitem))
  2197.  
  2198.  
  2199. #define TVM_SORTCHILDREN        (TV_FIRST + 19)
  2200. #define TreeView_SortChildren(hwnd, hitem, recurse) \
  2201.     (BOOL)SNDMSG((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse, (LPARAM)(HTREEITEM)(hitem))
  2202.  
  2203.  
  2204. #define TVM_ENSUREVISIBLE       (TV_FIRST + 20)
  2205. #define TreeView_EnsureVisible(hwnd, hitem) \
  2206.     (BOOL)SNDMSG((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem))
  2207.  
  2208.  
  2209. #define TVM_SORTCHILDRENCB      (TV_FIRST + 21)
  2210. #define TreeView_SortChildrenCB(hwnd, psort, recurse) \
  2211.     (BOOL)SNDMSG((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \
  2212.     (LPARAM)(LPTV_SORTCB)(psort))
  2213.  
  2214.  
  2215. #define TVM_ENDEDITLABELNOW     (TV_FIRST + 22)
  2216. #define TreeView_EndEditLabelNow(hwnd, fCancel) \
  2217.     (BOOL)SNDMSG((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0)
  2218.  
  2219.  
  2220. #define TVM_GETISEARCHSTRINGA   (TV_FIRST + 23)
  2221. #define TVM_GETISEARCHSTRINGW   (TV_FIRST + 64)
  2222.  
  2223. #ifdef UNICODE
  2224. #define TVM_GETISEARCHSTRING     TVM_GETISEARCHSTRINGW
  2225. #else
  2226. #define TVM_GETISEARCHSTRING     TVM_GETISEARCHSTRINGA
  2227. #endif
  2228.  
  2229. #define TreeView_GetISearchString(hwndTV, lpsz) \
  2230.         (BOOL)SNDMSG((hwndTV), TVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
  2231.  
  2232.  
  2233. typedef int (CALLBACK *PFNTVCOMPARE)(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  2234. typedef struct _TV_SORTCB
  2235. {
  2236.         HTREEITEM       hParent;
  2237.         PFNTVCOMPARE    lpfnCompare;
  2238.         LPARAM          lParam;
  2239. } TV_SORTCB, FAR *LPTV_SORTCB;
  2240.  
  2241.  
  2242. typedef struct _NM_TREEVIEWA {
  2243.     NMHDR       hdr;
  2244.     UINT        action;
  2245.     TV_ITEMA    itemOld;
  2246.     TV_ITEMA    itemNew;
  2247.     POINT       ptDrag;
  2248. } NM_TREEVIEWA, FAR *LPNM_TREEVIEWA;
  2249.  
  2250. typedef struct _NM_TREEVIEWW {
  2251.     NMHDR       hdr;
  2252.     UINT        action;
  2253.     TV_ITEMW    itemOld;
  2254.     TV_ITEMW    itemNew;
  2255.     POINT       ptDrag;
  2256. } NM_TREEVIEWW, FAR *LPNM_TREEVIEWW;
  2257.  
  2258. #ifdef UNICODE
  2259. #define  NM_TREEVIEW            NM_TREEVIEWW
  2260. #define  LPNM_TREEVIEW          LPNM_TREEVIEWW
  2261. #else
  2262. #define  NM_TREEVIEW            NM_TREEVIEWA
  2263. #define  LPNM_TREEVIEW          LPNM_TREEVIEWA
  2264. #endif
  2265.  
  2266. #define TVN_SELCHANGINGA        (TVN_FIRST-1)
  2267. #define TVN_SELCHANGINGW        (TVN_FIRST-50)
  2268. #define TVN_SELCHANGEDA         (TVN_FIRST-2)
  2269. #define TVN_SELCHANGEDW         (TVN_FIRST-51)
  2270.  
  2271. #define TVC_UNKNOWN             0x0000
  2272. #define TVC_BYMOUSE             0x0001
  2273. #define TVC_BYKEYBOARD          0x0002
  2274.  
  2275. #define TVN_GETDISPINFOA        (TVN_FIRST-3)
  2276. #define TVN_GETDISPINFOW        (TVN_FIRST-52)
  2277. #define TVN_SETDISPINFOA        (TVN_FIRST-4)
  2278. #define TVN_SETDISPINFOW        (TVN_FIRST-53)
  2279.  
  2280. #define TVIF_DI_SETITEM         0x1000
  2281.  
  2282. typedef struct _TV_DISPINFOA {
  2283.     NMHDR hdr;
  2284.     TV_ITEMA item;
  2285. } TV_DISPINFOA;
  2286.  
  2287. typedef struct _TV_DISPINFOW {
  2288.     NMHDR hdr;
  2289.     TV_ITEMW item;
  2290. } TV_DISPINFOW;
  2291.  
  2292. #ifdef UNICODE
  2293. #   define  TV_DISPINFO TV_DISPINFOW
  2294. #else
  2295. #   define  TV_DISPINFO TV_DISPINFOA
  2296. #endif
  2297.  
  2298. #define TVN_ITEMEXPANDINGA      (TVN_FIRST-5)
  2299. #define TVN_ITEMEXPANDINGW      (TVN_FIRST-54)
  2300. #define TVN_ITEMEXPANDEDA       (TVN_FIRST-6)
  2301. #define TVN_ITEMEXPANDEDW       (TVN_FIRST-55)
  2302. #define TVN_BEGINDRAGA          (TVN_FIRST-7)
  2303. #define TVN_BEGINDRAGW          (TVN_FIRST-56)
  2304. #define TVN_BEGINRDRAGA         (TVN_FIRST-8)
  2305. #define TVN_BEGINRDRAGW         (TVN_FIRST-57)
  2306. #define TVN_DELETEITEMA         (TVN_FIRST-9)
  2307. #define TVN_DELETEITEMW         (TVN_FIRST-58)
  2308. #define TVN_BEGINLABELEDITA     (TVN_FIRST-10)
  2309. #define TVN_BEGINLABELEDITW     (TVN_FIRST-59)
  2310. #define TVN_ENDLABELEDITA       (TVN_FIRST-11)
  2311. #define TVN_ENDLABELEDITW       (TVN_FIRST-60)
  2312. #define TVN_KEYDOWN             (TVN_FIRST-12)
  2313.  
  2314. typedef struct _TV_KEYDOWN {
  2315.     NMHDR hdr;
  2316.     WORD wVKey;
  2317.     UINT flags;
  2318. } TV_KEYDOWN;
  2319.  
  2320. #ifdef UNICODE
  2321. #define TVN_SELCHANGING         TVN_SELCHANGINGW
  2322. #define TVN_SELCHANGED          TVN_SELCHANGEDW
  2323. #define TVN_GETDISPINFO         TVN_GETDISPINFOW
  2324. #define TVN_SETDISPINFO         TVN_SETDISPINFOW
  2325. #define TVN_ITEMEXPANDING       TVN_ITEMEXPANDINGW
  2326. #define TVN_ITEMEXPANDED        TVN_ITEMEXPANDEDW
  2327. #define TVN_BEGINDRAG           TVN_BEGINDRAGW
  2328. #define TVN_BEGINRDRAG          TVN_BEGINRDRAGW
  2329. #define TVN_DELETEITEM          TVN_DELETEITEMW
  2330. #define TVN_BEGINLABELEDIT      TVN_BEGINLABELEDITW
  2331. #define TVN_ENDLABELEDIT        TVN_ENDLABELEDITW
  2332. #else
  2333. #define TVN_SELCHANGING         TVN_SELCHANGINGA
  2334. #define TVN_SELCHANGED          TVN_SELCHANGEDA
  2335. #define TVN_GETDISPINFO         TVN_GETDISPINFOA
  2336. #define TVN_SETDISPINFO         TVN_SETDISPINFOA
  2337. #define TVN_ITEMEXPANDING       TVN_ITEMEXPANDINGA
  2338. #define TVN_ITEMEXPANDED        TVN_ITEMEXPANDEDA
  2339. #define TVN_BEGINDRAG           TVN_BEGINDRAGA
  2340. #define TVN_BEGINRDRAG          TVN_BEGINRDRAGA
  2341. #define TVN_DELETEITEM          TVN_DELETEITEMA
  2342. #define TVN_BEGINLABELEDIT      TVN_BEGINLABELEDITA
  2343. #define TVN_ENDLABELEDIT        TVN_ENDLABELEDITA
  2344. #endif
  2345.  
  2346. #endif
  2347.  
  2348.  
  2349. //====== TAB CONTROL ==========================================================
  2350.  
  2351. #ifndef NOTABCONTROL
  2352.  
  2353. #ifdef _WIN32
  2354.  
  2355. #define WC_TABCONTROLA          "SysTabControl32"
  2356. #define WC_TABCONTROLW          L"SysTabControl32"
  2357.  
  2358. #ifdef UNICODE
  2359. #define  WC_TABCONTROL          WC_TABCONTROLW
  2360. #else
  2361. #define  WC_TABCONTROL          WC_TABCONTROLA
  2362. #endif
  2363.  
  2364. #else
  2365. #define WC_TABCONTROL           "SysTabControl"
  2366. #endif
  2367.  
  2368.  
  2369. #define TCS_FORCEICONLEFT       0x0010
  2370. #define TCS_FORCELABELLEFT      0x0020
  2371. #define TCS_TABS                0x0000
  2372. #define TCS_BUTTONS             0x0100
  2373. #define TCS_SINGLELINE          0x0000
  2374. #define TCS_MULTILINE           0x0200
  2375. #define TCS_RIGHTJUSTIFY        0x0000
  2376. #define TCS_FIXEDWIDTH          0x0400
  2377. #define TCS_RAGGEDRIGHT         0x0800
  2378. #define TCS_FOCUSONBUTTONDOWN   0x1000
  2379. #define TCS_OWNERDRAWFIXED      0x2000
  2380. #define TCS_TOOLTIPS            0x4000
  2381. #define TCS_FOCUSNEVER          0x8000
  2382.  
  2383.  
  2384. #define TCM_FIRST               0x1300
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390. #define TCM_GETIMAGELIST        (TCM_FIRST + 2)
  2391. #define TabCtrl_GetImageList(hwnd) \
  2392.     (HIMAGELIST)SNDMSG((hwnd), TCM_GETIMAGELIST, 0, 0L)
  2393.  
  2394.  
  2395. #define TCM_SETIMAGELIST        (TCM_FIRST + 3)
  2396. #define TabCtrl_SetImageList(hwnd, himl) \
  2397.     (HIMAGELIST)SNDMSG((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl))
  2398.  
  2399.  
  2400. #define TCM_GETITEMCOUNT        (TCM_FIRST + 4)
  2401. #define TabCtrl_GetItemCount(hwnd) \
  2402.     (int)SNDMSG((hwnd), TCM_GETITEMCOUNT, 0, 0L)
  2403.  
  2404.  
  2405.  
  2406. #define TCIF_TEXT               0x0001
  2407. #define TCIF_IMAGE              0x0002
  2408. #define TCIF_RTLREADING         0x0004
  2409. #define TCIF_PARAM              0x0008
  2410.  
  2411.  
  2412. typedef struct _TC_ITEMHEADERA
  2413. {
  2414.     UINT mask;
  2415.     UINT lpReserved1;
  2416.     UINT lpReserved2;
  2417.     LPSTR pszText;
  2418.     int cchTextMax;
  2419.     int iImage;
  2420. } TC_ITEMHEADERA;
  2421.  
  2422. typedef struct _TC_ITEMHEADERW
  2423. {
  2424.     UINT mask;
  2425.     UINT lpReserved1;
  2426.     UINT lpReserved2;
  2427.     LPWSTR pszText;
  2428.     int cchTextMax;
  2429.     int iImage;
  2430. } TC_ITEMHEADERW;
  2431.  
  2432. #ifdef UNICODE
  2433. #define  TC_ITEMHEADER          TC_ITEMHEADERW
  2434. #else
  2435. #define  TC_ITEMHEADER          TC_ITEMHEADERA
  2436. #endif
  2437.  
  2438.  
  2439. typedef struct _TC_ITEMA
  2440. {
  2441.     UINT mask;
  2442.     UINT lpReserved1;
  2443.     UINT lpReserved2;
  2444.     LPSTR pszText;
  2445.     int cchTextMax;
  2446.     int iImage;
  2447.  
  2448.     LPARAM lParam;
  2449. } TC_ITEMA;
  2450.  
  2451. typedef struct _TC_ITEMW
  2452. {
  2453.     UINT mask;
  2454.     UINT lpReserved1;
  2455.     UINT lpReserved2;
  2456.     LPWSTR pszText;
  2457.     int cchTextMax;
  2458.     int iImage;
  2459.  
  2460.     LPARAM lParam;
  2461. } TC_ITEMW;
  2462.  
  2463. #ifdef UNICODE
  2464. #define  TC_ITEM                TC_ITEMW
  2465. #else
  2466. #define  TC_ITEM                TC_ITEMA
  2467. #endif
  2468.  
  2469.  
  2470. #define TCM_GETITEMA            (TCM_FIRST + 5)
  2471. #define TCM_GETITEMW            (TCM_FIRST + 60)
  2472.  
  2473. #ifdef UNICODE
  2474. #define TCM_GETITEM             TCM_GETITEMW
  2475. #else
  2476. #define TCM_GETITEM             TCM_GETITEMA
  2477. #endif
  2478.  
  2479. #define TabCtrl_GetItem(hwnd, iItem, pitem) \
  2480.     (BOOL)SNDMSG((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
  2481.  
  2482.  
  2483. #define TCM_SETITEMA            (TCM_FIRST + 6)
  2484. #define TCM_SETITEMW            (TCM_FIRST + 61)
  2485.  
  2486. #ifdef UNICODE
  2487. #define TCM_SETITEM             TCM_SETITEMW
  2488. #else
  2489. #define TCM_SETITEM             TCM_SETITEMA
  2490. #endif
  2491.  
  2492. #define TabCtrl_SetItem(hwnd, iItem, pitem) \
  2493.     (BOOL)SNDMSG((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
  2494.  
  2495.  
  2496. #define TCM_INSERTITEMA         (TCM_FIRST + 7)
  2497. #define TCM_INSERTITEMW         (TCM_FIRST + 62)
  2498.  
  2499. #ifdef UNICODE
  2500. #define TCM_INSERTITEM          TCM_INSERTITEMW
  2501. #else
  2502. #define TCM_INSERTITEM          TCM_INSERTITEMA
  2503. #endif
  2504.  
  2505. #define TabCtrl_InsertItem(hwnd, iItem, pitem)   \
  2506.     (int)SNDMSG((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM FAR*)(pitem))
  2507.  
  2508.  
  2509. #define TCM_DELETEITEM          (TCM_FIRST + 8)
  2510. #define TabCtrl_DeleteItem(hwnd, i) \
  2511.     (BOOL)SNDMSG((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L)
  2512.  
  2513.  
  2514. #define TCM_DELETEALLITEMS      (TCM_FIRST + 9)
  2515. #define TabCtrl_DeleteAllItems(hwnd) \
  2516.     (BOOL)SNDMSG((hwnd), TCM_DELETEALLITEMS, 0, 0L)
  2517.  
  2518.  
  2519. #define TCM_GETITEMRECT         (TCM_FIRST + 10)
  2520. #define TabCtrl_GetItemRect(hwnd, i, prc) \
  2521.     (BOOL)SNDMSG((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT FAR*)(prc))
  2522.  
  2523.  
  2524. #define TCM_GETCURSEL           (TCM_FIRST + 11)
  2525. #define TabCtrl_GetCurSel(hwnd) \
  2526.     (int)SNDMSG((hwnd), TCM_GETCURSEL, 0, 0)
  2527.  
  2528.  
  2529. #define TCM_SETCURSEL           (TCM_FIRST + 12)
  2530. #define TabCtrl_SetCurSel(hwnd, i) \
  2531.     (int)SNDMSG((hwnd), TCM_SETCURSEL, (WPARAM)i, 0)
  2532.  
  2533.  
  2534. #define TCHT_NOWHERE            0x0001
  2535. #define TCHT_ONITEMICON         0x0002
  2536. #define TCHT_ONITEMLABEL        0x0004
  2537. #define TCHT_ONITEM             (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
  2538.  
  2539.  
  2540. typedef struct _TC_HITTESTINFO
  2541. {
  2542.     POINT pt;
  2543.     UINT flags;
  2544. } TC_HITTESTINFO, FAR * LPTC_HITTESTINFO;
  2545.  
  2546.  
  2547. #define TCM_HITTEST             (TCM_FIRST + 13)
  2548. #define TabCtrl_HitTest(hwndTC, pinfo) \
  2549.     (int)SNDMSG((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO FAR*)(pinfo))
  2550.  
  2551.  
  2552. #define TCM_SETITEMEXTRA        (TCM_FIRST + 14)
  2553. #define TabCtrl_SetItemExtra(hwndTC, cb) \
  2554.     (BOOL)SNDMSG((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L)
  2555.  
  2556.  
  2557. #define TCM_ADJUSTRECT          (TCM_FIRST + 40)
  2558. #define TabCtrl_AdjustRect(hwnd, bLarger, prc) \
  2559.     (int)SNDMSG(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT FAR *)prc)
  2560.  
  2561.  
  2562. #define TCM_SETITEMSIZE         (TCM_FIRST + 41)
  2563. #define TabCtrl_SetItemSize(hwnd, x, y) \
  2564.     (DWORD)SNDMSG((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y))
  2565.  
  2566.  
  2567. #define TCM_REMOVEIMAGE         (TCM_FIRST + 42)
  2568. #define TabCtrl_RemoveImage(hwnd, i) \
  2569.         (void)SNDMSG((hwnd), TCM_REMOVEIMAGE, i, 0L)
  2570.  
  2571.  
  2572. #define TCM_SETPADDING          (TCM_FIRST + 43)
  2573. #define TabCtrl_SetPadding(hwnd,  cx, cy) \
  2574.         (void)SNDMSG((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
  2575.  
  2576.  
  2577. #define TCM_GETROWCOUNT         (TCM_FIRST + 44)
  2578. #define TabCtrl_GetRowCount(hwnd) \
  2579.         (int)SNDMSG((hwnd), TCM_GETROWCOUNT, 0, 0L)
  2580.  
  2581.  
  2582. #define TCM_GETTOOLTIPS         (TCM_FIRST + 45)
  2583. #define TabCtrl_GetToolTips(hwnd) \
  2584.         (HWND)SNDMSG((hwnd), TCM_GETTOOLTIPS, 0, 0L)
  2585.  
  2586.  
  2587. #define TCM_SETTOOLTIPS         (TCM_FIRST + 46)
  2588. #define TabCtrl_SetToolTips(hwnd, hwndTT) \
  2589.         (void)SNDMSG((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L)
  2590.  
  2591.  
  2592. #define TCM_GETCURFOCUS         (TCM_FIRST + 47)
  2593. #define TabCtrl_GetCurFocus(hwnd) \
  2594.     (int)SNDMSG((hwnd), TCM_GETCURFOCUS, 0, 0)
  2595.  
  2596. #define TCM_SETCURFOCUS         (TCM_FIRST + 48)
  2597. #define TabCtrl_SetCurFocus(hwnd, i) \
  2598.     SNDMSG((hwnd),TCM_SETCURFOCUS, i, 0)
  2599.  
  2600.  
  2601. #define TCN_KEYDOWN             (TCN_FIRST - 0)
  2602. typedef struct _TC_KEYDOWN
  2603. {
  2604.     NMHDR hdr;
  2605.     WORD wVKey;
  2606.     UINT flags;
  2607. } TC_KEYDOWN;
  2608.  
  2609. #define TCN_SELCHANGE           (TCN_FIRST - 1)
  2610. #define TCN_SELCHANGING         (TCN_FIRST - 2)
  2611.  
  2612. #endif
  2613.  
  2614.  
  2615. //====== ANIMATE CONTROL ======================================================
  2616.  
  2617. #ifndef NOANIMATE
  2618.  
  2619. #ifdef _WIN32
  2620.  
  2621. #define ANIMATE_CLASSW          L"SysAnimate32"
  2622. #define ANIMATE_CLASSA          "SysAnimate32"
  2623.  
  2624. #ifdef UNICODE
  2625. #define ANIMATE_CLASS           ANIMATE_CLASSW
  2626. #else
  2627. #define ANIMATE_CLASS           ANIMATE_CLASSA
  2628. #endif
  2629.  
  2630. #define ACS_CENTER              0x0001
  2631. #define ACS_TRANSPARENT         0x0002
  2632. #define ACS_AUTOPLAY            0x0004
  2633.  
  2634.  
  2635. #define ACM_OPENA               (WM_USER+100)
  2636. #define ACM_OPENW               (WM_USER+103)
  2637.  
  2638. #ifdef UNICODE
  2639. #define ACM_OPEN                ACM_OPENW
  2640. #else
  2641. #define ACM_OPEN                ACM_OPENA
  2642. #endif
  2643.  
  2644. #define ACM_PLAY                (WM_USER+101)
  2645. #define ACM_STOP                (WM_USER+102)
  2646.  
  2647.  
  2648. #define ACN_START               1
  2649. #define ACN_STOP                2
  2650.  
  2651.  
  2652. #define Animate_Create(hwndP, id, dwStyle, hInstance)   \
  2653.             CreateWindow(ANIMATE_CLASS, NULL,           \
  2654.                 dwStyle, 0, 0, 0, 0, hwndP, (HMENU)(id), hInstance, NULL)
  2655.  
  2656. #define Animate_Open(hwnd, szName)          (BOOL)SNDMSG(hwnd, ACM_OPEN, 0, (LPARAM)(LPTSTR)(szName))
  2657. #define Animate_Play(hwnd, from, to, rep)   (BOOL)SNDMSG(hwnd, ACM_PLAY, (WPARAM)(UINT)(rep), (LPARAM)MAKELONG(from, to))
  2658. #define Animate_Stop(hwnd)                  (BOOL)SNDMSG(hwnd, ACM_STOP, 0, 0)
  2659. #define Animate_Close(hwnd)                 Animate_Open(hwnd, NULL)
  2660. #define Animate_Seek(hwnd, frame)           Animate_Play(hwnd, frame, frame, 1)
  2661. #endif
  2662.  
  2663. #endif
  2664.  
  2665.  
  2666.  
  2667. #ifdef __cplusplus
  2668. }
  2669. #endif
  2670.  
  2671. #ifdef _WIN32
  2672. #include <poppack.h>
  2673. #endif
  2674.  
  2675. #endif
  2676.  
  2677. #endif
  2678.