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