home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / commctrl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  199.0 KB  |  6,364 lines

  1.  
  2. /*****************************************************************************\
  3. *                                                                             *
  4. * commctrl.h - - Interface for the Windows Common Controls                    *
  5. *                                                                             *
  6. * Version 1.2                                                                 *
  7. *                                                                             *
  8. * Copyright (c) 1991-1998, Microsoft Corp.      All rights reserved.          *
  9. *                                                                             *
  10. \*****************************************************************************/
  11.  
  12.  
  13. #ifndef _INC_COMMCTRL
  14. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  15. #define _INC_COMMCTRL
  16.  
  17. #ifndef _WINRESRC_
  18. #ifndef _WIN32_IE
  19. #define _WIN32_IE 0x0501
  20. #else
  21. #if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
  22. #error _WIN32_IE setting conflicts with _WIN32_WINNT setting
  23. #endif
  24. #endif
  25. #endif
  26.  
  27. #ifndef _HRESULT_DEFINED
  28. #define _HRESULT_DEFINED
  29. typedef LONG HRESULT;
  30. #endif // _HRESULT_DEFINED
  31.  
  32. #ifndef NOUSER
  33.  
  34.  
  35. //
  36. // Define API decoration for direct importing of DLL references.
  37. //
  38. #ifndef WINCOMMCTRLAPI
  39. #if !defined(_COMCTL32_) && defined(_WIN32)
  40. #define WINCOMMCTRLAPI DECLSPEC_IMPORT
  41. #else
  42. #define WINCOMMCTRLAPI
  43. #endif
  44. #endif // WINCOMMCTRLAPI
  45.  
  46. //
  47. // For compilers that don't support nameless unions
  48. //
  49. #ifndef DUMMYUNIONNAME
  50. #ifdef NONAMELESSUNION
  51. #define DUMMYUNIONNAME   u
  52. #define DUMMYUNIONNAME2  u2
  53. #define DUMMYUNIONNAME3  u3
  54. #define DUMMYUNIONNAME4  u4
  55. #define DUMMYUNIONNAME5  u5
  56. #else
  57. #define DUMMYUNIONNAME
  58. #define DUMMYUNIONNAME2
  59. #define DUMMYUNIONNAME3
  60. #define DUMMYUNIONNAME4
  61. #define DUMMYUNIONNAME5
  62. #endif
  63. #endif // DUMMYUNIONNAME
  64.  
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #endif
  68.  
  69. //
  70. // Users of this header may define any number of these constants to avoid
  71. // the definitions of each functional group.
  72. //
  73. //    NOTOOLBAR    Customizable bitmap-button toolbar control.
  74. //    NOUPDOWN     Up and Down arrow increment/decrement control.
  75. //    NOSTATUSBAR  Status bar control.
  76. //    NOMENUHELP   APIs to help manage menus, especially with a status bar.
  77. //    NOTRACKBAR   Customizable column-width tracking control.
  78. //    NODRAGLIST   APIs to make a listbox source and sink drag&drop actions.
  79. //    NOPROGRESS   Progress gas gauge.
  80. //    NOHOTKEY     HotKey control
  81. //    NOHEADER     Header bar control.
  82. //    NOIMAGEAPIS  ImageList apis.
  83. //    NOLISTVIEW   ListView control.
  84. //    NOTREEVIEW   TreeView control.
  85. //    NOTABCONTROL Tab control.
  86. //    NOANIMATE    Animate control.
  87. //
  88. //=============================================================================
  89.  
  90. #include <prsht.h>
  91.  
  92. #ifndef SNDMSG
  93. #ifdef __cplusplus
  94. #ifndef _MAC
  95. #define SNDMSG ::SendMessage
  96. #else
  97. #define SNDMSG ::AfxSendMessage
  98. #endif
  99. #else
  100. #ifndef _MAC
  101. #define SNDMSG SendMessage
  102. #else
  103. #define SNDMSG AfxSendMessage
  104. #endif //_MAC
  105. #endif
  106. #endif // ifndef SNDMSG
  107.  
  108. #ifdef _MAC
  109. #ifndef RC_INVOKED
  110. #ifndef _WLM_NOFORCE_LIBS
  111.  
  112. #ifndef _WLMDLL
  113.     #ifdef _DEBUG
  114.         #pragma comment(lib, "comctld.lib")
  115.     #else
  116.         #pragma comment(lib, "comctl.lib")
  117.     #endif
  118.     #pragma comment(linker, "/macres:comctl.rsc")
  119.     #else
  120.     #ifdef _DEBUG
  121.         #pragma comment(lib, "msvcctld.lib")
  122.     #else
  123.         #pragma comment(lib, "msvcctl.lib")
  124.     #endif
  125. #endif // _WLMDLL
  126.  
  127. #endif // _WLM_NOFORCE_LIBS
  128. #endif // RC_INVOKED
  129. #endif //_MAC
  130.  
  131. WINCOMMCTRLAPI void WINAPI InitCommonControls(void);
  132.  
  133. #if (_WIN32_IE >= 0x0300)
  134. typedef struct tagINITCOMMONCONTROLSEX {
  135.     DWORD dwSize;             // size of this structure
  136.     DWORD dwICC;              // flags indicating which classes to be initialized
  137. } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
  138. #define ICC_LISTVIEW_CLASSES 0x00000001 // listview, header
  139. #define ICC_TREEVIEW_CLASSES 0x00000002 // treeview, tooltips
  140. #define ICC_BAR_CLASSES      0x00000004 // toolbar, statusbar, trackbar, tooltips
  141. #define ICC_TAB_CLASSES      0x00000008 // tab, tooltips
  142. #define ICC_UPDOWN_CLASS     0x00000010 // updown
  143. #define ICC_PROGRESS_CLASS   0x00000020 // progress
  144. #define ICC_HOTKEY_CLASS     0x00000040 // hotkey
  145. #define ICC_ANIMATE_CLASS    0x00000080 // animate
  146. #define ICC_WIN95_CLASSES    0x000000FF
  147. #define ICC_DATE_CLASSES     0x00000100 // month picker, date picker, time picker, updown
  148. #define ICC_USEREX_CLASSES   0x00000200 // comboex
  149. #define ICC_COOL_CLASSES     0x00000400 // rebar (coolbar) control
  150. #if (_WIN32_IE >= 0x0400)
  151. #define ICC_INTERNET_CLASSES 0x00000800
  152. #define ICC_PAGESCROLLER_CLASS 0x00001000   // page scroller
  153. #define ICC_NATIVEFNTCTL_CLASS 0x00002000   // native font control
  154. #endif
  155. WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
  156. #endif      // _WIN32_IE >= 0x0300
  157.  
  158. #define ODT_HEADER              100
  159. #define ODT_TAB                 101
  160. #define ODT_LISTVIEW            102
  161.  
  162.  
  163. //====== Ranges for control message IDs =======================================
  164.  
  165. #define LVM_FIRST               0x1000      // ListView messages
  166. #define TV_FIRST                0x1100      // TreeView messages
  167. #define HDM_FIRST               0x1200      // Header messages
  168. #define TCM_FIRST               0x1300      // Tab control messages
  169.  
  170. #if (_WIN32_IE >= 0x0400)
  171. #define PGM_FIRST               0x1400      // Pager control messages
  172. #define CCM_FIRST               0x2000      // Common control shared messages
  173. #define CCM_LAST                (CCM_FIRST + 0x200)
  174.  
  175.  
  176. #define CCM_SETBKCOLOR          (CCM_FIRST + 1) // lParam is bkColor
  177.  
  178. typedef struct tagCOLORSCHEME {
  179.    DWORD            dwSize;
  180.    COLORREF         clrBtnHighlight;       // highlight color
  181.    COLORREF         clrBtnShadow;          // shadow color
  182. } COLORSCHEME, *LPCOLORSCHEME;
  183.  
  184. #define CCM_SETCOLORSCHEME      (CCM_FIRST + 2) // lParam is color scheme
  185. #define CCM_GETCOLORSCHEME      (CCM_FIRST + 3) // fills in COLORSCHEME pointed to by lParam
  186. #define CCM_GETDROPTARGET       (CCM_FIRST + 4)
  187. #define CCM_SETUNICODEFORMAT    (CCM_FIRST + 5)
  188. #define CCM_GETUNICODEFORMAT    (CCM_FIRST + 6)
  189.  
  190. #if (_WIN32_IE >= 0x0500)
  191. #define COMCTL32_VERSION  5
  192. #define CCM_SETVERSION          (CCM_FIRST + 0x7)
  193. #define CCM_GETVERSION          (CCM_FIRST + 0x8)
  194. #define CCM_SETNOTIFYWINDOW     (CCM_FIRST + 0x9) // wParam == hwndParent.
  195. #endif // (_WIN32_IE >= 0x0500)
  196.  
  197. #endif // (_WIN32_IE >= 0x0400)
  198.  
  199. #if (_WIN32_IE >= 0x0400)
  200. // for tooltips
  201. #define INFOTIPSIZE 1024
  202. #endif
  203.  
  204. //====== WM_NOTIFY Macros =====================================================
  205.  
  206. #define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \
  207.     (fn)((hwnd), (int)(wParam), (NMHDR FAR*)(lParam))
  208. #define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) \
  209.     (LRESULT)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(idFrom), (LPARAM)(NMHDR FAR*)(pnmhdr))
  210.  
  211.  
  212. //====== Generic WM_NOTIFY notification codes =================================
  213.  
  214. #define NM_OUTOFMEMORY          (NM_FIRST-1)
  215. #define NM_CLICK                (NM_FIRST-2)    // uses NMCLICK struct
  216. #define NM_DBLCLK               (NM_FIRST-3)
  217. #define NM_RETURN               (NM_FIRST-4)
  218. #define NM_RCLICK               (NM_FIRST-5)    // uses NMCLICK struct
  219. #define NM_RDBLCLK              (NM_FIRST-6)
  220. #define NM_SETFOCUS             (NM_FIRST-7)
  221. #define NM_KILLFOCUS            (NM_FIRST-8)
  222. #if (_WIN32_IE >= 0x0300)
  223. #define NM_CUSTOMDRAW           (NM_FIRST-12)
  224. #define NM_HOVER                (NM_FIRST-13)
  225. #endif
  226. #if (_WIN32_IE >= 0x0400)
  227. #define NM_NCHITTEST            (NM_FIRST-14)   // uses NMMOUSE struct
  228. #define NM_KEYDOWN              (NM_FIRST-15)   // uses NMKEY struct
  229. #define NM_RELEASEDCAPTURE      (NM_FIRST-16)
  230. #define NM_SETCURSOR            (NM_FIRST-17)   // uses NMMOUSE struct
  231. #define NM_CHAR                 (NM_FIRST-18)   // uses NMCHAR struct
  232. #endif
  233. #if (_WIN32_IE >= 0x0401)
  234. #define NM_TOOLTIPSCREATED      (NM_FIRST-19)   // notify of when the tooltips window is create
  235. #endif
  236. #if (_WIN32_IE >= 0x0500)
  237. #define NM_LDOWN                (NM_FIRST-20)
  238. #define NM_RDOWN                (NM_FIRST-21)
  239. #endif
  240.  
  241. #ifndef CCSIZEOF_STRUCT
  242. #define CCSIZEOF_STRUCT(structname, member)  (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
  243. #endif
  244.  
  245. //====== Generic WM_NOTIFY notification structures ============================
  246. #if (_WIN32_IE >= 0x0401)
  247. typedef struct tagNMTOOLTIPSCREATED
  248. {
  249.     NMHDR hdr;
  250.     HWND hwndToolTips;
  251. } NMTOOLTIPSCREATED, * LPNMTOOLTIPSCREATED;
  252. #endif
  253.  
  254. #if (_WIN32_IE >= 0x0400)
  255. typedef struct tagNMMOUSE {
  256.     NMHDR   hdr;
  257.     DWORD_PTR dwItemSpec;
  258.     DWORD_PTR dwItemData;
  259.     POINT   pt;
  260.     LPARAM  dwHitInfo; // any specifics about where on the item or control the mouse is
  261. } NMMOUSE, FAR* LPNMMOUSE;
  262.  
  263. typedef NMMOUSE NMCLICK;
  264. typedef LPNMMOUSE LPNMCLICK;
  265.  
  266. // Generic structure to request an object of a specific type.
  267.  
  268. typedef struct tagNMOBJECTNOTIFY {
  269.     NMHDR   hdr;
  270.     int     iItem;
  271. #ifdef __IID_DEFINED__
  272.     const IID *piid;
  273. #else
  274.     const void *piid;
  275. #endif
  276.     void *pObject;
  277.     HRESULT hResult;
  278.     DWORD dwFlags;    // control specific flags (hints as to where in iItem it hit)
  279. } NMOBJECTNOTIFY, *LPNMOBJECTNOTIFY;
  280.  
  281. // Generic structure for a key
  282.  
  283. typedef struct tagNMKEY
  284. {
  285.     NMHDR hdr;
  286.     UINT  nVKey;
  287.     UINT  uFlags;
  288. } NMKEY, FAR *LPNMKEY;
  289.  
  290. // Generic structure for a character
  291.  
  292. typedef struct tagNMCHAR {
  293.     NMHDR   hdr;
  294.     UINT    ch;
  295.     DWORD   dwItemPrev;     // Item previously selected
  296.     DWORD   dwItemNext;     // Item to be selected
  297. } NMCHAR, FAR* LPNMCHAR;
  298.  
  299. #endif           // _WIN32_IE >= 0x0400
  300.  
  301. //====== WM_NOTIFY codes (NMHDR.code values) ==================================
  302.  
  303. #define NM_FIRST                (0U-  0U)       // generic to all controls
  304. #define NM_LAST                 (0U- 99U)
  305.  
  306. #define LVN_FIRST               (0U-100U)       // listview
  307. #define LVN_LAST                (0U-199U)
  308.  
  309. // Property sheet reserved      (0U-200U) -  (0U-299U) - see prsht.h
  310.  
  311. #define HDN_FIRST               (0U-300U)       // header
  312. #define HDN_LAST                (0U-399U)
  313.  
  314. #define TVN_FIRST               (0U-400U)       // treeview
  315. #define TVN_LAST                (0U-499U)
  316.  
  317. #define TTN_FIRST               (0U-520U)       // tooltips
  318. #define TTN_LAST                (0U-549U)
  319.  
  320. #define TCN_FIRST               (0U-550U)       // tab control
  321. #define TCN_LAST                (0U-580U)
  322.  
  323. // Shell reserved               (0U-580U) -  (0U-589U)
  324.  
  325. #define CDN_FIRST               (0U-601U)       // common dialog (new)
  326. #define CDN_LAST                (0U-699U)
  327.  
  328. #define TBN_FIRST               (0U-700U)       // toolbar
  329. #define TBN_LAST                (0U-720U)
  330.  
  331. #define UDN_FIRST               (0U-721)        // updown
  332. #define UDN_LAST                (0U-740)
  333. #if (_WIN32_IE >= 0x0300)
  334. #define MCN_FIRST               (0U-750U)       // monthcal
  335. #define MCN_LAST                (0U-759U)
  336.  
  337. #define DTN_FIRST               (0U-760U)       // datetimepick
  338. #define DTN_LAST                (0U-799U)
  339.  
  340. #define CBEN_FIRST              (0U-800U)       // combo box ex
  341. #define CBEN_LAST               (0U-830U)
  342.  
  343. #define RBN_FIRST               (0U-831U)       // rebar
  344. #define RBN_LAST                (0U-859U)
  345. #endif
  346.  
  347. #if (_WIN32_IE >= 0x0400)
  348. #define IPN_FIRST               (0U-860U)       // internet address
  349. #define IPN_LAST                (0U-879U)       // internet address
  350.  
  351. #define SBN_FIRST               (0U-880U)       // status bar
  352. #define SBN_LAST                (0U-899U)
  353.  
  354. #define PGN_FIRST               (0U-900U)       // Pager Control
  355. #define PGN_LAST                (0U-950U)
  356.  
  357. #endif
  358.  
  359. #if (_WIN32_IE >= 0x0500)
  360. #ifndef WMN_FIRST
  361. #define WMN_FIRST               (0U-1000U)
  362. #define WMN_LAST                (0U-1200U)
  363. #endif
  364. #endif
  365.  
  366. #define MSGF_COMMCTRL_BEGINDRAG     0x4200
  367. #define MSGF_COMMCTRL_SIZEHEADER    0x4201
  368. #define MSGF_COMMCTRL_DRAGSELECT    0x4202
  369. #define MSGF_COMMCTRL_TOOLBARCUST   0x4203
  370.  
  371. #if (_WIN32_IE >= 0x0300)
  372. //==================== CUSTOM DRAW ==========================================
  373.  
  374.  
  375. // custom draw return flags
  376. // values under 0x00010000 are reserved for global custom draw values.
  377. // above that are for specific controls
  378. #define CDRF_DODEFAULT          0x00000000
  379. #define CDRF_NEWFONT            0x00000002
  380. #define CDRF_SKIPDEFAULT        0x00000004
  381.  
  382.  
  383. #define CDRF_NOTIFYPOSTPAINT    0x00000010
  384. #define CDRF_NOTIFYITEMDRAW     0x00000020
  385. #if (_WIN32_IE >= 0x0400)
  386. #define CDRF_NOTIFYSUBITEMDRAW  0x00000020  // flags are the same, we can distinguish by context
  387. #endif
  388. #define CDRF_NOTIFYPOSTERASE    0x00000040
  389.  
  390. // drawstage flags
  391. // values under 0x00010000 are reserved for global custom draw values.
  392. // above that are for specific controls
  393. #define CDDS_PREPAINT           0x00000001
  394. #define CDDS_POSTPAINT          0x00000002
  395. #define CDDS_PREERASE           0x00000003
  396. #define CDDS_POSTERASE          0x00000004
  397. // the 0x000010000 bit means it's individual item specific
  398. #define CDDS_ITEM               0x00010000
  399. #define CDDS_ITEMPREPAINT       (CDDS_ITEM | CDDS_PREPAINT)
  400. #define CDDS_ITEMPOSTPAINT      (CDDS_ITEM | CDDS_POSTPAINT)
  401. #define CDDS_ITEMPREERASE       (CDDS_ITEM | CDDS_PREERASE)
  402. #define CDDS_ITEMPOSTERASE      (CDDS_ITEM | CDDS_POSTERASE)
  403. #if (_WIN32_IE >= 0x0400)
  404. #define CDDS_SUBITEM            0x00020000
  405. #endif
  406.  
  407.  
  408. // itemState flags
  409. #define CDIS_SELECTED       0x0001
  410. #define CDIS_GRAYED         0x0002
  411. #define CDIS_DISABLED       0x0004
  412. #define CDIS_CHECKED        0x0008
  413. #define CDIS_FOCUS          0x0010
  414. #define CDIS_DEFAULT        0x0020
  415. #define CDIS_HOT            0x0040
  416. #define CDIS_MARKED         0x0080
  417. #define CDIS_INDETERMINATE  0x0100
  418.  
  419. typedef struct tagNMCUSTOMDRAWINFO
  420. {
  421.     NMHDR hdr;
  422.     DWORD dwDrawStage;
  423.     HDC hdc;
  424.     RECT rc;
  425.     DWORD_PTR dwItemSpec;  // this is control specific, but it's how to specify an item.  valid only with CDDS_ITEM bit set
  426.     UINT  uItemState;
  427.     LPARAM lItemlParam;
  428. } NMCUSTOMDRAW, FAR * LPNMCUSTOMDRAW;
  429.  
  430.  
  431.  
  432. typedef struct tagNMTTCUSTOMDRAW
  433. {
  434.     NMCUSTOMDRAW nmcd;
  435.     UINT uDrawFlags;
  436. } NMTTCUSTOMDRAW, FAR * LPNMTTCUSTOMDRAW;
  437.  
  438. #endif      // _WIN32_IE >= 0x0300
  439.  
  440.  
  441. //====== IMAGE APIS ===========================================================
  442.  
  443. #ifndef NOIMAGEAPIS
  444.  
  445. #define CLR_NONE                0xFFFFFFFFL
  446. #define CLR_DEFAULT             0xFF000000L
  447.  
  448. struct _IMAGELIST;
  449. typedef struct _IMAGELIST NEAR* HIMAGELIST;
  450.  
  451. #if (_WIN32_IE >= 0x0300)
  452. typedef struct _IMAGELISTDRAWPARAMS {
  453.     DWORD       cbSize;
  454.     HIMAGELIST  himl;
  455.     int         i;
  456.     HDC         hdcDst;
  457.     int         x;
  458.     int         y;
  459.     int         cx;
  460.     int         cy;
  461.     int         xBitmap;        // x offest from the upperleft of bitmap
  462.     int         yBitmap;        // y offset from the upperleft of bitmap
  463.     COLORREF    rgbBk;
  464.     COLORREF    rgbFg;
  465.     UINT        fStyle;
  466.     DWORD       dwRop;
  467. } IMAGELISTDRAWPARAMS, FAR * LPIMAGELISTDRAWPARAMS;
  468. #endif      // _WIN32_IE >= 0x0300
  469.  
  470. #define ILC_MASK                0x0001
  471. #define ILC_COLOR               0x0000
  472. #define ILC_COLORDDB            0x00FE
  473. #define ILC_COLOR4              0x0004
  474. #define ILC_COLOR8              0x0008
  475. #define ILC_COLOR16             0x0010
  476. #define ILC_COLOR24             0x0018
  477. #define ILC_COLOR32             0x0020
  478. #define ILC_PALETTE             0x0800      // (not implemented)
  479.  
  480. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow);
  481. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Destroy(HIMAGELIST himl);
  482. WINCOMMCTRLAPI int         WINAPI ImageList_GetImageCount(HIMAGELIST himl);
  483. #if (_WIN32_IE >= 0x0300)
  484. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetImageCount(HIMAGELIST himl, UINT uNewCount);
  485. #endif
  486. WINCOMMCTRLAPI int         WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask);
  487. WINCOMMCTRLAPI int         WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, int i, HICON hicon);
  488. WINCOMMCTRLAPI COLORREF    WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk);
  489. WINCOMMCTRLAPI COLORREF    WINAPI ImageList_GetBkColor(HIMAGELIST himl);
  490. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetOverlayImage(HIMAGELIST himl, int iImage, int iOverlay);
  491.  
  492. #define     ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon)
  493.  
  494. #define ILD_NORMAL              0x0000
  495. #define ILD_TRANSPARENT         0x0001
  496. #define ILD_MASK                0x0010
  497. #define ILD_IMAGE               0x0020
  498. #if (_WIN32_IE >= 0x0300)
  499. #define ILD_ROP                 0x0040
  500. #endif
  501. #define ILD_BLEND25             0x0002
  502. #define ILD_BLEND50             0x0004
  503. #define ILD_OVERLAYMASK         0x0F00
  504. #define INDEXTOOVERLAYMASK(i)   ((i) << 8)
  505.  
  506. #define ILD_SELECTED            ILD_BLEND50
  507. #define ILD_FOCUS               ILD_BLEND25
  508. #define ILD_BLEND               ILD_BLEND50
  509. #define CLR_HILIGHT             CLR_DEFAULT
  510.  
  511. WINCOMMCTRLAPI BOOL WINAPI ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle);
  512.  
  513.  
  514. #ifdef _WIN32
  515.  
  516. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Replace(HIMAGELIST himl, int i, HBITMAP hbmImage, HBITMAP hbmMask);
  517. WINCOMMCTRLAPI int         WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask);
  518. 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);
  519. #if (_WIN32_IE >= 0x0300)
  520. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS* pimldp);
  521. #endif
  522. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Remove(HIMAGELIST himl, int i);
  523. WINCOMMCTRLAPI HICON       WINAPI ImageList_GetIcon(HIMAGELIST himl, int i, UINT flags);
  524. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_LoadImageA(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  525. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  526.  
  527. #ifdef UNICODE
  528. #define ImageList_LoadImage     ImageList_LoadImageW
  529. #else
  530. #define ImageList_LoadImage     ImageList_LoadImageA
  531. #endif
  532.  
  533. #if (_WIN32_IE >= 0x0300)
  534. #define ILCF_MOVE   (0x00000000)
  535. #define ILCF_SWAP   (0x00000001)
  536. WINCOMMCTRLAPI BOOL        WINAPI ImageList_Copy(HIMAGELIST himlDst, int iDst, HIMAGELIST himlSrc, int iSrc, UINT uFlags);
  537. #endif
  538.  
  539. WINCOMMCTRLAPI BOOL        WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, int iTrack, int dxHotspot, int dyHotspot);
  540. WINCOMMCTRLAPI void        WINAPI ImageList_EndDrag();
  541. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragEnter(HWND hwndLock, int x, int y);
  542. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragLeave(HWND hwndLock);
  543. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragMove(int x, int y);
  544. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag, int iDrag, int dxHotspot, int dyHotspot);
  545.  
  546. WINCOMMCTRLAPI BOOL        WINAPI ImageList_DragShowNolock(BOOL fShow);
  547. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_GetDragImage(POINT FAR* ppt,POINT FAR* pptHotspot);
  548.  
  549. #define     ImageList_RemoveAll(himl) ImageList_Remove(himl, -1)
  550. #define     ImageList_ExtractIcon(hi, himl, i) ImageList_GetIcon(himl, i, 0)
  551. #define     ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask) ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0)
  552.  
  553. #ifdef __IStream_INTERFACE_DEFINED__
  554. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
  555. WINCOMMCTRLAPI BOOL       WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM pstm);
  556. #endif
  557.  
  558. typedef struct _IMAGEINFO
  559. {
  560.     HBITMAP hbmImage;
  561.     HBITMAP hbmMask;
  562.     int     Unused1;
  563.     int     Unused2;
  564.     RECT    rcImage;
  565. } IMAGEINFO, FAR *LPIMAGEINFO;
  566.  
  567. WINCOMMCTRLAPI BOOL        WINAPI ImageList_GetIconSize(HIMAGELIST himl, int FAR *cx, int FAR *cy);
  568. WINCOMMCTRLAPI BOOL        WINAPI ImageList_SetIconSize(HIMAGELIST himl, int cx, int cy);
  569. WINCOMMCTRLAPI BOOL        WINAPI ImageList_GetImageInfo(HIMAGELIST himl, int i, IMAGEINFO FAR* pImageInfo);
  570. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy);
  571. #if (_WIN32_IE >= 0x0400)
  572. WINCOMMCTRLAPI HIMAGELIST  WINAPI ImageList_Duplicate(HIMAGELIST himl);
  573. #endif
  574.  
  575.  
  576. #endif
  577.  
  578. #endif
  579.  
  580.  
  581. //====== HEADER CONTROL =======================================================
  582.  
  583. #ifndef NOHEADER
  584.  
  585. #ifdef _WIN32
  586. #define WC_HEADERA              "SysHeader32"
  587. #define WC_HEADERW              L"SysHeader32"
  588.  
  589. #ifdef UNICODE
  590. #define WC_HEADER               WC_HEADERW
  591. #else
  592. #define WC_HEADER               WC_HEADERA
  593. #endif
  594.  
  595. #else
  596. #define WC_HEADER               "SysHeader"
  597. #endif
  598.  
  599. // begin_r_commctrl
  600.  
  601. #define HDS_HORZ                0x0000
  602. #define HDS_BUTTONS             0x0002
  603. #if (_WIN32_IE >= 0x0300)
  604. #define HDS_HOTTRACK            0x0004
  605. #endif
  606. #define HDS_HIDDEN              0x0008
  607.  
  608. #if (_WIN32_IE >= 0x0300)
  609. #define HDS_DRAGDROP            0x0040
  610. #define HDS_FULLDRAG            0x0080
  611. #endif
  612. #if (_WIN32_IE >= 0x0500)
  613. #define HDS_FILTERBAR           0x0100
  614. #endif
  615.  
  616. // end_r_commctrl
  617.  
  618. #if (_WIN32_IE >= 0x0500)
  619.  
  620. #define HDFT_ISSTRING       0x0000      // HD_ITEM.pvFilter points to a HD_TEXTFILTER
  621. #define HDFT_ISNUMBER       0x0001      // HD_ITEM.pvFilter points to a INT
  622.  
  623. #define HDFT_HASNOVALUE     0x8000      // clear the filter, by setting this bit
  624.  
  625. #ifdef UNICODE
  626. #define HD_TEXTFILTER HD_TEXTFILTERW
  627. #define HDTEXTFILTER HD_TEXTFILTERW
  628. #define LPHD_TEXTFILTER LPHD_TEXTFILTERW
  629. #define LPHDTEXTFILTER LPHD_TEXTFILTERW
  630. #else
  631. #define HD_TEXTFILTER HD_TEXTFILTERA
  632. #define HDTEXTFILTER HD_TEXTFILTERA
  633. #define LPHD_TEXTFILTER LPHD_TEXTFILTERA
  634. #define LPHDTEXTFILTER LPHD_TEXTFILTERA
  635. #endif
  636.  
  637. typedef struct _HD_TEXTFILTERA
  638. {
  639.     LPSTR pszText;                      // [in] pointer to the buffer containing the filter (ANSI)
  640.     INT cchTextMax;                     // [in] max size of buffer/edit control buffer
  641. } HD_TEXTFILTERA, FAR * LPHD_TEXTFILTERA;
  642.  
  643. typedef struct _HD_TEXTFILTERW
  644. {
  645.     LPWSTR pszText;                     // [in] pointer to the buffer contiaining the filter (UNICODE)
  646.     INT cchTextMax;                     // [in] max size of buffer/edit control buffer
  647. } HD_TEXTFILTERW, FAR * LPHD_TEXTFILTERW;
  648.  
  649. #endif  // _WIN32_IE >= 0x0500
  650.  
  651. #if (_WIN32_IE >= 0x0300)
  652. #define HD_ITEMA HDITEMA
  653. #define HD_ITEMW HDITEMW
  654. #else
  655. #define HDITEMW  HD_ITEMW
  656. #define HDITEMA  HD_ITEMA
  657. #endif
  658. #define HD_ITEM HDITEM
  659.  
  660. typedef struct _HD_ITEMA
  661. {
  662.     UINT    mask;
  663.     int     cxy;
  664.     LPSTR   pszText;
  665.     HBITMAP hbm;
  666.     int     cchTextMax;
  667.     int     fmt;
  668.     LPARAM  lParam;
  669. #if (_WIN32_IE >= 0x0300)
  670.     int     iImage;        // index of bitmap in ImageList
  671.     int     iOrder;        // where to draw this item
  672. #endif
  673. #if (_WIN32_IE >= 0x0500)
  674.     UINT    type;           // [in] filter type (defined what pvFilter is a pointer to)
  675.     LPVOID  pvFilter;       // [in] fillter data see above
  676. #endif
  677. } HDITEMA, FAR * LPHDITEMA;
  678.  
  679. #define HDITEMA_V1_SIZE CCSIZEOF_STRUCT(HDITEMA, lParam)
  680. #define HDITEMW_V1_SIZE CCSIZEOF_STRUCT(HDITEMW, lParam)
  681.  
  682.  
  683. typedef struct _HD_ITEMW
  684. {
  685.     UINT    mask;
  686.     int     cxy;
  687.     LPWSTR   pszText;
  688.     HBITMAP hbm;
  689.     int     cchTextMax;
  690.     int     fmt;
  691.     LPARAM  lParam;
  692. #if (_WIN32_IE >= 0x0300)
  693.     int     iImage;        // index of bitmap in ImageList
  694.     int     iOrder;
  695. #endif
  696. #if (_WIN32_IE >= 0x0500)
  697.     UINT    type;           // [in] filter type (defined what pvFilter is a pointer to)
  698.     LPVOID  pvFilter;       // [in] fillter data see above
  699. #endif
  700. } HDITEMW, FAR * LPHDITEMW;
  701.  
  702. #ifdef UNICODE
  703. #define HDITEM HDITEMW
  704. #define LPHDITEM LPHDITEMW
  705. #define HDITEM_V1_SIZE HDITEMW_V1_SIZE
  706. #else
  707. #define HDITEM HDITEMA
  708. #define LPHDITEM LPHDITEMA
  709. #define HDITEM_V1_SIZE HDITEMA_V1_SIZE
  710. #endif
  711.  
  712.  
  713. #define HDI_WIDTH               0x0001
  714. #define HDI_HEIGHT              HDI_WIDTH
  715. #define HDI_TEXT                0x0002
  716. #define HDI_FORMAT              0x0004
  717. #define HDI_LPARAM              0x0008
  718. #define HDI_BITMAP              0x0010
  719. #if (_WIN32_IE >= 0x0300)
  720. #define HDI_IMAGE               0x0020
  721. #define HDI_DI_SETITEM          0x0040
  722. #define HDI_ORDER               0x0080
  723. #endif
  724. #if (_WIN32_IE >= 0x0500)
  725. #define HDI_FILTER              0x0100
  726. #endif
  727.  
  728. #define HDF_LEFT                0
  729. #define HDF_RIGHT               1
  730. #define HDF_CENTER              2
  731. #define HDF_JUSTIFYMASK         0x0003
  732. #define HDF_RTLREADING          4
  733.  
  734. #define HDF_OWNERDRAW           0x8000
  735. #define HDF_STRING              0x4000
  736. #define HDF_BITMAP              0x2000
  737. #if (_WIN32_IE >= 0x0300)
  738. #define HDF_BITMAP_ON_RIGHT     0x1000
  739. #define HDF_IMAGE               0x0800
  740. #endif
  741.  
  742. #define HDM_GETITEMCOUNT        (HDM_FIRST + 0)
  743. #define Header_GetItemCount(hwndHD) \
  744.     (int)SNDMSG((hwndHD), HDM_GETITEMCOUNT, 0, 0L)
  745.  
  746.  
  747. #define HDM_INSERTITEMA         (HDM_FIRST + 1)
  748. #define HDM_INSERTITEMW         (HDM_FIRST + 10)
  749.  
  750. #ifdef UNICODE
  751. #define HDM_INSERTITEM          HDM_INSERTITEMW
  752. #else
  753. #define HDM_INSERTITEM          HDM_INSERTITEMA
  754. #endif
  755.  
  756. #define Header_InsertItem(hwndHD, i, phdi) \
  757.     (int)SNDMSG((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  758.  
  759.  
  760. #define HDM_DELETEITEM          (HDM_FIRST + 2)
  761. #define Header_DeleteItem(hwndHD, i) \
  762.     (BOOL)SNDMSG((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(i), 0L)
  763.  
  764.  
  765. #define HDM_GETITEMA            (HDM_FIRST + 3)
  766. #define HDM_GETITEMW            (HDM_FIRST + 11)
  767.  
  768. #ifdef UNICODE
  769. #define HDM_GETITEM             HDM_GETITEMW
  770. #else
  771. #define HDM_GETITEM             HDM_GETITEMA
  772. #endif
  773.  
  774. #define Header_GetItem(hwndHD, i, phdi) \
  775.     (BOOL)SNDMSG((hwndHD), HDM_GETITEM, (WPARAM)(int)(i), (LPARAM)(HD_ITEM FAR*)(phdi))
  776.  
  777.  
  778. #define HDM_SETITEMA            (HDM_FIRST + 4)
  779. #define HDM_SETITEMW            (HDM_FIRST + 12)
  780.  
  781. #ifdef UNICODE
  782. #define HDM_SETITEM             HDM_SETITEMW
  783. #else
  784. #define HDM_SETITEM             HDM_SETITEMA
  785. #endif
  786.  
  787. #define Header_SetItem(hwndHD, i, phdi) \
  788.     (BOOL)SNDMSG((hwndHD), HDM_SETITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  789.  
  790. #if (_WIN32_IE >= 0x0300)
  791. #define HD_LAYOUT  HDLAYOUT
  792. #else
  793. #define HDLAYOUT   HD_LAYOUT
  794. #endif
  795.  
  796. typedef struct _HD_LAYOUT
  797. {
  798.     RECT FAR* prc;
  799.     WINDOWPOS FAR* pwpos;
  800. } HDLAYOUT, FAR *LPHDLAYOUT;
  801.  
  802.  
  803. #define HDM_LAYOUT              (HDM_FIRST + 5)
  804. #define Header_Layout(hwndHD, playout) \
  805.     (BOOL)SNDMSG((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout))
  806.  
  807.  
  808. #define HHT_NOWHERE             0x0001
  809. #define HHT_ONHEADER            0x0002
  810. #define HHT_ONDIVIDER           0x0004
  811. #define HHT_ONDIVOPEN           0x0008
  812. #if (_WIN32_IE >= 0x0500)
  813. #define HHT_ONFILTER            0x0010
  814. #define HHT_ONFILTERBUTTON      0x0020
  815. #endif
  816. #define HHT_ABOVE               0x0100
  817. #define HHT_BELOW               0x0200
  818. #define HHT_TORIGHT             0x0400
  819. #define HHT_TOLEFT              0x0800
  820.  
  821. #if (_WIN32_IE >= 0x0300)
  822. #define HD_HITTESTINFO HDHITTESTINFO
  823. #else
  824. #define HDHITTESTINFO  HD_HITTESTINFO
  825. #endif
  826.  
  827. typedef struct _HD_HITTESTINFO
  828. {
  829.     POINT pt;
  830.     UINT flags;
  831.     int iItem;
  832. } HDHITTESTINFO, FAR *LPHDHITTESTINFO;
  833.  
  834.  
  835. #define HDM_HITTEST             (HDM_FIRST + 6)
  836.  
  837. #if (_WIN32_IE >= 0x0300)
  838.  
  839. #define HDM_GETITEMRECT         (HDM_FIRST + 7)
  840. #define Header_GetItemRect(hwnd, iItem, lprc) \
  841.         (BOOL)SNDMSG((hwnd), HDM_GETITEMRECT, (WPARAM)(iItem), (LPARAM)(lprc))
  842.  
  843. #define HDM_SETIMAGELIST        (HDM_FIRST + 8)
  844. #define Header_SetImageList(hwnd, himl) \
  845.         (HIMAGELIST)SNDMSG((hwnd), HDM_SETIMAGELIST, 0, (LPARAM)(himl))
  846.  
  847. #define HDM_GETIMAGELIST        (HDM_FIRST + 9)
  848. #define Header_GetImageList(hwnd) \
  849.         (HIMAGELIST)SNDMSG((hwnd), HDM_GETIMAGELIST, 0, 0)
  850.  
  851.  
  852. #define HDM_ORDERTOINDEX        (HDM_FIRST + 15)
  853. #define Header_OrderToIndex(hwnd, i) \
  854.         (int)SNDMSG((hwnd), HDM_ORDERTOINDEX, (WPARAM)(i), 0)
  855.  
  856. #define HDM_CREATEDRAGIMAGE     (HDM_FIRST + 16)  // wparam = which item (by index)
  857. #define Header_CreateDragImage(hwnd, i) \
  858.         (HIMAGELIST)SNDMSG((hwnd), HDM_CREATEDRAGIMAGE, (WPARAM)(i), 0)
  859.  
  860. #define HDM_GETORDERARRAY       (HDM_FIRST + 17)
  861. #define Header_GetOrderArray(hwnd, iCount, lpi) \
  862.         (BOOL)SNDMSG((hwnd), HDM_GETORDERARRAY, (WPARAM)(iCount), (LPARAM)(lpi))
  863.  
  864. #define HDM_SETORDERARRAY       (HDM_FIRST + 18)
  865. #define Header_SetOrderArray(hwnd, iCount, lpi) \
  866.         (BOOL)SNDMSG((hwnd), HDM_SETORDERARRAY, (WPARAM)(iCount), (LPARAM)(lpi))
  867. // lparam = int array of size HDM_GETITEMCOUNT
  868. // the array specifies the order that all items should be displayed.
  869. // e.g.  { 2, 0, 1}
  870. // says the index 2 item should be shown in the 0ths position
  871. //      index 0 should be shown in the 1st position
  872. //      index 1 should be shown in the 2nd position
  873.  
  874.  
  875. #define HDM_SETHOTDIVIDER          (HDM_FIRST + 19)
  876. #define Header_SetHotDivider(hwnd, fPos, dw) \
  877.         (int)SNDMSG((hwnd), HDM_SETHOTDIVIDER, (WPARAM)(fPos), (LPARAM)(dw))
  878. // convenience message for external dragdrop
  879. // wParam = BOOL  specifying whether the lParam is a dwPos of the cursor
  880. //              position or the index of which divider to hotlight
  881. // lParam = depends on wParam  (-1 and wParm = FALSE turns off hotlight)
  882. #endif      // _WIN32_IE >= 0x0300
  883.  
  884. #if (_WIN32_IE >= 0x0500)
  885.  
  886. #define HDM_SETBITMAPMARGIN          (HDM_FIRST + 20)
  887. #define Header_SetBitmapMargin(hwnd, iWidth) \
  888.         (int)SNDMSG((hwnd), HDM_SETBITMAPMARGIN, (WPARAM)(iWidth), 0)
  889.  
  890. #define HDM_GETBITMAPMARGIN          (HDM_FIRST + 21)
  891. #define Header_GetBitmapMargin(hwnd) \
  892.         (int)SNDMSG((hwnd), HDM_GETBITMAPMARGIN, 0, 0)
  893. #endif
  894.  
  895.  
  896. #if (_WIN32_IE >= 0x0400)
  897. #define HDM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
  898. #define Header_SetUnicodeFormat(hwnd, fUnicode)  \
  899.     (BOOL)SNDMSG((hwnd), HDM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  900.  
  901. #define HDM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
  902. #define Header_GetUnicodeFormat(hwnd)  \
  903.     (BOOL)SNDMSG((hwnd), HDM_GETUNICODEFORMAT, 0, 0)
  904. #endif
  905.  
  906. #if (_WIN32_IE >= 0x0500)
  907. #define HDM_SETFILTERCHANGETIMEOUT  (HDM_FIRST+22)
  908. #define Header_SetFilterChangeTimeout(hwnd, i) \
  909.         (int)SNDMSG((hwnd), HDM_SETFILTERCHANGETIMEOUT, 0, (LPARAM)(i))
  910.  
  911. #define HDM_EDITFILTER          (HDM_FIRST+23)
  912. #define Header_EditFilter(hwnd, i, fDiscardChanges) \
  913.         (int)SNDMSG((hwnd), HDM_EDITFILTER, (WPARAM)(i), MAKELPARAM(fDiscardChanges, 0))
  914.  
  915. // Clear filter takes -1 as a column value to indicate that all
  916. // the filter should be cleared.  When this happens you will
  917. // only receive a single filter changed notification.
  918.  
  919. #define HDM_CLEARFILTER         (HDM_FIRST+24)
  920. #define Header_ClearFilter(hwnd, i) \
  921.         (int)SNDMSG((hwnd), HDM_CLEARFILTER, (WPARAM)(i), 0)
  922. #define Header_ClearAllFilters(hwnd) \
  923.         (int)SNDMSG((hwnd), HDM_CLEARFILTER, (WPARAM)-1, 0)
  924. #endif
  925.  
  926. #define HDN_ITEMCHANGINGA           (HDN_FIRST-0)
  927. #define HDN_ITEMCHANGINGW       (HDN_FIRST-20)
  928. #define HDN_ITEMCHANGEDA        (HDN_FIRST-1)
  929. #define HDN_ITEMCHANGEDW        (HDN_FIRST-21)
  930. #define HDN_ITEMCLICKA          (HDN_FIRST-2)
  931. #define HDN_ITEMCLICKW          (HDN_FIRST-22)
  932. #define HDN_ITEMDBLCLICKA       (HDN_FIRST-3)
  933. #define HDN_ITEMDBLCLICKW       (HDN_FIRST-23)
  934. #define HDN_DIVIDERDBLCLICKA    (HDN_FIRST-5)
  935. #define HDN_DIVIDERDBLCLICKW    (HDN_FIRST-25)
  936. #define HDN_BEGINTRACKA         (HDN_FIRST-6)
  937. #define HDN_BEGINTRACKW         (HDN_FIRST-26)
  938. #define HDN_ENDTRACKA           (HDN_FIRST-7)
  939. #define HDN_ENDTRACKW           (HDN_FIRST-27)
  940. #define HDN_TRACKA              (HDN_FIRST-8)
  941. #define HDN_TRACKW              (HDN_FIRST-28)
  942. #if (_WIN32_IE >= 0x0300)
  943. #define HDN_GETDISPINFOA        (HDN_FIRST-9)
  944. #define HDN_GETDISPINFOW        (HDN_FIRST-29)
  945. #define HDN_BEGINDRAG           (HDN_FIRST-10)
  946. #define HDN_ENDDRAG             (HDN_FIRST-11)
  947. #endif
  948. #if (_WIN32_IE >= 0x0500)
  949. #define HDN_FILTERCHANGE        (HDN_FIRST-12)
  950. #define HDN_FILTERBTNCLICK      (HDN_FIRST-13)
  951. #endif
  952.  
  953. #ifdef UNICODE
  954. #define HDN_ITEMCHANGING         HDN_ITEMCHANGINGW
  955. #define HDN_ITEMCHANGED          HDN_ITEMCHANGEDW
  956. #define HDN_ITEMCLICK            HDN_ITEMCLICKW
  957. #define HDN_ITEMDBLCLICK         HDN_ITEMDBLCLICKW
  958. #define HDN_DIVIDERDBLCLICK      HDN_DIVIDERDBLCLICKW
  959. #define HDN_BEGINTRACK           HDN_BEGINTRACKW
  960. #define HDN_ENDTRACK             HDN_ENDTRACKW
  961. #define HDN_TRACK                HDN_TRACKW
  962. #if (_WIN32_IE >= 0x0300)
  963. #define HDN_GETDISPINFO          HDN_GETDISPINFOW
  964. #endif
  965. #else
  966. #define HDN_ITEMCHANGING         HDN_ITEMCHANGINGA
  967. #define HDN_ITEMCHANGED          HDN_ITEMCHANGEDA
  968. #define HDN_ITEMCLICK            HDN_ITEMCLICKA
  969. #define HDN_ITEMDBLCLICK         HDN_ITEMDBLCLICKA
  970. #define HDN_DIVIDERDBLCLICK      HDN_DIVIDERDBLCLICKA
  971. #define HDN_BEGINTRACK           HDN_BEGINTRACKA
  972. #define HDN_ENDTRACK             HDN_ENDTRACKA
  973. #define HDN_TRACK                HDN_TRACKA
  974. #if (_WIN32_IE >= 0x0300)
  975. #define HDN_GETDISPINFO          HDN_GETDISPINFOA
  976. #endif
  977. #endif
  978.  
  979.  
  980.  
  981. #if (_WIN32_IE >= 0x0300)
  982. #define HD_NOTIFYA              NMHEADERA
  983. #define HD_NOTIFYW              NMHEADERW
  984. #else
  985. #define tagNMHEADERA            _HD_NOTIFY
  986. #define NMHEADERA               HD_NOTIFYA
  987. #define tagHMHEADERW            _HD_NOTIFYW
  988. #define NMHEADERW               HD_NOTIFYW
  989. #endif
  990. #define HD_NOTIFY               NMHEADER
  991.  
  992. typedef struct tagNMHEADERA
  993. {
  994.     NMHDR   hdr;
  995.     int     iItem;
  996.     int     iButton;
  997.     HDITEMA FAR* pitem;
  998. }  NMHEADERA, FAR* LPNMHEADERA;
  999.  
  1000.  
  1001. typedef struct tagNMHEADERW
  1002. {
  1003.     NMHDR   hdr;
  1004.     int     iItem;
  1005.     int     iButton;
  1006.     HDITEMW FAR* pitem;
  1007. } NMHEADERW, FAR* LPNMHEADERW;
  1008.  
  1009. #ifdef UNICODE
  1010. #define NMHEADER                NMHEADERW
  1011. #define LPNMHEADER              LPNMHEADERW
  1012. #else
  1013. #define NMHEADER                NMHEADERA
  1014. #define LPNMHEADER              LPNMHEADERA
  1015. #endif
  1016.  
  1017. typedef struct tagNMHDDISPINFOW
  1018. {
  1019.     NMHDR   hdr;
  1020.     int     iItem;
  1021.     UINT    mask;
  1022.     LPWSTR  pszText;
  1023.     int     cchTextMax;
  1024.     int     iImage;
  1025.     LPARAM  lParam;
  1026. } NMHDDISPINFOW, FAR* LPNMHDDISPINFOW;
  1027.  
  1028. typedef struct tagNMHDDISPINFOA
  1029. {
  1030.     NMHDR   hdr;
  1031.     int     iItem;
  1032.     UINT    mask;
  1033.     LPSTR   pszText;
  1034.     int     cchTextMax;
  1035.     int     iImage;
  1036.     LPARAM  lParam;
  1037. } NMHDDISPINFOA, FAR* LPNMHDDISPINFOA;
  1038.  
  1039.  
  1040. #ifdef UNICODE
  1041. #define NMHDDISPINFO            NMHDDISPINFOW
  1042. #define LPNMHDDISPINFO          LPNMHDDISPINFOW
  1043. #else
  1044. #define NMHDDISPINFO            NMHDDISPINFOA
  1045. #define LPNMHDDISPINFO          LPNMHDDISPINFOA
  1046. #endif
  1047.  
  1048. #if (_WIN32_IE >= 0x0500)
  1049. typedef struct tagNMHDFILTERBTNCLICK
  1050. {
  1051.     NMHDR hdr;
  1052.     INT iItem;
  1053.     RECT rc;
  1054. } NMHDFILTERBTNCLICK, FAR* LPNMHDFILTERBTNCLICK;
  1055. #endif
  1056.  
  1057. #endif      // NOHEADER
  1058.  
  1059.  
  1060. //====== TOOLBAR CONTROL ======================================================
  1061.  
  1062. #ifndef NOTOOLBAR
  1063.  
  1064. #ifdef _WIN32
  1065. #define TOOLBARCLASSNAMEW       L"ToolbarWindow32"
  1066. #define TOOLBARCLASSNAMEA       "ToolbarWindow32"
  1067.  
  1068. #ifdef  UNICODE
  1069. #define TOOLBARCLASSNAME        TOOLBARCLASSNAMEW
  1070. #else
  1071. #define TOOLBARCLASSNAME        TOOLBARCLASSNAMEA
  1072. #endif
  1073.  
  1074. #else
  1075. #define TOOLBARCLASSNAME        "ToolbarWindow"
  1076. #endif
  1077.  
  1078. typedef struct _TBBUTTON {
  1079.     int iBitmap;
  1080.     int idCommand;
  1081.     BYTE fsState;
  1082.     BYTE fsStyle;
  1083. #ifdef _WIN64
  1084.     BYTE bReserved[6];          // padding for alignment
  1085. #elif defined(_WIN32)
  1086.     BYTE bReserved[2];          // padding for alignment
  1087. #endif
  1088.     DWORD_PTR dwData;
  1089.     INT_PTR iString;
  1090. } TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
  1091. typedef const TBBUTTON FAR* LPCTBBUTTON;
  1092.  
  1093.  
  1094. typedef struct _COLORMAP {
  1095.     COLORREF from;
  1096.     COLORREF to;
  1097. } COLORMAP, FAR* LPCOLORMAP;
  1098.  
  1099. WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps,
  1100.                         HINSTANCE hBMInst, UINT_PTR wBMID, LPCTBBUTTON lpButtons,
  1101.                         int iNumButtons, int dxButton, int dyButton,
  1102.                         int dxBitmap, int dyBitmap, UINT uStructSize);
  1103.  
  1104. WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, INT_PTR idBitmap,
  1105.                                   UINT wFlags, LPCOLORMAP lpColorMap,
  1106.                                   int iNumMaps);
  1107.  
  1108. #define CMB_MASKED              0x02
  1109. #define TBSTATE_CHECKED         0x01
  1110. #define TBSTATE_PRESSED         0x02
  1111. #define TBSTATE_ENABLED         0x04
  1112. #define TBSTATE_HIDDEN          0x08
  1113. #define TBSTATE_INDETERMINATE   0x10
  1114. #define TBSTATE_WRAP            0x20
  1115. #if (_WIN32_IE >= 0x0300)
  1116. #define TBSTATE_ELLIPSES        0x40
  1117. #endif
  1118. #if (_WIN32_IE >= 0x0400)
  1119. #define TBSTATE_MARKED          0x80
  1120. #endif
  1121.  
  1122. #define TBSTYLE_BUTTON          0x0000  // obsolete; use BTNS_BUTTON instead
  1123. #define TBSTYLE_SEP             0x0001  // obsolete; use BTNS_SEP instead
  1124. #define TBSTYLE_CHECK           0x0002  // obsolete; use BTNS_CHECK instead
  1125. #define TBSTYLE_GROUP           0x0004  // obsolete; use BTNS_GROUP instead
  1126. #define TBSTYLE_CHECKGROUP      (TBSTYLE_GROUP | TBSTYLE_CHECK)     // obsolete; use BTNS_CHECKGROUP instead
  1127. #if (_WIN32_IE >= 0x0300)
  1128. #define TBSTYLE_DROPDOWN        0x0008  // obsolete; use BTNS_DROPDOWN instead
  1129. #endif
  1130. #if (_WIN32_IE >= 0x0400)
  1131. #define TBSTYLE_AUTOSIZE        0x0010  // obsolete; use BTNS_AUTOSIZE instead
  1132. #define TBSTYLE_NOPREFIX        0x0020  // obsolete; use BTNS_NOPREFIX instead
  1133. #endif
  1134.  
  1135. #define TBSTYLE_TOOLTIPS        0x0100
  1136. #define TBSTYLE_WRAPABLE        0x0200
  1137. #define TBSTYLE_ALTDRAG         0x0400
  1138. #if (_WIN32_IE >= 0x0300)
  1139. #define TBSTYLE_FLAT            0x0800
  1140. #define TBSTYLE_LIST            0x1000
  1141. #define TBSTYLE_CUSTOMERASE     0x2000
  1142. #endif
  1143. #if (_WIN32_IE >= 0x0400)
  1144. #define TBSTYLE_REGISTERDROP    0x4000
  1145. #define TBSTYLE_TRANSPARENT     0x8000
  1146. #define TBSTYLE_EX_DRAWDDARROWS 0x00000001
  1147. #endif
  1148.  
  1149. #if (_WIN32_IE >= 0x0500)
  1150. #define BTNS_BUTTON     TBSTYLE_BUTTON      // 0x0000
  1151. #define BTNS_SEP        TBSTYLE_SEP         // 0x0001
  1152. #define BTNS_CHECK      TBSTYLE_CHECK       // 0x0002
  1153. #define BTNS_GROUP      TBSTYLE_GROUP       // 0x0004
  1154. #define BTNS_CHECKGROUP TBSTYLE_CHECKGROUP  // (TBSTYLE_GROUP | TBSTYLE_CHECK)
  1155. #define BTNS_DROPDOWN   TBSTYLE_DROPDOWN    // 0x0008
  1156. #define BTNS_AUTOSIZE   TBSTYLE_AUTOSIZE    // 0x0010; automatically calculate the cx of the button
  1157. #define BTNS_NOPREFIX   TBSTYLE_NOPREFIX    // 0x0020; this button should not have accel prefix
  1158. #if (_WIN32_IE >= 0x0501)
  1159. #define BTNS_SHOWTEXT   0x0040              // ignored unless TBSTYLE_EX_MIXEDBUTTONS is set
  1160. #endif  // 0x0501
  1161. #define BTNS_WHOLEDROPDOWN  0x0080          // draw drop-down arrow, but without split arrow section
  1162. #endif
  1163.  
  1164. #if (_WIN32_IE >= 0x0501)
  1165. #define TBSTYLE_EX_MIXEDBUTTONS     0x00000008
  1166. #define TBSTYLE_EX_HIDECLIPPEDBUTTONS   0x00000010  // don't show partially obscured buttons
  1167. #endif  // 0x0501
  1168.  
  1169.  
  1170. #if (_WIN32_IE >= 0x0400)
  1171. // Custom Draw Structure
  1172. typedef struct _NMTBCUSTOMDRAW {
  1173.     NMCUSTOMDRAW nmcd;
  1174.     HBRUSH hbrMonoDither;
  1175.     HBRUSH hbrLines;                // For drawing lines on buttons
  1176.     HPEN hpenLines;                 // For drawing lines on buttons
  1177.  
  1178.     COLORREF clrText;               // Color of text
  1179.     COLORREF clrMark;               // Color of text bk when marked. (only if TBSTATE_MARKED)
  1180.     COLORREF clrTextHighlight;      // Color of text when highlighted
  1181.     COLORREF clrBtnFace;            // Background of the button
  1182.     COLORREF clrBtnHighlight;       // 3D highlight
  1183.     COLORREF clrHighlightHotTrack;  // In conjunction with fHighlightHotTrack
  1184.                                     // will cause button to highlight like a menu
  1185.     RECT rcText;                    // Rect for text
  1186.  
  1187.     int nStringBkMode;
  1188.     int nHLStringBkMode;
  1189. } NMTBCUSTOMDRAW, * LPNMTBCUSTOMDRAW;
  1190.  
  1191. // Toolbar custom draw return flags
  1192. #define TBCDRF_NOEDGES              0x00010000  // Don't draw button edges
  1193. #define TBCDRF_HILITEHOTTRACK       0x00020000  // Use color of the button bk when hottracked
  1194. #define TBCDRF_NOOFFSET             0x00040000  // Don't offset button if pressed
  1195. #define TBCDRF_NOMARK               0x00080000  // Don't draw default highlight of image/text for TBSTATE_MARKED
  1196. #define TBCDRF_NOETCHEDEFFECT       0x00100000  // Don't draw etched effect for disabled items
  1197. #endif
  1198.  
  1199. #if (_WIN32_IE >= 0x0500)
  1200. #define TBCDRF_BLENDICON            0x00200000  // Use ILD_BLEND50 on the icon image
  1201. #endif
  1202.  
  1203.  
  1204. #define TB_ENABLEBUTTON         (WM_USER + 1)
  1205. #define TB_CHECKBUTTON          (WM_USER + 2)
  1206. #define TB_PRESSBUTTON          (WM_USER + 3)
  1207. #define TB_HIDEBUTTON           (WM_USER + 4)
  1208. #define TB_INDETERMINATE        (WM_USER + 5)
  1209. #if (_WIN32_IE >= 0x0400)
  1210. #define TB_MARKBUTTON           (WM_USER + 6)
  1211. #endif
  1212. #define TB_ISBUTTONENABLED      (WM_USER + 9)
  1213. #define TB_ISBUTTONCHECKED      (WM_USER + 10)
  1214. #define TB_ISBUTTONPRESSED      (WM_USER + 11)
  1215. #define TB_ISBUTTONHIDDEN       (WM_USER + 12)
  1216. #define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
  1217. #if (_WIN32_IE >= 0x0400)
  1218. #define TB_ISBUTTONHIGHLIGHTED  (WM_USER + 14)
  1219. #endif
  1220. #define TB_SETSTATE             (WM_USER + 17)
  1221. #define TB_GETSTATE             (WM_USER + 18)
  1222. #define TB_ADDBITMAP            (WM_USER + 19)
  1223.  
  1224. #ifdef _WIN32
  1225. typedef struct tagTBADDBITMAP {
  1226.         HINSTANCE       hInst;
  1227.         UINT_PTR        nID;
  1228. } TBADDBITMAP, *LPTBADDBITMAP;
  1229.  
  1230. #define HINST_COMMCTRL          ((HINSTANCE)-1)
  1231. #define IDB_STD_SMALL_COLOR     0
  1232. #define IDB_STD_LARGE_COLOR     1
  1233. #define IDB_VIEW_SMALL_COLOR    4
  1234. #define IDB_VIEW_LARGE_COLOR    5
  1235. #if (_WIN32_IE >= 0x0300)
  1236. #define IDB_HIST_SMALL_COLOR    8
  1237. #define IDB_HIST_LARGE_COLOR    9
  1238. #endif
  1239.  
  1240. // icon indexes for standard bitmap
  1241.  
  1242. #define STD_CUT                 0
  1243. #define STD_COPY                1
  1244. #define STD_PASTE               2
  1245. #define STD_UNDO                3
  1246. #define STD_REDOW               4
  1247. #define STD_DELETE              5
  1248. #define STD_FILENEW             6
  1249. #define STD_FILEOPEN            7
  1250. #define STD_FILESAVE            8
  1251. #define STD_PRINTPRE            9
  1252. #define STD_PROPERTIES          10
  1253. #define STD_HELP                11
  1254. #define STD_FIND                12
  1255. #define STD_REPLACE             13
  1256. #define STD_PRINT               14
  1257.  
  1258. // icon indexes for standard view bitmap
  1259.  
  1260. #define VIEW_LARGEICONS         0
  1261. #define VIEW_SMALLICONS         1
  1262. #define VIEW_LIST               2
  1263. #define VIEW_DETAILS            3
  1264. #define VIEW_SORTNAME           4
  1265. #define VIEW_SORTSIZE           5
  1266. #define VIEW_SORTDATE           6
  1267. #define VIEW_SORTTYPE           7
  1268. #define VIEW_PARENTFOLDER       8
  1269. #define VIEW_NETCONNECT         9
  1270. #define VIEW_NETDISCONNECT      10
  1271. #define VIEW_NEWFOLDER          11
  1272. #if (_WIN32_IE >= 0x0400)
  1273. #define VIEW_VIEWMENU           12
  1274. #endif
  1275.  
  1276. #if (_WIN32_IE >= 0x0300)
  1277. #define HIST_BACK               0
  1278. #define HIST_FORWARD            1
  1279. #define HIST_FAVORITES          2
  1280. #define HIST_ADDTOFAVORITES     3
  1281. #define HIST_VIEWTREE           4
  1282. #endif
  1283.  
  1284. #endif
  1285.  
  1286. #if (_WIN32_IE >= 0x0400)
  1287. #define TB_ADDBUTTONSA          (WM_USER + 20)
  1288. #define TB_INSERTBUTTONA        (WM_USER + 21)
  1289. #else
  1290. #define TB_ADDBUTTONS           (WM_USER + 20)
  1291. #define TB_INSERTBUTTON         (WM_USER + 21)
  1292. #endif
  1293.  
  1294. #define TB_DELETEBUTTON         (WM_USER + 22)
  1295. #define TB_GETBUTTON            (WM_USER + 23)
  1296. #define TB_BUTTONCOUNT          (WM_USER + 24)
  1297. #define TB_COMMANDTOINDEX       (WM_USER + 25)
  1298.  
  1299. #ifdef _WIN32
  1300.  
  1301. typedef struct tagTBSAVEPARAMSA {
  1302.     HKEY hkr;
  1303.     LPCSTR pszSubKey;
  1304.     LPCSTR pszValueName;
  1305. } TBSAVEPARAMSA, FAR* LPTBSAVEPARAMSA;
  1306.  
  1307. typedef struct tagTBSAVEPARAMSW {
  1308.     HKEY hkr;
  1309.     LPCWSTR pszSubKey;
  1310.     LPCWSTR pszValueName;
  1311. } TBSAVEPARAMSW, FAR *LPTBSAVEPARAMW;
  1312.  
  1313. #ifdef UNICODE
  1314. #define TBSAVEPARAMS            TBSAVEPARAMSW
  1315. #define LPTBSAVEPARAMS          LPTBSAVEPARAMSW
  1316. #else
  1317. #define TBSAVEPARAMS            TBSAVEPARAMSA
  1318. #define LPTBSAVEPARAMS          LPTBSAVEPARAMSA
  1319. #endif
  1320.  
  1321. #endif  // _WIN32
  1322.  
  1323. #define TB_SAVERESTOREA         (WM_USER + 26)
  1324. #define TB_SAVERESTOREW         (WM_USER + 76)
  1325. #define TB_CUSTOMIZE            (WM_USER + 27)
  1326. #define TB_ADDSTRINGA           (WM_USER + 28)
  1327. #define TB_ADDSTRINGW           (WM_USER + 77)
  1328. #define TB_GETITEMRECT          (WM_USER + 29)
  1329. #define TB_BUTTONSTRUCTSIZE     (WM_USER + 30)
  1330. #define TB_SETBUTTONSIZE        (WM_USER + 31)
  1331. #define TB_SETBITMAPSIZE        (WM_USER + 32)
  1332. #define TB_AUTOSIZE             (WM_USER + 33)
  1333. #define TB_GETTOOLTIPS          (WM_USER + 35)
  1334. #define TB_SETTOOLTIPS          (WM_USER + 36)
  1335. #define TB_SETPARENT            (WM_USER + 37)
  1336. #define TB_SETROWS              (WM_USER + 39)
  1337. #define TB_GETROWS              (WM_USER + 40)
  1338. #define TB_SETCMDID             (WM_USER + 42)
  1339. #define TB_CHANGEBITMAP         (WM_USER + 43)
  1340. #define TB_GETBITMAP            (WM_USER + 44)
  1341. #define TB_GETBUTTONTEXTA       (WM_USER + 45)
  1342. #define TB_GETBUTTONTEXTW       (WM_USER + 75)
  1343. #define TB_REPLACEBITMAP        (WM_USER + 46)
  1344. #if (_WIN32_IE >= 0x0300)
  1345. #define TB_SETINDENT            (WM_USER + 47)
  1346. #define TB_SETIMAGELIST         (WM_USER + 48)
  1347. #define TB_GETIMAGELIST         (WM_USER + 49)
  1348. #define TB_LOADIMAGES           (WM_USER + 50)
  1349. #define TB_GETRECT              (WM_USER + 51) // wParam is the Cmd instead of index
  1350. #define TB_SETHOTIMAGELIST      (WM_USER + 52)
  1351. #define TB_GETHOTIMAGELIST      (WM_USER + 53)
  1352. #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
  1353. #define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
  1354. #define TB_SETSTYLE             (WM_USER + 56)
  1355. #define TB_GETSTYLE             (WM_USER + 57)
  1356. #define TB_GETBUTTONSIZE        (WM_USER + 58)
  1357. #define TB_SETBUTTONWIDTH       (WM_USER + 59)
  1358. #define TB_SETMAXTEXTROWS       (WM_USER + 60)
  1359. #define TB_GETTEXTROWS          (WM_USER + 61)
  1360. #endif      // _WIN32_IE >= 0x0300
  1361.  
  1362. #ifdef UNICODE
  1363. #define TB_GETBUTTONTEXT        TB_GETBUTTONTEXTW
  1364. #define TB_SAVERESTORE          TB_SAVERESTOREW
  1365. #define TB_ADDSTRING            TB_ADDSTRINGW
  1366. #else
  1367. #define TB_GETBUTTONTEXT        TB_GETBUTTONTEXTA
  1368. #define TB_SAVERESTORE          TB_SAVERESTOREA
  1369. #define TB_ADDSTRING            TB_ADDSTRINGA
  1370. #endif
  1371. #if (_WIN32_IE >= 0x0400)
  1372. #define TB_GETOBJECT            (WM_USER + 62)  // wParam == IID, lParam void **ppv
  1373. #define TB_GETHOTITEM           (WM_USER + 71)
  1374. #define TB_SETHOTITEM           (WM_USER + 72)  // wParam == iHotItem
  1375. #define TB_SETANCHORHIGHLIGHT   (WM_USER + 73)  // wParam == TRUE/FALSE
  1376. #define TB_GETANCHORHIGHLIGHT   (WM_USER + 74)
  1377. #define TB_MAPACCELERATORA      (WM_USER + 78)  // wParam == ch, lParam int * pidBtn
  1378.  
  1379. typedef struct {
  1380.     int   iButton;
  1381.     DWORD dwFlags;
  1382. } TBINSERTMARK, * LPTBINSERTMARK;
  1383. #define TBIMHT_AFTER      0x00000001 // TRUE = insert After iButton, otherwise before
  1384. #define TBIMHT_BACKGROUND 0x00000002 // TRUE iff missed buttons completely
  1385.  
  1386. #define TB_GETINSERTMARK        (WM_USER + 79)  // lParam == LPTBINSERTMARK
  1387. #define TB_SETINSERTMARK        (WM_USER + 80)  // lParam == LPTBINSERTMARK
  1388. #define TB_INSERTMARKHITTEST    (WM_USER + 81)  // wParam == LPPOINT lParam == LPTBINSERTMARK
  1389. #define TB_MOVEBUTTON           (WM_USER + 82)
  1390. #define TB_GETMAXSIZE           (WM_USER + 83)  // lParam == LPSIZE
  1391. #define TB_SETEXTENDEDSTYLE     (WM_USER + 84)  // For TBSTYLE_EX_*
  1392. #define TB_GETEXTENDEDSTYLE     (WM_USER + 85)  // For TBSTYLE_EX_*
  1393. #define TB_GETPADDING           (WM_USER + 86)
  1394. #define TB_SETPADDING           (WM_USER + 87)
  1395. #define TB_SETINSERTMARKCOLOR   (WM_USER + 88)
  1396. #define TB_GETINSERTMARKCOLOR   (WM_USER + 89)
  1397.  
  1398. #define TB_SETCOLORSCHEME       CCM_SETCOLORSCHEME  // lParam is color scheme
  1399. #define TB_GETCOLORSCHEME       CCM_GETCOLORSCHEME      // fills in COLORSCHEME pointed to by lParam
  1400.  
  1401. #define TB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  1402. #define TB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  1403.  
  1404. #define TB_MAPACCELERATORW      (WM_USER + 90)  // wParam == ch, lParam int * pidBtn
  1405. #ifdef UNICODE
  1406. #define TB_MAPACCELERATOR       TB_MAPACCELERATORW
  1407. #else
  1408. #define TB_MAPACCELERATOR       TB_MAPACCELERATORA
  1409. #endif
  1410.  
  1411. #endif  // _WIN32_IE >= 0x0400
  1412.  
  1413. typedef struct {
  1414.     HINSTANCE       hInstOld;
  1415.     UINT_PTR        nIDOld;
  1416.     HINSTANCE       hInstNew;
  1417.     UINT_PTR        nIDNew;
  1418.     int             nButtons;
  1419. } TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
  1420.  
  1421. #ifdef _WIN32
  1422.  
  1423. #define TBBF_LARGE              0x0001
  1424.  
  1425. #define TB_GETBITMAPFLAGS       (WM_USER + 41)
  1426.  
  1427. #if (_WIN32_IE >= 0x0400)
  1428. #define TBIF_IMAGE              0x00000001
  1429. #define TBIF_TEXT               0x00000002
  1430. #define TBIF_STATE              0x00000004
  1431. #define TBIF_STYLE              0x00000008
  1432. #define TBIF_LPARAM             0x00000010
  1433. #define TBIF_COMMAND            0x00000020
  1434. #define TBIF_SIZE               0x00000040
  1435.  
  1436. #if (_WIN32_IE >= 0x0500)
  1437. #define TBIF_BYINDEX            0x80000000 // this specifies that the wparam in Get/SetButtonInfo is an index, not id
  1438. #endif
  1439.  
  1440.  
  1441. typedef struct {
  1442.     UINT cbSize;
  1443.     DWORD dwMask;
  1444.     int idCommand;
  1445.     int iImage;
  1446.     BYTE fsState;
  1447.     BYTE fsStyle;
  1448.     WORD cx;
  1449.     DWORD_PTR lParam;
  1450.     LPSTR pszText;
  1451.     int cchText;
  1452. } TBBUTTONINFOA, *LPTBBUTTONINFOA;
  1453.  
  1454. typedef struct {
  1455.     UINT cbSize;
  1456.     DWORD dwMask;
  1457.     int idCommand;
  1458.     int iImage;
  1459.     BYTE fsState;
  1460.     BYTE fsStyle;
  1461.     WORD cx;
  1462.     DWORD_PTR lParam;
  1463.     LPWSTR pszText;
  1464.     int cchText;
  1465. } TBBUTTONINFOW, *LPTBBUTTONINFOW;
  1466.  
  1467. #ifdef UNICODE
  1468. #define TBBUTTONINFO TBBUTTONINFOW
  1469. #define LPTBBUTTONINFO LPTBBUTTONINFOW
  1470. #else
  1471. #define TBBUTTONINFO TBBUTTONINFOA
  1472. #define LPTBBUTTONINFO LPTBBUTTONINFOA
  1473. #endif
  1474.  
  1475.  
  1476. // BUTTONINFO APIs do NOT support the string pool.
  1477. #define TB_GETBUTTONINFOW        (WM_USER + 63)
  1478. #define TB_SETBUTTONINFOW        (WM_USER + 64)
  1479. #define TB_GETBUTTONINFOA        (WM_USER + 65)
  1480. #define TB_SETBUTTONINFOA        (WM_USER + 66)
  1481. #ifdef UNICODE
  1482. #define TB_GETBUTTONINFO        TB_GETBUTTONINFOW
  1483. #define TB_SETBUTTONINFO        TB_SETBUTTONINFOW
  1484. #else
  1485. #define TB_GETBUTTONINFO        TB_GETBUTTONINFOA
  1486. #define TB_SETBUTTONINFO        TB_SETBUTTONINFOA
  1487. #endif
  1488.  
  1489.  
  1490. #define TB_INSERTBUTTONW        (WM_USER + 67)
  1491. #define TB_ADDBUTTONSW          (WM_USER + 68)
  1492.  
  1493. #define TB_HITTEST              (WM_USER + 69)
  1494.  
  1495. // New post Win95/NT4 for InsertButton and AddButton.  if iString member
  1496. // is a pointer to a string, it will be handled as a string like listview
  1497. // (although LPSTR_TEXTCALLBACK is not supported).
  1498. #ifdef UNICODE
  1499. #define TB_INSERTBUTTON         TB_INSERTBUTTONW
  1500. #define TB_ADDBUTTONS           TB_ADDBUTTONSW
  1501. #else
  1502. #define TB_INSERTBUTTON         TB_INSERTBUTTONA
  1503. #define TB_ADDBUTTONS           TB_ADDBUTTONSA
  1504. #endif
  1505.  
  1506. #define TB_SETDRAWTEXTFLAGS     (WM_USER + 70)  // wParam == mask lParam == bit values
  1507.  
  1508. #endif  // _WIN32_IE >= 0x0400
  1509.  
  1510. #if (_WIN32_IE >= 0x0500)
  1511.  
  1512. #define TB_GETSTRINGW           (WM_USER + 91)
  1513. #define TB_GETSTRINGA           (WM_USER + 92)
  1514. #ifdef UNICODE
  1515. #define TB_GETSTRING            TB_GETSTRINGW
  1516. #else
  1517. #define TB_GETSTRING            TB_GETSTRINGA
  1518. #endif
  1519.  
  1520.  
  1521. #endif  // _WIN32_IE >= 0x0500
  1522.  
  1523.  
  1524. #define TBN_GETBUTTONINFOA      (TBN_FIRST-0)
  1525. #define TBN_BEGINDRAG           (TBN_FIRST-1)
  1526. #define TBN_ENDDRAG             (TBN_FIRST-2)
  1527. #define TBN_BEGINADJUST         (TBN_FIRST-3)
  1528. #define TBN_ENDADJUST           (TBN_FIRST-4)
  1529. #define TBN_RESET               (TBN_FIRST-5)
  1530. #define TBN_QUERYINSERT         (TBN_FIRST-6)
  1531. #define TBN_QUERYDELETE         (TBN_FIRST-7)
  1532. #define TBN_TOOLBARCHANGE       (TBN_FIRST-8)
  1533. #define TBN_CUSTHELP            (TBN_FIRST-9)
  1534. #if (_WIN32_IE >= 0x0300)
  1535. #define TBN_DROPDOWN            (TBN_FIRST - 10)
  1536. #endif
  1537. #if (_WIN32_IE >= 0x0400)
  1538. #define TBN_GETOBJECT           (TBN_FIRST - 12)
  1539.  
  1540. // Structure for TBN_HOTITEMCHANGE notification
  1541. //
  1542. typedef struct tagNMTBHOTITEM
  1543. {
  1544.     NMHDR   hdr;
  1545.     int     idOld;
  1546.     int     idNew;
  1547.     DWORD   dwFlags;           // HICF_*
  1548. } NMTBHOTITEM, * LPNMTBHOTITEM;
  1549.  
  1550. // Hot item change flags
  1551. #define HICF_OTHER          0x00000000
  1552. #define HICF_MOUSE          0x00000001          // Triggered by mouse
  1553. #define HICF_ARROWKEYS      0x00000002          // Triggered by arrow keys
  1554. #define HICF_ACCELERATOR    0x00000004          // Triggered by accelerator
  1555. #define HICF_DUPACCEL       0x00000008          // This accelerator is not unique
  1556. #define HICF_ENTERING       0x00000010          // idOld is invalid
  1557. #define HICF_LEAVING        0x00000020          // idNew is invalid
  1558. #define HICF_RESELECT       0x00000040          // hot item reselected
  1559. #define HICF_LMOUSE         0x00000080          // left mouse button selected
  1560. #define HICF_TOGGLEDROPDOWN 0x00000100          // Toggle button's dropdown state
  1561.  
  1562.  
  1563. #define TBN_HOTITEMCHANGE       (TBN_FIRST - 13)
  1564. #define TBN_DRAGOUT             (TBN_FIRST - 14) // this is sent when the user clicks down on a button then drags off the button
  1565. #define TBN_DELETINGBUTTON      (TBN_FIRST - 15) // uses TBNOTIFY
  1566. #define TBN_GETDISPINFOA        (TBN_FIRST - 16) // This is sent when the  toolbar needs  some display information
  1567. #define TBN_GETDISPINFOW        (TBN_FIRST - 17) // This is sent when the  toolbar needs  some display information
  1568. #define TBN_GETINFOTIPA         (TBN_FIRST - 18)
  1569. #define TBN_GETINFOTIPW         (TBN_FIRST - 19)
  1570. #define TBN_GETBUTTONINFOW      (TBN_FIRST - 20)
  1571. #if (_WIN32_IE >= 0x0500)
  1572. #define TBN_RESTORE             (TBN_FIRST - 21)
  1573. #define TBN_SAVE                (TBN_FIRST - 22)
  1574. #define TBN_INITCUSTOMIZE       (TBN_FIRST - 23)
  1575. #define    TBNRF_HIDEHELP       0x00000001
  1576. #define    TBNRF_ENDCUSTOMIZE   0x00000002
  1577. #endif // (_WIN32_IE >= 0x0500)
  1578.  
  1579.  
  1580.  
  1581. #if (_WIN32_IE >= 0x0500)
  1582.  
  1583. typedef struct tagNMTBSAVE
  1584. {
  1585.     NMHDR hdr;
  1586.     DWORD* pData;
  1587.     DWORD* pCurrent;
  1588.     UINT cbData;
  1589.     int iItem;
  1590.     int cButtons;
  1591.     TBBUTTON tbButton;
  1592. } NMTBSAVE, *LPNMTBSAVE;
  1593.  
  1594. typedef struct tagNMTBRESTORE
  1595. {
  1596.     NMHDR hdr;
  1597.     DWORD* pData;
  1598.     DWORD* pCurrent;
  1599.     UINT cbData;
  1600.     int iItem;
  1601.     int cButtons;
  1602.     int cbBytesPerRecord;
  1603.     TBBUTTON tbButton;
  1604. } NMTBRESTORE, *LPNMTBRESTORE;
  1605. #endif // (_WIN32_IE >= 0x0500)
  1606.  
  1607. typedef struct tagNMTBGETINFOTIPA
  1608. {
  1609.     NMHDR hdr;
  1610.     LPSTR pszText;
  1611.     int cchTextMax;
  1612.     int iItem;
  1613.     LPARAM lParam;
  1614. } NMTBGETINFOTIPA, *LPNMTBGETINFOTIPA;
  1615.  
  1616. typedef struct tagNMTBGETINFOTIPW
  1617. {
  1618.     NMHDR hdr;
  1619.     LPWSTR pszText;
  1620.     int cchTextMax;
  1621.     int iItem;
  1622.     LPARAM lParam;
  1623. } NMTBGETINFOTIPW, *LPNMTBGETINFOTIPW;
  1624.  
  1625. #ifdef UNICODE
  1626. #define TBN_GETINFOTIP          TBN_GETINFOTIPW
  1627. #define NMTBGETINFOTIP          NMTBGETINFOTIPW
  1628. #define LPNMTBGETINFOTIP        LPNMTBGETINFOTIPW
  1629. #else
  1630. #define TBN_GETINFOTIP          TBN_GETINFOTIPA
  1631. #define NMTBGETINFOTIP          NMTBGETINFOTIPA
  1632. #define LPNMTBGETINFOTIP        LPNMTBGETINFOTIPA
  1633. #endif
  1634.  
  1635. #define TBNF_IMAGE              0x00000001
  1636. #define TBNF_TEXT               0x00000002
  1637. #define TBNF_DI_SETITEM         0x10000000
  1638.  
  1639. typedef struct {
  1640.     NMHDR  hdr;
  1641.     DWORD dwMask;     // [in] Specifies the values requested .[out] Client ask the data to be set for future use
  1642.     int idCommand;    // [in] id of button we're requesting info for
  1643.     DWORD_PTR lParam;  // [in] lParam of button
  1644.     int iImage;       // [out] image index
  1645.     LPSTR pszText;    // [out] new text for item
  1646.     int cchText;      // [in] size of buffer pointed to by pszText
  1647. } NMTBDISPINFOA, *LPNMTBDISPINFOA;
  1648.  
  1649. typedef struct {
  1650.     NMHDR hdr;
  1651.     DWORD dwMask;      //[in] Specifies the values requested .[out] Client ask the data to be set for future use
  1652.     int idCommand;    // [in] id of button we're requesting info for
  1653.     DWORD_PTR lParam;  // [in] lParam of button
  1654.     int iImage;       // [out] image index
  1655.     LPWSTR pszText;   // [out] new text for item
  1656.     int cchText;      // [in] size of buffer pointed to by pszText
  1657. } NMTBDISPINFOW, *LPNMTBDISPINFOW;
  1658.  
  1659.  
  1660. #ifdef UNICODE
  1661. #define TBN_GETDISPINFO       TBN_GETDISPINFOW
  1662. #define NMTBDISPINFO          NMTBDISPINFOW
  1663. #define LPNMTBDISPINFO        LPNMTBDISPINFOW
  1664. #else
  1665. #define TBN_GETDISPINFO       TBN_GETDISPINFOA
  1666. #define NMTBDISPINFO          NMTBDISPINFOA
  1667. #define LPNMTBDISPINFO        LPNMTBDISPINFOA
  1668. #endif
  1669.  
  1670. // Return codes for TBN_DROPDOWN
  1671. #define TBDDRET_DEFAULT         0
  1672. #define TBDDRET_NODEFAULT       1
  1673. #define TBDDRET_TREATPRESSED    2       // Treat as a standard press button
  1674.  
  1675. #endif
  1676.  
  1677.  
  1678. #ifdef UNICODE
  1679. #define TBN_GETBUTTONINFO       TBN_GETBUTTONINFOW
  1680. #else
  1681. #define TBN_GETBUTTONINFO       TBN_GETBUTTONINFOA
  1682. #endif
  1683.  
  1684. #if (_WIN32_IE >= 0x0300)
  1685. #define TBNOTIFYA NMTOOLBARA
  1686. #define TBNOTIFYW NMTOOLBARW
  1687. #define LPTBNOTIFYA LPNMTOOLBARA
  1688. #define LPTBNOTIFYW LPNMTOOLBARW
  1689. #else
  1690. #define tagNMTOOLBARA  tagTBNOTIFYA
  1691. #define NMTOOLBARA     TBNOTIFYA
  1692. #define LPNMTOOLBARA   LPTBNOTIFYA
  1693. #define tagNMTOOLBARW  tagTBNOTIFYW
  1694. #define NMTOOLBARW     TBNOTIFYW
  1695. #define LPNMTOOLBARW   LPTBNOTIFYW
  1696. #endif
  1697.  
  1698. #define TBNOTIFY       NMTOOLBAR
  1699. #define LPTBNOTIFY     LPNMTOOLBAR
  1700.  
  1701. #if (_WIN32_IE >= 0x0300)
  1702. typedef struct tagNMTOOLBARA {
  1703.     NMHDR   hdr;
  1704.     int     iItem;
  1705.     TBBUTTON tbButton;
  1706.     int     cchText;
  1707.     LPSTR   pszText;
  1708. #if (_WIN32_IE >= 0x500)
  1709.     RECT    rcButton;
  1710. #endif
  1711. } NMTOOLBARA, FAR* LPNMTOOLBARA;
  1712. #endif
  1713.  
  1714.  
  1715. #if (_WIN32_IE >= 0x0300)
  1716. typedef struct tagNMTOOLBARW {
  1717.     NMHDR   hdr;
  1718.     int     iItem;
  1719.     TBBUTTON tbButton;
  1720.     int     cchText;
  1721.     LPWSTR   pszText;
  1722. #if (_WIN32_IE >= 0x500)
  1723.     RECT    rcButton;
  1724. #endif
  1725. } NMTOOLBARW, FAR* LPNMTOOLBARW;
  1726. #endif
  1727.  
  1728.  
  1729. #ifdef UNICODE
  1730. #define NMTOOLBAR               NMTOOLBARW
  1731. #define LPNMTOOLBAR             LPNMTOOLBARW
  1732. #else
  1733. #define NMTOOLBAR               NMTOOLBARA
  1734. #define LPNMTOOLBAR             LPNMTOOLBARA
  1735. #endif
  1736.  
  1737. #endif
  1738.  
  1739. #endif      // NOTOOLBAR
  1740.  
  1741.  
  1742. #if (_WIN32_IE >= 0x0300)
  1743. //====== REBAR CONTROL ========================================================
  1744.  
  1745. #ifndef NOREBAR
  1746.  
  1747. #ifdef _WIN32
  1748. #define REBARCLASSNAMEW         L"ReBarWindow32"
  1749. #define REBARCLASSNAMEA         "ReBarWindow32"
  1750.  
  1751. #ifdef  UNICODE
  1752. #define REBARCLASSNAME          REBARCLASSNAMEW
  1753. #else
  1754. #define REBARCLASSNAME          REBARCLASSNAMEA
  1755. #endif
  1756.  
  1757. #else
  1758. #define REBARCLASSNAME          "ReBarWindow"
  1759. #endif
  1760.  
  1761. #define RBIM_IMAGELIST  0x00000001
  1762.  
  1763. // begin_r_commctrl
  1764.  
  1765. #if (_WIN32_IE >= 0x0400)
  1766. #define RBS_TOOLTIPS        0x0100
  1767. #define RBS_VARHEIGHT       0x0200
  1768. #define RBS_BANDBORDERS     0x0400
  1769. #define RBS_FIXEDORDER      0x0800
  1770. #define RBS_REGISTERDROP    0x1000
  1771. #define RBS_AUTOSIZE        0x2000
  1772. #define RBS_VERTICALGRIPPER 0x4000  // this always has the vertical gripper (default for horizontal mode)
  1773. #define RBS_DBLCLKTOGGLE    0x8000
  1774. #else
  1775. #define RBS_TOOLTIPS        0x00000100
  1776. #define RBS_VARHEIGHT       0x00000200
  1777. #define RBS_BANDBORDERS     0x00000400
  1778. #define RBS_FIXEDORDER      0x00000800
  1779. #endif      // _WIN32_IE >= 0x0400
  1780.  
  1781.  
  1782. // end_r_commctrl
  1783.  
  1784. typedef struct tagREBARINFO
  1785. {
  1786.     UINT        cbSize;
  1787.     UINT        fMask;
  1788. #ifndef NOIMAGEAPIS
  1789.     HIMAGELIST  himl;
  1790. #else
  1791.     HANDLE      himl;
  1792. #endif
  1793. }   REBARINFO, FAR *LPREBARINFO;
  1794.  
  1795. #define RBBS_BREAK          0x00000001  // break to new line
  1796. #define RBBS_FIXEDSIZE      0x00000002  // band can't be sized
  1797. #define RBBS_CHILDEDGE      0x00000004  // edge around top & bottom of child window
  1798. #define RBBS_HIDDEN         0x00000008  // don't show
  1799. #define RBBS_NOVERT         0x00000010  // don't show when vertical
  1800. #define RBBS_FIXEDBMP       0x00000020  // bitmap doesn't move during band resize
  1801. #if (_WIN32_IE >= 0x0400)               //
  1802. #define RBBS_VARIABLEHEIGHT 0x00000040  // allow autosizing of this child vertically
  1803. #define RBBS_GRIPPERALWAYS  0x00000080  // always show the gripper
  1804. #define RBBS_NOGRIPPER      0x00000100  // never show the gripper
  1805. #if (_WIN32_IE >= 0x0500)               //
  1806. #define RBBS_USECHEVRON     0x00000200  // display drop-down button for this band if it's sized smaller than ideal width
  1807. #if (_WIN32_IE >= 0x0501)               //
  1808. #define RBBS_HIDETITLE      0x00000400  // keep band title hidden
  1809. #endif // 0x0501                        //
  1810. #endif // 0x0500                        //
  1811. #endif // 0x0400                        //
  1812.  
  1813. #define RBBIM_STYLE         0x00000001
  1814. #define RBBIM_COLORS        0x00000002
  1815. #define RBBIM_TEXT          0x00000004
  1816. #define RBBIM_IMAGE         0x00000008
  1817. #define RBBIM_CHILD         0x00000010
  1818. #define RBBIM_CHILDSIZE     0x00000020
  1819. #define RBBIM_SIZE          0x00000040
  1820. #define RBBIM_BACKGROUND    0x00000080
  1821. #define RBBIM_ID            0x00000100
  1822. #if (_WIN32_IE >= 0x0400)
  1823. #define RBBIM_IDEALSIZE     0x00000200
  1824. #define RBBIM_LPARAM        0x00000400
  1825. #define RBBIM_HEADERSIZE    0x00000800  // control the size of the header
  1826. #endif
  1827.  
  1828. typedef struct tagREBARBANDINFOA
  1829. {
  1830.     UINT        cbSize;
  1831.     UINT        fMask;
  1832.     UINT        fStyle;
  1833.     COLORREF    clrFore;
  1834.     COLORREF    clrBack;
  1835.     LPSTR       lpText;
  1836.     UINT        cch;
  1837.     int         iImage;
  1838.     HWND        hwndChild;
  1839.     UINT        cxMinChild;
  1840.     UINT        cyMinChild;
  1841.     UINT        cx;
  1842.     HBITMAP     hbmBack;
  1843.     UINT        wID;
  1844. #if (_WIN32_IE >= 0x0400)
  1845.     UINT        cyChild;
  1846.     UINT        cyMaxChild;
  1847.     UINT        cyIntegral;
  1848.     UINT        cxIdeal;
  1849.     LPARAM      lParam;
  1850.     UINT        cxHeader;
  1851. #endif
  1852. }   REBARBANDINFOA, FAR *LPREBARBANDINFOA;
  1853. typedef REBARBANDINFOA CONST FAR *LPCREBARBANDINFOA;
  1854.  
  1855. #define REBARBANDINFOA_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA, wID)
  1856. #define REBARBANDINFOW_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW, wID)
  1857.  
  1858. typedef struct tagREBARBANDINFOW
  1859. {
  1860.     UINT        cbSize;
  1861.     UINT        fMask;
  1862.     UINT        fStyle;
  1863.     COLORREF    clrFore;
  1864.     COLORREF    clrBack;
  1865.     LPWSTR      lpText;
  1866.     UINT        cch;
  1867.     int         iImage;
  1868.     HWND        hwndChild;
  1869.     UINT        cxMinChild;
  1870.     UINT        cyMinChild;
  1871.     UINT        cx;
  1872.     HBITMAP     hbmBack;
  1873.     UINT        wID;
  1874. #if (_WIN32_IE >= 0x0400)
  1875.     UINT        cyChild;
  1876.     UINT        cyMaxChild;
  1877.     UINT        cyIntegral;
  1878.     UINT        cxIdeal;
  1879.     LPARAM      lParam;
  1880.     UINT        cxHeader;
  1881. #endif
  1882. }   REBARBANDINFOW, FAR *LPREBARBANDINFOW;
  1883. typedef REBARBANDINFOW CONST FAR *LPCREBARBANDINFOW;
  1884.  
  1885. #ifdef UNICODE
  1886. #define REBARBANDINFO       REBARBANDINFOW
  1887. #define LPREBARBANDINFO     LPREBARBANDINFOW
  1888. #define LPCREBARBANDINFO    LPCREBARBANDINFOW
  1889. #define REBARBANDINFO_V3_SIZE REBARBANDINFOW_V3_SIZE
  1890. #else
  1891. #define REBARBANDINFO       REBARBANDINFOA
  1892. #define LPREBARBANDINFO     LPREBARBANDINFOA
  1893. #define LPCREBARBANDINFO    LPCREBARBANDINFOA
  1894. #define REBARBANDINFO_V3_SIZE REBARBANDINFOA_V3_SIZE
  1895. #endif
  1896.  
  1897. #define RB_INSERTBANDA  (WM_USER +  1)
  1898. #define RB_DELETEBAND   (WM_USER +  2)
  1899. #define RB_GETBARINFO   (WM_USER +  3)
  1900. #define RB_SETBARINFO   (WM_USER +  4)
  1901. #if (_WIN32_IE < 0x0400)
  1902. #define RB_GETBANDINFO  (WM_USER +  5)
  1903. #endif
  1904. #define RB_SETBANDINFOA (WM_USER +  6)
  1905. #define RB_SETPARENT    (WM_USER +  7)
  1906. #if (_WIN32_IE >= 0x0400)
  1907. #define RB_HITTEST      (WM_USER +  8)
  1908. #define RB_GETRECT      (WM_USER +  9)
  1909. #endif
  1910. #define RB_INSERTBANDW  (WM_USER +  10)
  1911. #define RB_SETBANDINFOW (WM_USER +  11)
  1912. #define RB_GETBANDCOUNT (WM_USER +  12)
  1913. #define RB_GETROWCOUNT  (WM_USER +  13)
  1914. #define RB_GETROWHEIGHT (WM_USER +  14)
  1915. #if (_WIN32_IE >= 0x0400)
  1916. #define RB_IDTOINDEX    (WM_USER +  16) // wParam == id
  1917. #define RB_GETTOOLTIPS  (WM_USER +  17)
  1918. #define RB_SETTOOLTIPS  (WM_USER +  18)
  1919. #define RB_SETBKCOLOR   (WM_USER +  19) // sets the default BK color
  1920. #define RB_GETBKCOLOR   (WM_USER +  20) // defaults to CLR_NONE
  1921. #define RB_SETTEXTCOLOR (WM_USER +  21)
  1922. #define RB_GETTEXTCOLOR (WM_USER +  22) // defaults to 0x00000000
  1923. #define RB_SIZETORECT   (WM_USER +  23) // resize the rebar/break bands and such to this rect (lparam)
  1924. #endif      // _WIN32_IE >= 0x0400
  1925.  
  1926. #define RB_SETCOLORSCHEME   CCM_SETCOLORSCHEME  // lParam is color scheme
  1927. #define RB_GETCOLORSCHEME   CCM_GETCOLORSCHEME  // fills in COLORSCHEME pointed to by lParam
  1928.  
  1929. #ifdef UNICODE
  1930. #define RB_INSERTBAND   RB_INSERTBANDW
  1931. #define RB_SETBANDINFO   RB_SETBANDINFOW
  1932. #else
  1933. #define RB_INSERTBAND   RB_INSERTBANDA
  1934. #define RB_SETBANDINFO   RB_SETBANDINFOA
  1935. #endif
  1936.  
  1937. #if (_WIN32_IE >= 0x0400)
  1938. // for manual drag control
  1939. // lparam == cursor pos
  1940.         // -1 means do it yourself.
  1941.         // -2 means use what you had saved before
  1942. #define RB_BEGINDRAG    (WM_USER + 24)
  1943. #define RB_ENDDRAG      (WM_USER + 25)
  1944. #define RB_DRAGMOVE     (WM_USER + 26)
  1945. #define RB_GETBARHEIGHT (WM_USER + 27)
  1946. #define RB_GETBANDINFOW (WM_USER + 28)
  1947. #define RB_GETBANDINFOA (WM_USER + 29)
  1948.  
  1949. #ifdef UNICODE
  1950. #define RB_GETBANDINFO   RB_GETBANDINFOW
  1951. #else
  1952. #define RB_GETBANDINFO   RB_GETBANDINFOA
  1953. #endif
  1954.  
  1955. #define RB_MINIMIZEBAND (WM_USER + 30)
  1956. #define RB_MAXIMIZEBAND (WM_USER + 31)
  1957.  
  1958. #define RB_GETDROPTARGET (CCM_GETDROPTARGET)
  1959.  
  1960. #define RB_GETBANDBORDERS (WM_USER + 34)  // returns in lparam = lprc the amount of edges added to band wparam
  1961.  
  1962. #define RB_SHOWBAND     (WM_USER + 35)      // show/hide band
  1963. #define RB_SETPALETTE   (WM_USER + 37)
  1964. #define RB_GETPALETTE   (WM_USER + 38)
  1965. #define RB_MOVEBAND     (WM_USER + 39)
  1966.  
  1967. #define RB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  1968. #define RB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  1969.  
  1970. #endif      // _WIN32_IE >= 0x0400
  1971.  
  1972. #if (_WIN32_IE >= 0x0500)
  1973. #define RB_PUSHCHEVRON  (WM_USER + 43)
  1974. #endif      // _WIN32_IE >= 0x0500
  1975.  
  1976. #define RBN_HEIGHTCHANGE    (RBN_FIRST - 0)
  1977.  
  1978. #if (_WIN32_IE >= 0x0400)
  1979. #define RBN_GETOBJECT       (RBN_FIRST - 1)
  1980. #define RBN_LAYOUTCHANGED   (RBN_FIRST - 2)
  1981. #define RBN_AUTOSIZE        (RBN_FIRST - 3)
  1982. #define RBN_BEGINDRAG       (RBN_FIRST - 4)
  1983. #define RBN_ENDDRAG         (RBN_FIRST - 5)
  1984. #define RBN_DELETINGBAND    (RBN_FIRST - 6)     // Uses NMREBAR
  1985. #define RBN_DELETEDBAND     (RBN_FIRST - 7)     // Uses NMREBAR
  1986. #define RBN_CHILDSIZE       (RBN_FIRST - 8)
  1987.  
  1988. #if (_WIN32_IE >= 0x0500)
  1989. #define RBN_CHEVRONPUSHED   (RBN_FIRST - 10)
  1990. #endif      // _WIN32_IE >= 0x0500
  1991.  
  1992.  
  1993. #if (_WIN32_IE >= 0x0500)
  1994. #define RBN_MINMAX          (RBN_FIRST - 21)
  1995. #endif
  1996.  
  1997. typedef struct tagNMREBARCHILDSIZE
  1998. {
  1999.     NMHDR hdr;
  2000.     UINT uBand;
  2001.     UINT wID;
  2002.     RECT rcChild;
  2003.     RECT rcBand;
  2004. } NMREBARCHILDSIZE, *LPNMREBARCHILDSIZE;
  2005.  
  2006. typedef struct tagNMREBAR
  2007. {
  2008.     NMHDR   hdr;
  2009.     DWORD   dwMask;           // RBNM_*
  2010.     UINT    uBand;
  2011.     UINT    fStyle;
  2012.     UINT    wID;
  2013.     LPARAM  lParam;
  2014. } NMREBAR, *LPNMREBAR;
  2015.  
  2016. // Mask flags for NMREBAR
  2017. #define RBNM_ID         0x00000001
  2018. #define RBNM_STYLE      0x00000002
  2019. #define RBNM_LPARAM     0x00000004
  2020.  
  2021.  
  2022. typedef struct tagNMRBAUTOSIZE
  2023. {
  2024.     NMHDR hdr;
  2025.     BOOL fChanged;
  2026.     RECT rcTarget;
  2027.     RECT rcActual;
  2028. } NMRBAUTOSIZE, *LPNMRBAUTOSIZE;
  2029.  
  2030. #if (_WIN32_IE >= 0x0500)
  2031. typedef struct tagNMREBARCHEVRON
  2032. {
  2033.     NMHDR hdr;
  2034.     UINT uBand;
  2035.     UINT wID;
  2036.     LPARAM lParam;
  2037.     RECT rc;
  2038.     LPARAM lParamNM;
  2039. } NMREBARCHEVRON, *LPNMREBARCHEVRON;
  2040. #endif
  2041.  
  2042. #define RBHT_NOWHERE    0x0001
  2043. #define RBHT_CAPTION    0x0002
  2044. #define RBHT_CLIENT     0x0003
  2045. #define RBHT_GRABBER    0x0004
  2046. #if (_WIN32_IE >= 0x0500)
  2047. #define RBHT_CHEVRON    0x0008
  2048. #endif
  2049.  
  2050. typedef struct _RB_HITTESTINFO
  2051. {
  2052.     POINT pt;
  2053.     UINT flags;
  2054.     int iBand;
  2055. } RBHITTESTINFO, FAR *LPRBHITTESTINFO;
  2056.  
  2057. #endif      // _WIN32_IE >= 0x0400
  2058.  
  2059. #endif      // NOREBAR
  2060.  
  2061. #endif      // _WIN32_IE >= 0x0300
  2062.  
  2063. //====== TOOLTIPS CONTROL =====================================================
  2064.  
  2065. #ifndef NOTOOLTIPS
  2066.  
  2067. #ifdef _WIN32
  2068.  
  2069. #define TOOLTIPS_CLASSW         L"tooltips_class32"
  2070. #define TOOLTIPS_CLASSA         "tooltips_class32"
  2071.  
  2072. #ifdef UNICODE
  2073. #define TOOLTIPS_CLASS          TOOLTIPS_CLASSW
  2074. #else
  2075. #define TOOLTIPS_CLASS          TOOLTIPS_CLASSA
  2076. #endif
  2077.  
  2078. #else
  2079. #define TOOLTIPS_CLASS          "tooltips_class"
  2080. #endif
  2081.  
  2082. #if (_WIN32_IE >= 0x0300)
  2083. #define LPTOOLINFOA   LPTTTOOLINFOA
  2084. #define LPTOOLINFOW   LPTTTOOLINFOW
  2085. #define TOOLINFOA       TTTOOLINFOA
  2086. #define TOOLINFOW       TTTOOLINFOW
  2087. #else
  2088. #define   TTTOOLINFOA   TOOLINFOA
  2089. #define LPTTTOOLINFOA LPTOOLINFOA
  2090. #define   TTTOOLINFOW   TOOLINFOW
  2091. #define LPTTTOOLINFOW LPTOOLINFOW
  2092. #endif
  2093.  
  2094. #define LPTOOLINFO    LPTTTOOLINFO
  2095. #define TOOLINFO        TTTOOLINFO
  2096.  
  2097. #define TTTOOLINFOA_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA, lpszText)
  2098. #define TTTOOLINFOW_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW, lpszText)
  2099.  
  2100. typedef struct tagTOOLINFOA {
  2101.     UINT cbSize;
  2102.     UINT uFlags;
  2103.     HWND hwnd;
  2104.     UINT_PTR uId;
  2105.     RECT rect;
  2106.     HINSTANCE hinst;
  2107.     LPSTR lpszText;
  2108. #if (_WIN32_IE >= 0x0300)
  2109.     LPARAM lParam;
  2110. #endif
  2111. } TTTOOLINFOA, NEAR *PTOOLINFOA, FAR *LPTTTOOLINFOA;
  2112.  
  2113. typedef struct tagTOOLINFOW {
  2114.     UINT cbSize;
  2115.     UINT uFlags;
  2116.     HWND hwnd;
  2117.     UINT_PTR uId;
  2118.     RECT rect;
  2119.     HINSTANCE hinst;
  2120.     LPWSTR lpszText;
  2121. #if (_WIN32_IE >= 0x0300)
  2122.     LPARAM lParam;
  2123. #endif
  2124. } TTTOOLINFOW, NEAR *PTOOLINFOW, FAR* LPTTTOOLINFOW;
  2125.  
  2126. #ifdef UNICODE
  2127. #define TTTOOLINFO              TTTOOLINFOW
  2128. #define PTOOLINFO               PTOOLINFOW
  2129. #define LPTTTOOLINFO            LPTTTOOLINFOW
  2130. #define TTTOOLINFO_V1_SIZE TTTOOLINFOW_V1_SIZE
  2131. #else
  2132. #define PTOOLINFO               PTOOLINFOA
  2133. #define TTTOOLINFO              TTTOOLINFOA
  2134. #define LPTTTOOLINFO            LPTTTOOLINFOA
  2135. #define TTTOOLINFO_V1_SIZE TTTOOLINFOA_V1_SIZE
  2136. #endif
  2137.  
  2138. // begin_r_commctrl
  2139.  
  2140. #define TTS_ALWAYSTIP           0x01
  2141. #define TTS_NOPREFIX            0x02
  2142. #if (_WIN32_IE >= 0x0500)
  2143. #define TTS_NOANIMATE           0x10
  2144. #define TTS_NOFADE              0x20
  2145. #define TTS_BALLOON             0x40
  2146. #endif
  2147.  
  2148. // end_r_commctrl
  2149.  
  2150. #define TTF_IDISHWND            0x0001
  2151.  
  2152. // Use this to center around trackpoint in trackmode
  2153. // -OR- to center around tool in normal mode.
  2154. // Use TTF_ABSOLUTE to place the tip exactly at the track coords when
  2155. // in tracking mode.  TTF_ABSOLUTE can be used in conjunction with TTF_CENTERTIP
  2156. // to center the tip absolutely about the track point.
  2157.  
  2158. #define TTF_CENTERTIP           0x0002
  2159. #define TTF_RTLREADING          0x0004
  2160. #define TTF_SUBCLASS            0x0010
  2161. #if (_WIN32_IE >= 0x0300)
  2162. #define TTF_TRACK               0x0020
  2163. #define TTF_ABSOLUTE            0x0080
  2164. #define TTF_TRANSPARENT         0x0100
  2165. #define TTF_DI_SETITEM          0x8000       // valid only on the TTN_NEEDTEXT callback
  2166. #endif      // _WIN32_IE >= 0x0300
  2167.  
  2168. #define TTDT_AUTOMATIC          0
  2169. #define TTDT_RESHOW             1
  2170. #define TTDT_AUTOPOP            2
  2171. #define TTDT_INITIAL            3
  2172.  
  2173. // ToolTip Icons (Set with TTM_SETTITLE)
  2174. #define TTI_NONE                0
  2175. #define TTI_INFO                1
  2176. #define TTI_WARNING             2
  2177. #define TTI_ERROR               3
  2178.  
  2179. // Tool Tip Messages
  2180. #define TTM_ACTIVATE            (WM_USER + 1)
  2181. #define TTM_SETDELAYTIME        (WM_USER + 3)
  2182. #define TTM_ADDTOOLA            (WM_USER + 4)
  2183. #define TTM_ADDTOOLW            (WM_USER + 50)
  2184. #define TTM_DELTOOLA            (WM_USER + 5)
  2185. #define TTM_DELTOOLW            (WM_USER + 51)
  2186. #define TTM_NEWTOOLRECTA        (WM_USER + 6)
  2187. #define TTM_NEWTOOLRECTW        (WM_USER + 52)
  2188. #define TTM_RELAYEVENT          (WM_USER + 7)
  2189.  
  2190. #define TTM_GETTOOLINFOA        (WM_USER + 8)
  2191. #define TTM_GETTOOLINFOW        (WM_USER + 53)
  2192.  
  2193. #define TTM_SETTOOLINFOA        (WM_USER + 9)
  2194. #define TTM_SETTOOLINFOW        (WM_USER + 54)
  2195.  
  2196. #define TTM_HITTESTA            (WM_USER +10)
  2197. #define TTM_HITTESTW            (WM_USER +55)
  2198. #define TTM_GETTEXTA            (WM_USER +11)
  2199. #define TTM_GETTEXTW            (WM_USER +56)
  2200. #define TTM_UPDATETIPTEXTA      (WM_USER +12)
  2201. #define TTM_UPDATETIPTEXTW      (WM_USER +57)
  2202. #define TTM_GETTOOLCOUNT        (WM_USER +13)
  2203. #define TTM_ENUMTOOLSA          (WM_USER +14)
  2204. #define TTM_ENUMTOOLSW          (WM_USER +58)
  2205. #define TTM_GETCURRENTTOOLA     (WM_USER + 15)
  2206. #define TTM_GETCURRENTTOOLW     (WM_USER + 59)
  2207. #define TTM_WINDOWFROMPOINT     (WM_USER + 16)
  2208. #if (_WIN32_IE >= 0x0300)
  2209. #define TTM_TRACKACTIVATE       (WM_USER + 17)  // wParam = TRUE/FALSE start end  lparam = LPTOOLINFO
  2210. #define TTM_TRACKPOSITION       (WM_USER + 18)  // lParam = dwPos
  2211. #define TTM_SETTIPBKCOLOR       (WM_USER + 19)
  2212. #define TTM_SETTIPTEXTCOLOR     (WM_USER + 20)
  2213. #define TTM_GETDELAYTIME        (WM_USER + 21)
  2214. #define TTM_GETTIPBKCOLOR       (WM_USER + 22)
  2215. #define TTM_GETTIPTEXTCOLOR     (WM_USER + 23)
  2216. #define TTM_SETMAXTIPWIDTH      (WM_USER + 24)
  2217. #define TTM_GETMAXTIPWIDTH      (WM_USER + 25)
  2218. #define TTM_SETMARGIN           (WM_USER + 26)  // lParam = lprc
  2219. #define TTM_GETMARGIN           (WM_USER + 27)  // lParam = lprc
  2220. #define TTM_POP                 (WM_USER + 28)
  2221. #endif
  2222. #if (_WIN32_IE >= 0x0400)
  2223. #define TTM_UPDATE              (WM_USER + 29)
  2224. #endif
  2225. #if (_WIN32_IE >= 0x0500)
  2226. #define TTM_GETBUBBLESIZE       (WM_USER + 30)
  2227. #define TTM_ADJUSTRECT          (WM_USER + 31)
  2228. #define TTM_SETTITLEA           (WM_USER + 32)  // wParam = TTI_*, lParam = char* szTitle
  2229. #define TTM_SETTITLEW           (WM_USER + 33)  // wParam = TTI_*, lParam = wchar* szTitle
  2230. #endif
  2231.  
  2232.  
  2233. #ifdef UNICODE
  2234. #define TTM_ADDTOOL             TTM_ADDTOOLW
  2235. #define TTM_DELTOOL             TTM_DELTOOLW
  2236. #define TTM_NEWTOOLRECT         TTM_NEWTOOLRECTW
  2237. #define TTM_GETTOOLINFO         TTM_GETTOOLINFOW
  2238. #define TTM_SETTOOLINFO         TTM_SETTOOLINFOW
  2239. #define TTM_HITTEST             TTM_HITTESTW
  2240. #define TTM_GETTEXT             TTM_GETTEXTW
  2241. #define TTM_UPDATETIPTEXT       TTM_UPDATETIPTEXTW
  2242. #define TTM_ENUMTOOLS           TTM_ENUMTOOLSW
  2243. #define TTM_GETCURRENTTOOL      TTM_GETCURRENTTOOLW
  2244. #if (_WIN32_IE >= 0x0500)
  2245. #define TTM_SETTITLE            TTM_SETTITLEW
  2246. #endif
  2247. #else
  2248. #define TTM_ADDTOOL             TTM_ADDTOOLA
  2249. #define TTM_DELTOOL             TTM_DELTOOLA
  2250. #define TTM_NEWTOOLRECT         TTM_NEWTOOLRECTA
  2251. #define TTM_GETTOOLINFO         TTM_GETTOOLINFOA
  2252. #define TTM_SETTOOLINFO         TTM_SETTOOLINFOA
  2253. #define TTM_HITTEST             TTM_HITTESTA
  2254. #define TTM_GETTEXT             TTM_GETTEXTA
  2255. #define TTM_UPDATETIPTEXT       TTM_UPDATETIPTEXTA
  2256. #define TTM_ENUMTOOLS           TTM_ENUMTOOLSA
  2257. #define TTM_GETCURRENTTOOL      TTM_GETCURRENTTOOLA
  2258. #if (_WIN32_IE >= 0x0500)
  2259. #define TTM_SETTITLE            TTM_SETTITLEA
  2260. #endif
  2261. #endif
  2262.  
  2263.  
  2264. #if (_WIN32_IE >= 0x0300)
  2265. #define LPHITTESTINFOW    LPTTHITTESTINFOW
  2266. #define LPHITTESTINFOA    LPTTHITTESTINFOA
  2267. #else
  2268. #define LPTTHITTESTINFOA  LPHITTESTINFOA
  2269. #define LPTTHITTESTINFOW  LPHITTESTINFOW
  2270. #endif
  2271.  
  2272. #define LPHITTESTINFO     LPTTHITTESTINFO
  2273.  
  2274. typedef struct _TT_HITTESTINFOA {
  2275.     HWND hwnd;
  2276.     POINT pt;
  2277.     TTTOOLINFOA ti;
  2278. } TTHITTESTINFOA, FAR * LPTTHITTESTINFOA;
  2279.  
  2280. typedef struct _TT_HITTESTINFOW {
  2281.     HWND hwnd;
  2282.     POINT pt;
  2283.     TTTOOLINFOW ti;
  2284. } TTHITTESTINFOW, FAR * LPTTHITTESTINFOW;
  2285.  
  2286. #ifdef UNICODE
  2287. #define TTHITTESTINFO           TTHITTESTINFOW
  2288. #define LPTTHITTESTINFO         LPTTHITTESTINFOW
  2289. #else
  2290. #define TTHITTESTINFO           TTHITTESTINFOA
  2291. #define LPTTHITTESTINFO         LPTTHITTESTINFOA
  2292. #endif
  2293.  
  2294. #define TTN_GETDISPINFOA        (TTN_FIRST - 0)
  2295. #define TTN_GETDISPINFOW        (TTN_FIRST - 10)
  2296. #define TTN_SHOW                (TTN_FIRST - 1)
  2297. #define TTN_POP                 (TTN_FIRST - 2)
  2298.  
  2299. #ifdef UNICODE
  2300. #define TTN_GETDISPINFO         TTN_GETDISPINFOW
  2301. #else
  2302. #define TTN_GETDISPINFO         TTN_GETDISPINFOA
  2303. #endif
  2304.  
  2305. #define TTN_NEEDTEXT            TTN_GETDISPINFO
  2306. #define TTN_NEEDTEXTA           TTN_GETDISPINFOA
  2307. #define TTN_NEEDTEXTW           TTN_GETDISPINFOW
  2308.  
  2309. #if (_WIN32_IE >= 0x0300)
  2310. #define TOOLTIPTEXTW NMTTDISPINFOW
  2311. #define TOOLTIPTEXTA NMTTDISPINFOA
  2312. #define LPTOOLTIPTEXTA LPNMTTDISPINFOA
  2313. #define LPTOOLTIPTEXTW LPNMTTDISPINFOW
  2314. #else
  2315. #define tagNMTTDISPINFOA  tagTOOLTIPTEXTA
  2316. #define NMTTDISPINFOA     TOOLTIPTEXTA
  2317. #define LPNMTTDISPINFOA   LPTOOLTIPTEXTA
  2318. #define tagNMTTDISPINFOW  tagTOOLTIPTEXTW
  2319. #define NMTTDISPINFOW     TOOLTIPTEXTW
  2320. #define LPNMTTDISPINFOW   LPTOOLTIPTEXTW
  2321. #endif
  2322.  
  2323. #define TOOLTIPTEXT    NMTTDISPINFO
  2324. #define LPTOOLTIPTEXT  LPNMTTDISPINFO
  2325.  
  2326. #define NMTTDISPINFOA_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOA, uFlags)
  2327. #define NMTTDISPINFOW_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOW, uFlags)
  2328.  
  2329. typedef struct tagNMTTDISPINFOA {
  2330.     NMHDR hdr;
  2331.     LPSTR lpszText;
  2332.     char szText[80];
  2333.     HINSTANCE hinst;
  2334.     UINT uFlags;
  2335. #if (_WIN32_IE >= 0x0300)
  2336.     LPARAM lParam;
  2337. #endif
  2338. } NMTTDISPINFOA, FAR *LPNMTTDISPINFOA;
  2339.  
  2340. typedef struct tagNMTTDISPINFOW {
  2341.     NMHDR hdr;
  2342.     LPWSTR lpszText;
  2343.     WCHAR szText[80];
  2344.     HINSTANCE hinst;
  2345.     UINT uFlags;
  2346. #if (_WIN32_IE >= 0x0300)
  2347.     LPARAM lParam;
  2348. #endif
  2349. } NMTTDISPINFOW, FAR *LPNMTTDISPINFOW;
  2350.  
  2351. #ifdef UNICODE
  2352. #define NMTTDISPINFO            NMTTDISPINFOW
  2353. #define LPNMTTDISPINFO          LPNMTTDISPINFOW
  2354. #define NMTTDISPINFO_V1_SIZE NMTTDISPINFOW_V1_SIZE
  2355. #else
  2356. #define NMTTDISPINFO            NMTTDISPINFOA
  2357. #define LPNMTTDISPINFO          LPNMTTDISPINFOA
  2358. #define NMTTDISPINFO_V1_SIZE NMTTDISPINFOA_V1_SIZE
  2359. #endif
  2360.  
  2361. #endif      // NOTOOLTIPS
  2362.  
  2363.  
  2364. //====== STATUS BAR CONTROL ===================================================
  2365.  
  2366. #ifndef NOSTATUSBAR
  2367.  
  2368. // begin_r_commctrl
  2369.  
  2370. #define SBARS_SIZEGRIP          0x0100
  2371. #if (_WIN32_IE >= 0x0500)
  2372. #define SBARS_TOOLTIPS          0x0800
  2373. #endif
  2374.  
  2375. #if (_WIN32_IE >= 0x0400)
  2376. // this is a status bar flag, preference to SBARS_TOOLTIPS
  2377. #define SBT_TOOLTIPS            0x0800
  2378. #endif
  2379.  
  2380. // end_r_commctrl
  2381.  
  2382. WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR pszText, UINT uFlags);
  2383. WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR pszText, UINT uFlags);
  2384.  
  2385. WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID);
  2386. WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID);
  2387.  
  2388. #ifdef UNICODE
  2389. #define CreateStatusWindow      CreateStatusWindowW
  2390. #define DrawStatusText          DrawStatusTextW
  2391. #else
  2392. #define CreateStatusWindow      CreateStatusWindowA
  2393. #define DrawStatusText          DrawStatusTextA
  2394. #endif
  2395.  
  2396. #ifdef _WIN32
  2397. #define STATUSCLASSNAMEW        L"msctls_statusbar32"
  2398. #define STATUSCLASSNAMEA        "msctls_statusbar32"
  2399.  
  2400. #ifdef UNICODE
  2401. #define STATUSCLASSNAME         STATUSCLASSNAMEW
  2402. #else
  2403. #define STATUSCLASSNAME         STATUSCLASSNAMEA
  2404. #endif
  2405.  
  2406. #else
  2407. #define STATUSCLASSNAME         "msctls_statusbar"
  2408. #endif
  2409.  
  2410. #define SB_SETTEXTA             (WM_USER+1)
  2411. #define SB_SETTEXTW             (WM_USER+11)
  2412. #define SB_GETTEXTA             (WM_USER+2)
  2413. #define SB_GETTEXTW             (WM_USER+13)
  2414. #define SB_GETTEXTLENGTHA       (WM_USER+3)
  2415. #define SB_GETTEXTLENGTHW       (WM_USER+12)
  2416.  
  2417. #ifdef UNICODE
  2418. #define SB_GETTEXT              SB_GETTEXTW
  2419. #define SB_SETTEXT              SB_SETTEXTW
  2420. #define SB_GETTEXTLENGTH        SB_GETTEXTLENGTHW
  2421. #if (_WIN32_IE >= 0x0400)
  2422. #define SB_SETTIPTEXT           SB_SETTIPTEXTW
  2423. #define SB_GETTIPTEXT           SB_GETTIPTEXTW
  2424. #endif
  2425. #else
  2426. #define SB_GETTEXT              SB_GETTEXTA
  2427. #define SB_SETTEXT              SB_SETTEXTA
  2428. #define SB_GETTEXTLENGTH        SB_GETTEXTLENGTHA
  2429. #if (_WIN32_IE >= 0x0400)
  2430. #define SB_SETTIPTEXT           SB_SETTIPTEXTA
  2431. #define SB_GETTIPTEXT           SB_GETTIPTEXTA
  2432. #endif
  2433. #endif
  2434.  
  2435.  
  2436. #define SB_SETPARTS             (WM_USER+4)
  2437. #define SB_GETPARTS             (WM_USER+6)
  2438. #define SB_GETBORDERS           (WM_USER+7)
  2439. #define SB_SETMINHEIGHT         (WM_USER+8)
  2440. #define SB_SIMPLE               (WM_USER+9)
  2441. #define SB_GETRECT              (WM_USER+10)
  2442. #if (_WIN32_IE >= 0x0300)
  2443. #define SB_ISSIMPLE             (WM_USER+14)
  2444. #endif
  2445. #if (_WIN32_IE >= 0x0400)
  2446. #define SB_SETICON              (WM_USER+15)
  2447. #define SB_SETTIPTEXTA          (WM_USER+16)
  2448. #define SB_SETTIPTEXTW          (WM_USER+17)
  2449. #define SB_GETTIPTEXTA          (WM_USER+18)
  2450. #define SB_GETTIPTEXTW          (WM_USER+19)
  2451. #define SB_GETICON              (WM_USER+20)
  2452. #define SB_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  2453. #define SB_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  2454. #endif
  2455.  
  2456. #define SBT_OWNERDRAW            0x1000
  2457. #define SBT_NOBORDERS            0x0100
  2458. #define SBT_POPOUT               0x0200
  2459. #define SBT_RTLREADING           0x0400
  2460. #if (_WIN32_IE >= 0x0500)
  2461. #define SBT_NOTABPARSING         0x0800
  2462. #endif
  2463.  
  2464. #define SB_SETBKCOLOR           CCM_SETBKCOLOR      // lParam = bkColor
  2465.  
  2466. /// status bar notifications
  2467. #if (_WIN32_IE >= 0x0400)
  2468. #define SBN_SIMPLEMODECHANGE    (SBN_FIRST - 0)
  2469. #endif
  2470.  
  2471. #if (_WIN32_IE >= 0x0500)
  2472. // refers to the data saved for simple mode
  2473. #define SB_SIMPLEID  0x00ff
  2474. #endif
  2475.  
  2476. #endif      // NOSTATUSBAR
  2477.  
  2478. //====== MENU HELP ============================================================
  2479.  
  2480. #ifndef NOMENUHELP
  2481.  
  2482. WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT FAR *lpwIDs);
  2483. WINCOMMCTRLAPI BOOL WINAPI ShowHideMenuCtl(HWND hWnd, UINT_PTR uFlags, LPINT lpInfo);
  2484. WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo);
  2485.  
  2486. #define MINSYSCOMMAND   SC_SIZE
  2487.  
  2488. #endif
  2489.  
  2490.  
  2491. //====== TRACKBAR CONTROL =====================================================
  2492.  
  2493. #ifndef NOTRACKBAR
  2494.  
  2495. #ifdef _WIN32
  2496.  
  2497. #define TRACKBAR_CLASSA         "msctls_trackbar32"
  2498. #define TRACKBAR_CLASSW         L"msctls_trackbar32"
  2499.  
  2500. #ifdef UNICODE
  2501. #define  TRACKBAR_CLASS         TRACKBAR_CLASSW
  2502. #else
  2503. #define  TRACKBAR_CLASS         TRACKBAR_CLASSA
  2504. #endif
  2505.  
  2506. #else
  2507. #define TRACKBAR_CLASS          "msctls_trackbar"
  2508. #endif
  2509.  
  2510.  
  2511. // begin_r_commctrl
  2512.  
  2513. #define TBS_AUTOTICKS           0x0001
  2514. #define TBS_VERT                0x0002
  2515. #define TBS_HORZ                0x0000
  2516. #define TBS_TOP                 0x0004
  2517. #define TBS_BOTTOM              0x0000
  2518. #define TBS_LEFT                0x0004
  2519. #define TBS_RIGHT               0x0000
  2520. #define TBS_BOTH                0x0008
  2521. #define TBS_NOTICKS             0x0010
  2522. #define TBS_ENABLESELRANGE      0x0020
  2523. #define TBS_FIXEDLENGTH         0x0040
  2524. #define TBS_NOTHUMB             0x0080
  2525. #if (_WIN32_IE >= 0x0300)
  2526. #define TBS_TOOLTIPS            0x0100
  2527. #endif
  2528. #if (_WIN32_IE >= 0x0500)
  2529. #define TBS_REVERSED            0x0200  // Accessibility hint: the smaller number (usually the min value) means "high" and the larger number (usually the max value) means "low"
  2530. #endif
  2531.  
  2532. // end_r_commctrl
  2533.  
  2534. #define TBM_GETPOS              (WM_USER)
  2535. #define TBM_GETRANGEMIN         (WM_USER+1)
  2536. #define TBM_GETRANGEMAX         (WM_USER+2)
  2537. #define TBM_GETTIC              (WM_USER+3)
  2538. #define TBM_SETTIC              (WM_USER+4)
  2539. #define TBM_SETPOS              (WM_USER+5)
  2540. #define TBM_SETRANGE            (WM_USER+6)
  2541. #define TBM_SETRANGEMIN         (WM_USER+7)
  2542. #define TBM_SETRANGEMAX         (WM_USER+8)
  2543. #define TBM_CLEARTICS           (WM_USER+9)
  2544. #define TBM_SETSEL              (WM_USER+10)
  2545. #define TBM_SETSELSTART         (WM_USER+11)
  2546. #define TBM_SETSELEND           (WM_USER+12)
  2547. #define TBM_GETPTICS            (WM_USER+14)
  2548. #define TBM_GETTICPOS           (WM_USER+15)
  2549. #define TBM_GETNUMTICS          (WM_USER+16)
  2550. #define TBM_GETSELSTART         (WM_USER+17)
  2551. #define TBM_GETSELEND           (WM_USER+18)
  2552. #define TBM_CLEARSEL            (WM_USER+19)
  2553. #define TBM_SETTICFREQ          (WM_USER+20)
  2554. #define TBM_SETPAGESIZE         (WM_USER+21)
  2555. #define TBM_GETPAGESIZE         (WM_USER+22)
  2556. #define TBM_SETLINESIZE         (WM_USER+23)
  2557. #define TBM_GETLINESIZE         (WM_USER+24)
  2558. #define TBM_GETTHUMBRECT        (WM_USER+25)
  2559. #define TBM_GETCHANNELRECT      (WM_USER+26)
  2560. #define TBM_SETTHUMBLENGTH      (WM_USER+27)
  2561. #define TBM_GETTHUMBLENGTH      (WM_USER+28)
  2562. #if (_WIN32_IE >= 0x0300)
  2563. #define TBM_SETTOOLTIPS         (WM_USER+29)
  2564. #define TBM_GETTOOLTIPS         (WM_USER+30)
  2565. #define TBM_SETTIPSIDE          (WM_USER+31)
  2566. // TrackBar Tip Side flags
  2567. #define TBTS_TOP                0
  2568. #define TBTS_LEFT               1
  2569. #define TBTS_BOTTOM             2
  2570. #define TBTS_RIGHT              3
  2571.  
  2572. #define TBM_SETBUDDY            (WM_USER+32) // wparam = BOOL fLeft; (or right)
  2573. #define TBM_GETBUDDY            (WM_USER+33) // wparam = BOOL fLeft; (or right)
  2574. #endif
  2575. #if (_WIN32_IE >= 0x0400)
  2576. #define TBM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
  2577. #define TBM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
  2578. #endif
  2579.  
  2580.  
  2581. #define TB_LINEUP               0
  2582. #define TB_LINEDOWN             1
  2583. #define TB_PAGEUP               2
  2584. #define TB_PAGEDOWN             3
  2585. #define TB_THUMBPOSITION        4
  2586. #define TB_THUMBTRACK           5
  2587. #define TB_TOP                  6
  2588. #define TB_BOTTOM               7
  2589. #define TB_ENDTRACK             8
  2590.  
  2591.  
  2592. #if (_WIN32_IE >= 0x0300)
  2593. // custom draw item specs
  2594. #define TBCD_TICS    0x0001
  2595. #define TBCD_THUMB   0x0002
  2596. #define TBCD_CHANNEL 0x0003
  2597. #endif
  2598.  
  2599. #endif // trackbar
  2600.  
  2601. //====== DRAG LIST CONTROL ====================================================
  2602.  
  2603. #ifndef NODRAGLIST
  2604.  
  2605. typedef struct tagDRAGLISTINFO {
  2606.     UINT uNotification;
  2607.     HWND hWnd;
  2608.     POINT ptCursor;
  2609. } DRAGLISTINFO, FAR *LPDRAGLISTINFO;
  2610.  
  2611. #define DL_BEGINDRAG            (WM_USER+133)
  2612. #define DL_DRAGGING             (WM_USER+134)
  2613. #define DL_DROPPED              (WM_USER+135)
  2614. #define DL_CANCELDRAG           (WM_USER+136)
  2615.  
  2616. #define DL_CURSORSET            0
  2617. #define DL_STOPCURSOR           1
  2618. #define DL_COPYCURSOR           2
  2619. #define DL_MOVECURSOR           3
  2620.  
  2621. #define DRAGLISTMSGSTRING       TEXT("commctrl_DragListMsg")
  2622.  
  2623. WINCOMMCTRLAPI BOOL WINAPI MakeDragList(HWND hLB);
  2624. WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent, HWND hLB, int nItem);
  2625. WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB, POINT pt, BOOL bAutoScroll);
  2626.  
  2627. #endif
  2628.  
  2629.  
  2630. //====== UPDOWN CONTROL =======================================================
  2631.  
  2632. #ifndef NOUPDOWN
  2633.  
  2634. #ifdef _WIN32
  2635.  
  2636. #define UPDOWN_CLASSA           "msctls_updown32"
  2637. #define UPDOWN_CLASSW           L"msctls_updown32"
  2638.  
  2639. #ifdef UNICODE
  2640. #define  UPDOWN_CLASS           UPDOWN_CLASSW
  2641. #else
  2642. #define  UPDOWN_CLASS           UPDOWN_CLASSA
  2643. #endif
  2644.  
  2645. #else
  2646. #define UPDOWN_CLASS            "msctls_updown"
  2647. #endif
  2648.  
  2649.  
  2650. typedef struct _UDACCEL {
  2651.     UINT nSec;
  2652.     UINT nInc;
  2653. } UDACCEL, FAR *LPUDACCEL;
  2654.  
  2655. #define UD_MAXVAL               0x7fff
  2656. #define UD_MINVAL               (-UD_MAXVAL)
  2657.  
  2658. // begin_r_commctrl
  2659.  
  2660. #define UDS_WRAP                0x0001
  2661. #define UDS_SETBUDDYINT         0x0002
  2662. #define UDS_ALIGNRIGHT          0x0004
  2663. #define UDS_ALIGNLEFT           0x0008
  2664. #define UDS_AUTOBUDDY           0x0010
  2665. #define UDS_ARROWKEYS           0x0020
  2666. #define UDS_HORZ                0x0040
  2667. #define UDS_NOTHOUSANDS         0x0080
  2668. #if (_WIN32_IE >= 0x0300)
  2669. #define UDS_HOTTRACK            0x0100
  2670. #endif
  2671.  
  2672. // end_r_commctrl
  2673.  
  2674. #define UDM_SETRANGE            (WM_USER+101)
  2675. #define UDM_GETRANGE            (WM_USER+102)
  2676. #define UDM_SETPOS              (WM_USER+103)
  2677. #define UDM_GETPOS              (WM_USER+104)
  2678. #define UDM_SETBUDDY            (WM_USER+105)
  2679. #define UDM_GETBUDDY            (WM_USER+106)
  2680. #define UDM_SETACCEL            (WM_USER+107)
  2681. #define UDM_GETACCEL            (WM_USER+108)
  2682. #define UDM_SETBASE             (WM_USER+109)
  2683. #define UDM_GETBASE             (WM_USER+110)
  2684. #if (_WIN32_IE >= 0x0400)
  2685. #define UDM_SETRANGE32          (WM_USER+111)
  2686. #define UDM_GETRANGE32          (WM_USER+112) // wParam & lParam are LPINT
  2687. #define UDM_SETUNICODEFORMAT    CCM_SETUNICODEFORMAT
  2688. #define UDM_GETUNICODEFORMAT    CCM_GETUNICODEFORMAT
  2689. #endif
  2690. #if (_WIN32_IE >= 0x0500)
  2691. #define UDM_SETPOS32            (WM_USER+113)
  2692. #define UDM_GETPOS32            (WM_USER+114)
  2693. #endif
  2694.  
  2695. WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy,
  2696.                                 HWND hParent, int nID, HINSTANCE hInst,
  2697.                                 HWND hBuddy,
  2698.                                 int nUpper, int nLower, int nPos);
  2699.  
  2700. #if (_WIN32_IE >= 0x0300)
  2701. #define NM_UPDOWN      NMUPDOWN
  2702. #define LPNM_UPDOWN  LPNMUPDOWN
  2703. #else
  2704. #define NMUPDOWN      NM_UPDOWN
  2705. #define LPNMUPDOWN  LPNM_UPDOWN
  2706. #endif
  2707.  
  2708. typedef struct _NM_UPDOWN
  2709. {
  2710.     NMHDR hdr;
  2711.     int iPos;
  2712.     int iDelta;
  2713. } NMUPDOWN, FAR *LPNMUPDOWN;
  2714.  
  2715. #define UDN_DELTAPOS            (UDN_FIRST - 1)
  2716.  
  2717. #endif  // NOUPDOWN
  2718.  
  2719.  
  2720. //====== PROGRESS CONTROL =====================================================
  2721.  
  2722. #ifndef NOPROGRESS
  2723.  
  2724. #ifdef _WIN32
  2725.  
  2726. #define PROGRESS_CLASSA         "msctls_progress32"
  2727. #define PROGRESS_CLASSW         L"msctls_progress32"
  2728.  
  2729. #ifdef UNICODE
  2730. #define  PROGRESS_CLASS         PROGRESS_CLASSW
  2731. #else
  2732. #define  PROGRESS_CLASS         PROGRESS_CLASSA
  2733. #endif
  2734.  
  2735. #else
  2736. #define PROGRESS_CLASS          "msctls_progress"
  2737. #endif
  2738.  
  2739. // begin_r_commctrl
  2740.  
  2741. #if (_WIN32_IE >= 0x0300)
  2742. #define PBS_SMOOTH              0x01
  2743. #define PBS_VERTICAL            0x04
  2744. #endif
  2745.  
  2746. // end_r_commctrl
  2747.  
  2748. #define PBM_SETRANGE            (WM_USER+1)
  2749. #define PBM_SETPOS              (WM_USER+2)
  2750. #define PBM_DELTAPOS            (WM_USER+3)
  2751. #define PBM_SETSTEP             (WM_USER+4)
  2752. #define PBM_STEPIT              (WM_USER+5)
  2753. #if (_WIN32_IE >= 0x0300)
  2754. #define PBM_SETRANGE32          (WM_USER+6)  // lParam = high, wParam = low
  2755. typedef struct
  2756. {
  2757.    int iLow;
  2758.    int iHigh;
  2759. } PBRANGE, *PPBRANGE;
  2760. #define PBM_GETRANGE            (WM_USER+7)  // wParam = return (TRUE ? low : high). lParam = PPBRANGE or NULL
  2761. #define PBM_GETPOS              (WM_USER+8)
  2762. #if (_WIN32_IE >= 0x0400)
  2763. #define PBM_SETBARCOLOR         (WM_USER+9)             // lParam = bar color
  2764. #endif      // _WIN32_IE >= 0x0400
  2765. #define PBM_SETBKCOLOR          CCM_SETBKCOLOR  // lParam = bkColor
  2766. #endif      // _WIN32_IE >= 0x0300
  2767.  
  2768. #endif  // NOPROGRESS
  2769.  
  2770.  
  2771. //====== HOTKEY CONTROL =======================================================
  2772.  
  2773. #ifndef NOHOTKEY
  2774.  
  2775. #define HOTKEYF_SHIFT           0x01
  2776. #define HOTKEYF_CONTROL         0x02
  2777. #define HOTKEYF_ALT             0x04
  2778. #ifdef _MAC
  2779. #define HOTKEYF_EXT             0x80
  2780. #else
  2781. #define HOTKEYF_EXT             0x08
  2782. #endif
  2783.  
  2784. #define HKCOMB_NONE             0x0001
  2785. #define HKCOMB_S                0x0002
  2786. #define HKCOMB_C                0x0004
  2787. #define HKCOMB_A                0x0008
  2788. #define HKCOMB_SC               0x0010
  2789. #define HKCOMB_SA               0x0020
  2790. #define HKCOMB_CA               0x0040
  2791. #define HKCOMB_SCA              0x0080
  2792.  
  2793.  
  2794. #define HKM_SETHOTKEY           (WM_USER+1)
  2795. #define HKM_GETHOTKEY           (WM_USER+2)
  2796. #define HKM_SETRULES            (WM_USER+3)
  2797.  
  2798. #ifdef _WIN32
  2799.  
  2800. #define HOTKEY_CLASSA           "msctls_hotkey32"
  2801. #define HOTKEY_CLASSW           L"msctls_hotkey32"
  2802.  
  2803. #ifdef UNICODE
  2804. #define HOTKEY_CLASS            HOTKEY_CLASSW
  2805. #else
  2806. #define HOTKEY_CLASS            HOTKEY_CLASSA
  2807. #endif
  2808.  
  2809. #else
  2810. #define HOTKEY_CLASS            "msctls_hotkey"
  2811. #endif
  2812.  
  2813. #endif  // NOHOTKEY
  2814.  
  2815. // begin_r_commctrl
  2816.  
  2817. //====== COMMON CONTROL STYLES ================================================
  2818.  
  2819. #define CCS_TOP                 0x00000001L
  2820. #define CCS_NOMOVEY             0x00000002L
  2821. #define CCS_BOTTOM              0x00000003L
  2822. #define CCS_NORESIZE            0x00000004L
  2823. #define CCS_NOPARENTALIGN       0x00000008L
  2824. #define CCS_ADJUSTABLE          0x00000020L
  2825. #define CCS_NODIVIDER           0x00000040L
  2826. #if (_WIN32_IE >= 0x0300)
  2827. #define CCS_VERT                0x00000080L
  2828. #define CCS_LEFT                (CCS_VERT | CCS_TOP)
  2829. #define CCS_RIGHT               (CCS_VERT | CCS_BOTTOM)
  2830. #define CCS_NOMOVEX             (CCS_VERT | CCS_NOMOVEY)
  2831. #endif
  2832.  
  2833. // end_r_commctrl
  2834.  
  2835. //====== LISTVIEW CONTROL =====================================================
  2836.  
  2837. #ifndef NOLISTVIEW
  2838.  
  2839. #ifdef _WIN32
  2840.  
  2841. #define WC_LISTVIEWA            "SysListView32"
  2842. #define WC_LISTVIEWW            L"SysListView32"
  2843.  
  2844. #ifdef UNICODE
  2845. #define WC_LISTVIEW             WC_LISTVIEWW
  2846. #else
  2847. #define WC_LISTVIEW             WC_LISTVIEWA
  2848. #endif
  2849.  
  2850. #else
  2851. #define WC_LISTVIEW             "SysListView"
  2852. #endif
  2853.  
  2854. // begin_r_commctrl
  2855.  
  2856. #define LVS_ICON                0x0000
  2857. #define LVS_REPORT              0x0001
  2858. #define LVS_SMALLICON           0x0002
  2859. #define LVS_LIST                0x0003
  2860. #define LVS_TYPEMASK            0x0003
  2861. #define LVS_SINGLESEL           0x0004
  2862. #define LVS_SHOWSELALWAYS       0x0008
  2863. #define LVS_SORTASCENDING       0x0010
  2864. #define LVS_SORTDESCENDING      0x0020
  2865. #define LVS_SHAREIMAGELISTS     0x0040
  2866. #define LVS_NOLABELWRAP         0x0080
  2867. #define LVS_AUTOARRANGE         0x0100
  2868. #define LVS_EDITLABELS          0x0200
  2869. #if (_WIN32_IE >= 0x0300)
  2870. #define LVS_OWNERDATA           0x1000
  2871. #endif
  2872. #define LVS_NOSCROLL            0x2000
  2873.  
  2874. #define LVS_TYPESTYLEMASK       0xfc00
  2875.  
  2876. #define LVS_ALIGNTOP            0x0000
  2877. #define LVS_ALIGNLEFT           0x0800
  2878. #define LVS_ALIGNMASK           0x0c00
  2879.  
  2880. #define LVS_OWNERDRAWFIXED      0x0400
  2881. #define LVS_NOCOLUMNHEADER      0x4000
  2882. #define LVS_NOSORTHEADER        0x8000
  2883.  
  2884. // end_r_commctrl
  2885.  
  2886. #if (_WIN32_IE >= 0x0400)
  2887. #define LVM_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  2888. #define ListView_SetUnicodeFormat(hwnd, fUnicode)  \
  2889.     (BOOL)SNDMSG((hwnd), LVM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  2890.  
  2891. #define LVM_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  2892. #define ListView_GetUnicodeFormat(hwnd)  \
  2893.     (BOOL)SNDMSG((hwnd), LVM_GETUNICODEFORMAT, 0, 0)
  2894. #endif
  2895.  
  2896. #define LVM_GETBKCOLOR          (LVM_FIRST + 0)
  2897. #define ListView_GetBkColor(hwnd)  \
  2898.     (COLORREF)SNDMSG((hwnd), LVM_GETBKCOLOR, 0, 0L)
  2899.  
  2900. #define LVM_SETBKCOLOR          (LVM_FIRST + 1)
  2901. #define ListView_SetBkColor(hwnd, clrBk) \
  2902.     (BOOL)SNDMSG((hwnd), LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk))
  2903.  
  2904. #define LVM_GETIMAGELIST        (LVM_FIRST + 2)
  2905. #define ListView_GetImageList(hwnd, iImageList) \
  2906.     (HIMAGELIST)SNDMSG((hwnd), LVM_GETIMAGELIST, (WPARAM)(INT)(iImageList), 0L)
  2907.  
  2908. #define LVSIL_NORMAL            0
  2909. #define LVSIL_SMALL             1
  2910. #define LVSIL_STATE             2
  2911.  
  2912. #define LVM_SETIMAGELIST        (LVM_FIRST + 3)
  2913. #define ListView_SetImageList(hwnd, himl, iImageList) \
  2914.     (HIMAGELIST)SNDMSG((hwnd), LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(HIMAGELIST)(himl))
  2915.  
  2916. #define LVM_GETITEMCOUNT        (LVM_FIRST + 4)
  2917. #define ListView_GetItemCount(hwnd) \
  2918.     (int)SNDMSG((hwnd), LVM_GETITEMCOUNT, 0, 0L)
  2919.  
  2920.  
  2921. #define LVIF_TEXT               0x0001
  2922. #define LVIF_IMAGE              0x0002
  2923. #define LVIF_PARAM              0x0004
  2924. #define LVIF_STATE              0x0008
  2925. #if (_WIN32_IE >= 0x0300)
  2926. #define LVIF_INDENT             0x0010
  2927. #define LVIF_NORECOMPUTE        0x0800
  2928. #endif
  2929.  
  2930. #define LVIS_FOCUSED            0x0001
  2931. #define LVIS_SELECTED           0x0002
  2932. #define LVIS_CUT                0x0004
  2933. #define LVIS_DROPHILITED        0x0008
  2934. #define LVIS_ACTIVATING         0x0020
  2935.  
  2936. #define LVIS_OVERLAYMASK        0x0F00
  2937. #define LVIS_STATEIMAGEMASK     0xF000
  2938.  
  2939. #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12)
  2940.  
  2941. #if (_WIN32_IE >= 0x0300)
  2942. #define I_INDENTCALLBACK        (-1)
  2943. #define LV_ITEMA LVITEMA
  2944. #define LV_ITEMW LVITEMW
  2945. #else
  2946. #define tagLVITEMA    _LV_ITEMA
  2947. #define LVITEMA       LV_ITEMA
  2948. #define tagLVITEMW    _LV_ITEMW
  2949. #define LVITEMW       LV_ITEMW
  2950. #endif
  2951.  
  2952. #define LV_ITEM LVITEM
  2953.  
  2954. #define LVITEMA_V1_SIZE CCSIZEOF_STRUCT(LVITEMA, lParam)
  2955. #define LVITEMW_V1_SIZE CCSIZEOF_STRUCT(LVITEMW, lParam)
  2956.  
  2957. typedef struct tagLVITEMA
  2958. {
  2959.     UINT mask;
  2960.     int iItem;
  2961.     int iSubItem;
  2962.     UINT state;
  2963.     UINT stateMask;
  2964.     LPSTR pszText;
  2965.     int cchTextMax;
  2966.     int iImage;
  2967.     LPARAM lParam;
  2968. #if (_WIN32_IE >= 0x0300)
  2969.     int iIndent;
  2970. #endif
  2971. } LVITEMA, FAR* LPLVITEMA;
  2972.  
  2973. typedef struct tagLVITEMW
  2974. {
  2975.     UINT mask;
  2976.     int iItem;
  2977.     int iSubItem;
  2978.     UINT state;
  2979.     UINT stateMask;
  2980.     LPWSTR pszText;
  2981.     int cchTextMax;
  2982.     int iImage;
  2983.     LPARAM lParam;
  2984. #if (_WIN32_IE >= 0x0300)
  2985.     int iIndent;
  2986. #endif
  2987. } LVITEMW, FAR* LPLVITEMW;
  2988.  
  2989.  
  2990. #ifdef UNICODE
  2991. #define LVITEM    LVITEMW
  2992. #define LPLVITEM  LPLVITEMW
  2993. #define LVITEM_V1_SIZE LVITEMW_V1_SIZE
  2994. #else
  2995. #define LVITEM    LVITEMA
  2996. #define LPLVITEM  LPLVITEMA
  2997. #define LVITEM_V1_SIZE LVITEMA_V1_SIZE
  2998. #endif
  2999.  
  3000.  
  3001. #define LPSTR_TEXTCALLBACKW     ((LPWSTR)-1L)
  3002. #define LPSTR_TEXTCALLBACKA     ((LPSTR)-1L)
  3003. #ifdef UNICODE
  3004. #define LPSTR_TEXTCALLBACK      LPSTR_TEXTCALLBACKW
  3005. #else
  3006. #define LPSTR_TEXTCALLBACK      LPSTR_TEXTCALLBACKA
  3007. #endif
  3008.  
  3009. #define I_IMAGECALLBACK         (-1)
  3010. #if (_WIN32_IE >= 0x0501)
  3011. #define I_IMAGENONE             (-2)
  3012. #endif  // 0x0501
  3013.  
  3014. #define LVM_GETITEMA            (LVM_FIRST + 5)
  3015. #define LVM_GETITEMW            (LVM_FIRST + 75)
  3016. #ifdef UNICODE
  3017. #define LVM_GETITEM             LVM_GETITEMW
  3018. #else
  3019. #define LVM_GETITEM             LVM_GETITEMA
  3020. #endif
  3021.  
  3022. #define ListView_GetItem(hwnd, pitem) \
  3023.     (BOOL)SNDMSG((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM FAR*)(pitem))
  3024.  
  3025.  
  3026. #define LVM_SETITEMA            (LVM_FIRST + 6)
  3027. #define LVM_SETITEMW            (LVM_FIRST + 76)
  3028. #ifdef UNICODE
  3029. #define LVM_SETITEM             LVM_SETITEMW
  3030. #else
  3031. #define LVM_SETITEM             LVM_SETITEMA
  3032. #endif
  3033.  
  3034. #define ListView_SetItem(hwnd, pitem) \
  3035.     (BOOL)SNDMSG((hwnd), LVM_SETITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  3036.  
  3037.  
  3038. #define LVM_INSERTITEMA         (LVM_FIRST + 7)
  3039. #define LVM_INSERTITEMW         (LVM_FIRST + 77)
  3040. #ifdef UNICODE
  3041. #define LVM_INSERTITEM          LVM_INSERTITEMW
  3042. #else
  3043. #define LVM_INSERTITEM          LVM_INSERTITEMA
  3044. #endif
  3045. #define ListView_InsertItem(hwnd, pitem)   \
  3046.     (int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  3047.  
  3048.  
  3049. #define LVM_DELETEITEM          (LVM_FIRST + 8)
  3050. #define ListView_DeleteItem(hwnd, i) \
  3051.     (BOOL)SNDMSG((hwnd), LVM_DELETEITEM, (WPARAM)(int)(i), 0L)
  3052.  
  3053.  
  3054. #define LVM_DELETEALLITEMS      (LVM_FIRST + 9)
  3055. #define ListView_DeleteAllItems(hwnd) \
  3056.     (BOOL)SNDMSG((hwnd), LVM_DELETEALLITEMS, 0, 0L)
  3057.  
  3058.  
  3059. #define LVM_GETCALLBACKMASK     (LVM_FIRST + 10)
  3060. #define ListView_GetCallbackMask(hwnd) \
  3061.     (BOOL)SNDMSG((hwnd), LVM_GETCALLBACKMASK, 0, 0)
  3062.  
  3063.  
  3064. #define LVM_SETCALLBACKMASK     (LVM_FIRST + 11)
  3065. #define ListView_SetCallbackMask(hwnd, mask) \
  3066.     (BOOL)SNDMSG((hwnd), LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0)
  3067.  
  3068.  
  3069. #define LVNI_ALL                0x0000
  3070. #define LVNI_FOCUSED            0x0001
  3071. #define LVNI_SELECTED           0x0002
  3072. #define LVNI_CUT                0x0004
  3073. #define LVNI_DROPHILITED        0x0008
  3074.  
  3075. #define LVNI_ABOVE              0x0100
  3076. #define LVNI_BELOW              0x0200
  3077. #define LVNI_TOLEFT             0x0400
  3078. #define LVNI_TORIGHT            0x0800
  3079.  
  3080.  
  3081. #define LVM_GETNEXTITEM         (LVM_FIRST + 12)
  3082. #define ListView_GetNextItem(hwnd, i, flags) \
  3083.     (int)SNDMSG((hwnd), LVM_GETNEXTITEM, (WPARAM)(int)(i), MAKELPARAM((flags), 0))
  3084.  
  3085.  
  3086. #define LVFI_PARAM              0x0001
  3087. #define LVFI_STRING             0x0002
  3088. #define LVFI_PARTIAL            0x0008
  3089. #define LVFI_WRAP               0x0020
  3090. #define LVFI_NEARESTXY          0x0040
  3091.  
  3092. #if (_WIN32_IE >= 0x0300)
  3093. #define LV_FINDINFOA    LVFINDINFOA
  3094. #define LV_FINDINFOW    LVFINDINFOW
  3095. #else
  3096. #define tagLVFINDINFOA  _LV_FINDINFOA
  3097. #define    LVFINDINFOA   LV_FINDINFOA
  3098. #define tagLVFINDINFOW  _LV_FINDINFOW
  3099. #define    LVFINDINFOW   LV_FINDINFOW
  3100. #endif
  3101.  
  3102. #define LV_FINDINFO  LVFINDINFO
  3103.  
  3104. typedef struct tagLVFINDINFOA
  3105. {
  3106.     UINT flags;
  3107.     LPCSTR psz;
  3108.     LPARAM lParam;
  3109.     POINT pt;
  3110.     UINT vkDirection;
  3111. } LVFINDINFOA, FAR* LPFINDINFOA;
  3112.  
  3113. typedef struct tagLVFINDINFOW
  3114. {
  3115.     UINT flags;
  3116.     LPCWSTR psz;
  3117.     LPARAM lParam;
  3118.     POINT pt;
  3119.     UINT vkDirection;
  3120. } LVFINDINFOW, FAR* LPFINDINFOW;
  3121.  
  3122. #ifdef UNICODE
  3123. #define  LVFINDINFO            LVFINDINFOW
  3124. #else
  3125. #define  LVFINDINFO            LVFINDINFOA
  3126. #endif
  3127.  
  3128. #define LVM_FINDITEMA           (LVM_FIRST + 13)
  3129. #define LVM_FINDITEMW           (LVM_FIRST + 83)
  3130. #ifdef UNICODE
  3131. #define  LVM_FINDITEM           LVM_FINDITEMW
  3132. #else
  3133. #define  LVM_FINDITEM           LVM_FINDITEMA
  3134. #endif
  3135.  
  3136. #define ListView_FindItem(hwnd, iStart, plvfi) \
  3137.     (int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
  3138.  
  3139. #define LVIR_BOUNDS             0
  3140. #define LVIR_ICON               1
  3141. #define LVIR_LABEL              2
  3142. #define LVIR_SELECTBOUNDS       3
  3143.  
  3144.  
  3145. #define LVM_GETITEMRECT         (LVM_FIRST + 14)
  3146. #define ListView_GetItemRect(hwnd, i, prc, code) \
  3147.      (BOOL)SNDMSG((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \
  3148.            ((prc) ? (((RECT FAR *)(prc))->left = (code),(LPARAM)(RECT FAR*)(prc)) : (LPARAM)(RECT FAR*)NULL))
  3149.  
  3150.  
  3151. #define LVM_SETITEMPOSITION     (LVM_FIRST + 15)
  3152. #define ListView_SetItemPosition(hwndLV, i, x, y) \
  3153.     (BOOL)SNDMSG((hwndLV), LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y)))
  3154.  
  3155.  
  3156. #define LVM_GETITEMPOSITION     (LVM_FIRST + 16)
  3157. #define ListView_GetItemPosition(hwndLV, i, ppt) \
  3158.     (BOOL)SNDMSG((hwndLV), LVM_GETITEMPOSITION, (WPARAM)(int)(i), (LPARAM)(POINT FAR*)(ppt))
  3159.  
  3160.  
  3161. #define LVM_GETSTRINGWIDTHA     (LVM_FIRST + 17)
  3162. #define LVM_GETSTRINGWIDTHW     (LVM_FIRST + 87)
  3163. #ifdef UNICODE
  3164. #define  LVM_GETSTRINGWIDTH     LVM_GETSTRINGWIDTHW
  3165. #else
  3166. #define  LVM_GETSTRINGWIDTH     LVM_GETSTRINGWIDTHA
  3167. #endif
  3168.  
  3169. #define ListView_GetStringWidth(hwndLV, psz) \
  3170.     (int)SNDMSG((hwndLV), LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)(psz))
  3171.  
  3172.  
  3173. #define LVHT_NOWHERE            0x0001
  3174. #define LVHT_ONITEMICON         0x0002
  3175. #define LVHT_ONITEMLABEL        0x0004
  3176. #define LVHT_ONITEMSTATEICON    0x0008
  3177. #define LVHT_ONITEM             (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
  3178.  
  3179. #define LVHT_ABOVE              0x0008
  3180. #define LVHT_BELOW              0x0010
  3181. #define LVHT_TORIGHT            0x0020
  3182. #define LVHT_TOLEFT             0x0040
  3183.  
  3184. #if (_WIN32_IE >= 0x0300)
  3185. #define LV_HITTESTINFO LVHITTESTINFO
  3186. #else
  3187. #define tagLVHITTESTINFO  _LV_HITTESTINFO
  3188. #define    LVHITTESTINFO   LV_HITTESTINFO
  3189. #endif
  3190.  
  3191. #define LVHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(LVHITTESTINFO, iItem)
  3192.  
  3193. typedef struct tagLVHITTESTINFO
  3194. {
  3195.     POINT pt;
  3196.     UINT flags;
  3197.     int iItem;
  3198. #if (_WIN32_IE >= 0x0300)
  3199.     int iSubItem;    // this is was NOT in win95.  valid only for LVM_SUBITEMHITTEST
  3200. #endif
  3201. } LVHITTESTINFO, FAR* LPLVHITTESTINFO;
  3202.  
  3203. #define LVM_HITTEST             (LVM_FIRST + 18)
  3204. #define ListView_HitTest(hwndLV, pinfo) \
  3205.     (int)SNDMSG((hwndLV), LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO FAR*)(pinfo))
  3206.  
  3207.  
  3208. #define LVM_ENSUREVISIBLE       (LVM_FIRST + 19)
  3209. #define ListView_EnsureVisible(hwndLV, i, fPartialOK) \
  3210.     (BOOL)SNDMSG((hwndLV), LVM_ENSUREVISIBLE, (WPARAM)(int)(i), MAKELPARAM((fPartialOK), 0))
  3211.  
  3212.  
  3213. #define LVM_SCROLL              (LVM_FIRST + 20)
  3214. #define ListView_Scroll(hwndLV, dx, dy) \
  3215.     (BOOL)SNDMSG((hwndLV), LVM_SCROLL, (WPARAM)(int)(dx), (LPARAM)(int)(dy))
  3216.  
  3217.  
  3218. #define LVM_REDRAWITEMS         (LVM_FIRST + 21)
  3219. #define ListView_RedrawItems(hwndLV, iFirst, iLast) \
  3220.     (BOOL)SNDMSG((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)(iFirst), (LPARAM)(int)(iLast))
  3221.  
  3222.  
  3223. #define LVA_DEFAULT             0x0000
  3224. #define LVA_ALIGNLEFT           0x0001
  3225. #define LVA_ALIGNTOP            0x0002
  3226. #define LVA_SNAPTOGRID          0x0005
  3227.  
  3228. #define LVM_ARRANGE             (LVM_FIRST + 22)
  3229. #define ListView_Arrange(hwndLV, code) \
  3230.     (BOOL)SNDMSG((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0L)
  3231.  
  3232.  
  3233. #define LVM_EDITLABELA          (LVM_FIRST + 23)
  3234. #define LVM_EDITLABELW          (LVM_FIRST + 118)
  3235. #ifdef UNICODE
  3236. #define LVM_EDITLABEL           LVM_EDITLABELW
  3237. #else
  3238. #define LVM_EDITLABEL           LVM_EDITLABELA
  3239. #endif
  3240.  
  3241. #define ListView_EditLabel(hwndLV, i) \
  3242.     (HWND)SNDMSG((hwndLV), LVM_EDITLABEL, (WPARAM)(int)(i), 0L)
  3243.  
  3244.  
  3245. #define LVM_GETEDITCONTROL      (LVM_FIRST + 24)
  3246. #define ListView_GetEditControl(hwndLV) \
  3247.     (HWND)SNDMSG((hwndLV), LVM_GETEDITCONTROL, 0, 0L)
  3248.  
  3249.  
  3250. #if (_WIN32_IE >= 0x0300)
  3251. #define LV_COLUMNA      LVCOLUMNA
  3252. #define LV_COLUMNW      LVCOLUMNW
  3253. #else
  3254. #define tagLVCOLUMNA    _LV_COLUMNA
  3255. #define    LVCOLUMNA     LV_COLUMNA
  3256. #define tagLVCOLUMNW    _LV_COLUMNW
  3257. #define    LVCOLUMNW     LV_COLUMNW
  3258. #endif
  3259.  
  3260. #define LV_COLUMN       LVCOLUMN
  3261.  
  3262. #define LVCOLUMNA_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNA, iSubItem)
  3263. #define LVCOLUMNW_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNW, iSubItem)
  3264.  
  3265. typedef struct tagLVCOLUMNA
  3266. {
  3267.     UINT mask;
  3268.     int fmt;
  3269.     int cx;
  3270.     LPSTR pszText;
  3271.     int cchTextMax;
  3272.     int iSubItem;
  3273. #if (_WIN32_IE >= 0x0300)
  3274.     int iImage;
  3275.     int iOrder;
  3276. #endif
  3277. } LVCOLUMNA, FAR* LPLVCOLUMNA;
  3278.  
  3279. typedef struct tagLVCOLUMNW
  3280. {
  3281.     UINT mask;
  3282.     int fmt;
  3283.     int cx;
  3284.     LPWSTR pszText;
  3285.     int cchTextMax;
  3286.     int iSubItem;
  3287. #if (_WIN32_IE >= 0x0300)
  3288.     int iImage;
  3289.     int iOrder;
  3290. #endif
  3291. } LVCOLUMNW, FAR* LPLVCOLUMNW;
  3292.  
  3293. #ifdef UNICODE
  3294. #define  LVCOLUMN               LVCOLUMNW
  3295. #define  LPLVCOLUMN             LPLVCOLUMNW
  3296. #define LVCOLUMN_V1_SIZE LVCOLUMNW_V1_SIZE
  3297. #else
  3298. #define  LVCOLUMN               LVCOLUMNA
  3299. #define  LPLVCOLUMN             LPLVCOLUMNA
  3300. #define LVCOLUMN_V1_SIZE LVCOLUMNA_V1_SIZE
  3301. #endif
  3302.  
  3303.  
  3304. #define LVCF_FMT                0x0001
  3305. #define LVCF_WIDTH              0x0002
  3306. #define LVCF_TEXT               0x0004
  3307. #define LVCF_SUBITEM            0x0008
  3308. #if (_WIN32_IE >= 0x0300)
  3309. #define LVCF_IMAGE              0x0010
  3310. #define LVCF_ORDER              0x0020
  3311. #endif
  3312.  
  3313. #define LVCFMT_LEFT             0x0000
  3314. #define LVCFMT_RIGHT            0x0001
  3315. #define LVCFMT_CENTER           0x0002
  3316. #define LVCFMT_JUSTIFYMASK      0x0003
  3317.  
  3318. #if (_WIN32_IE >= 0x0300)
  3319. #define LVCFMT_IMAGE            0x0800
  3320. #define LVCFMT_BITMAP_ON_RIGHT  0x1000
  3321. #define LVCFMT_COL_HAS_IMAGES   0x8000
  3322. #endif
  3323.  
  3324. #define LVM_GETCOLUMNA          (LVM_FIRST + 25)
  3325. #define LVM_GETCOLUMNW          (LVM_FIRST + 95)
  3326. #ifdef UNICODE
  3327. #define  LVM_GETCOLUMN          LVM_GETCOLUMNW
  3328. #else
  3329. #define  LVM_GETCOLUMN          LVM_GETCOLUMNA
  3330. #endif
  3331.  
  3332. #define ListView_GetColumn(hwnd, iCol, pcol) \
  3333.     (BOOL)SNDMSG((hwnd), LVM_GETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(LV_COLUMN FAR*)(pcol))
  3334.  
  3335.  
  3336. #define LVM_SETCOLUMNA          (LVM_FIRST + 26)
  3337. #define LVM_SETCOLUMNW          (LVM_FIRST + 96)
  3338. #ifdef UNICODE
  3339. #define  LVM_SETCOLUMN          LVM_SETCOLUMNW
  3340. #else
  3341. #define  LVM_SETCOLUMN          LVM_SETCOLUMNA
  3342. #endif
  3343.  
  3344. #define ListView_SetColumn(hwnd, iCol, pcol) \
  3345.     (BOOL)SNDMSG((hwnd), LVM_SETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  3346.  
  3347.  
  3348. #define LVM_INSERTCOLUMNA       (LVM_FIRST + 27)
  3349. #define LVM_INSERTCOLUMNW       (LVM_FIRST + 97)
  3350. #ifdef UNICODE
  3351. #   define  LVM_INSERTCOLUMN    LVM_INSERTCOLUMNW
  3352. #else
  3353. #   define  LVM_INSERTCOLUMN    LVM_INSERTCOLUMNA
  3354. #endif
  3355.  
  3356. #define ListView_InsertColumn(hwnd, iCol, pcol) \
  3357.     (int)SNDMSG((hwnd), LVM_INSERTCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  3358.  
  3359.  
  3360. #define LVM_DELETECOLUMN        (LVM_FIRST + 28)
  3361. #define ListView_DeleteColumn(hwnd, iCol) \
  3362.     (BOOL)SNDMSG((hwnd), LVM_DELETECOLUMN, (WPARAM)(int)(iCol), 0)
  3363.  
  3364.  
  3365. #define LVM_GETCOLUMNWIDTH      (LVM_FIRST + 29)
  3366. #define ListView_GetColumnWidth(hwnd, iCol) \
  3367.     (int)SNDMSG((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0)
  3368.  
  3369.  
  3370. #define LVSCW_AUTOSIZE              -1
  3371. #define LVSCW_AUTOSIZE_USEHEADER    -2
  3372. #define LVM_SETCOLUMNWIDTH          (LVM_FIRST + 30)
  3373.  
  3374. #define ListView_SetColumnWidth(hwnd, iCol, cx) \
  3375.     (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0))
  3376.  
  3377. #if (_WIN32_IE >= 0x0300)
  3378. #define LVM_GETHEADER               (LVM_FIRST + 31)
  3379. #define ListView_GetHeader(hwnd)\
  3380.     (HWND)SNDMSG((hwnd), LVM_GETHEADER, 0, 0L)
  3381. #endif
  3382.  
  3383. #define LVM_CREATEDRAGIMAGE     (LVM_FIRST + 33)
  3384. #define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \
  3385.     (HIMAGELIST)SNDMSG((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft))
  3386.  
  3387.  
  3388. #define LVM_GETVIEWRECT         (LVM_FIRST + 34)
  3389. #define ListView_GetViewRect(hwnd, prc) \
  3390.     (BOOL)SNDMSG((hwnd), LVM_GETVIEWRECT, 0, (LPARAM)(RECT FAR*)(prc))
  3391.  
  3392.  
  3393. #define LVM_GETTEXTCOLOR        (LVM_FIRST + 35)
  3394. #define ListView_GetTextColor(hwnd)  \
  3395.     (COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0L)
  3396.  
  3397.  
  3398. #define LVM_SETTEXTCOLOR        (LVM_FIRST + 36)
  3399. #define ListView_SetTextColor(hwnd, clrText) \
  3400.     (BOOL)SNDMSG((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText))
  3401.  
  3402.  
  3403. #define LVM_GETTEXTBKCOLOR      (LVM_FIRST + 37)
  3404. #define ListView_GetTextBkColor(hwnd)  \
  3405.     (COLORREF)SNDMSG((hwnd), LVM_GETTEXTBKCOLOR, 0, 0L)
  3406.  
  3407.  
  3408. #define LVM_SETTEXTBKCOLOR      (LVM_FIRST + 38)
  3409. #define ListView_SetTextBkColor(hwnd, clrTextBk) \
  3410.     (BOOL)SNDMSG((hwnd), LVM_SETTEXTBKCOLOR, 0, (LPARAM)(COLORREF)(clrTextBk))
  3411.  
  3412.  
  3413. #define LVM_GETTOPINDEX         (LVM_FIRST + 39)
  3414. #define ListView_GetTopIndex(hwndLV) \
  3415.     (int)SNDMSG((hwndLV), LVM_GETTOPINDEX, 0, 0)
  3416.  
  3417.  
  3418. #define LVM_GETCOUNTPERPAGE     (LVM_FIRST + 40)
  3419. #define ListView_GetCountPerPage(hwndLV) \
  3420.     (int)SNDMSG((hwndLV), LVM_GETCOUNTPERPAGE, 0, 0)
  3421.  
  3422.  
  3423. #define LVM_GETORIGIN           (LVM_FIRST + 41)
  3424. #define ListView_GetOrigin(hwndLV, ppt) \
  3425.     (BOOL)SNDMSG((hwndLV), LVM_GETORIGIN, (WPARAM)0, (LPARAM)(POINT FAR*)(ppt))
  3426.  
  3427.  
  3428. #define LVM_UPDATE              (LVM_FIRST + 42)
  3429. #define ListView_Update(hwndLV, i) \
  3430.     (BOOL)SNDMSG((hwndLV), LVM_UPDATE, (WPARAM)(i), 0L)
  3431.  
  3432.  
  3433. #define LVM_SETITEMSTATE        (LVM_FIRST + 43)
  3434. #define ListView_SetItemState(hwndLV, i, data, mask) \
  3435. { LV_ITEM _ms_lvi;\
  3436.   _ms_lvi.stateMask = mask;\
  3437.   _ms_lvi.state = data;\
  3438.   SNDMSG((hwndLV), LVM_SETITEMSTATE, (WPARAM)(i), (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  3439. }
  3440.  
  3441. #if (_WIN32_IE >= 0x0300)
  3442. #define ListView_SetCheckState(hwndLV, i, fCheck) \
  3443.   ListView_SetItemState(hwndLV, i, INDEXTOSTATEIMAGEMASK((fCheck)?2:1), LVIS_STATEIMAGEMASK)
  3444. #endif
  3445.  
  3446. #define LVM_GETITEMSTATE        (LVM_FIRST + 44)
  3447. #define ListView_GetItemState(hwndLV, i, mask) \
  3448.    (UINT)SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)(i), (LPARAM)(mask))
  3449.  
  3450. #if (_WIN32_IE >= 0x0300)
  3451. #define ListView_GetCheckState(hwndLV, i) \
  3452.    ((((UINT)(SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)(i), LVIS_STATEIMAGEMASK))) >> 12) -1)
  3453. #endif
  3454.  
  3455. #define LVM_GETITEMTEXTA        (LVM_FIRST + 45)
  3456. #define LVM_GETITEMTEXTW        (LVM_FIRST + 115)
  3457.  
  3458. #ifdef UNICODE
  3459. #define  LVM_GETITEMTEXT        LVM_GETITEMTEXTW
  3460. #else
  3461. #define  LVM_GETITEMTEXT        LVM_GETITEMTEXTA
  3462. #endif
  3463.  
  3464. #define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
  3465. { LV_ITEM _ms_lvi;\
  3466.   _ms_lvi.iSubItem = iSubItem_;\
  3467.   _ms_lvi.cchTextMax = cchTextMax_;\
  3468.   _ms_lvi.pszText = pszText_;\
  3469.   SNDMSG((hwndLV), LVM_GETITEMTEXT, (WPARAM)(i), (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  3470. }
  3471.  
  3472.  
  3473. #define LVM_SETITEMTEXTA        (LVM_FIRST + 46)
  3474. #define LVM_SETITEMTEXTW        (LVM_FIRST + 116)
  3475.  
  3476. #ifdef UNICODE
  3477. #define  LVM_SETITEMTEXT        LVM_SETITEMTEXTW
  3478. #else
  3479. #define  LVM_SETITEMTEXT        LVM_SETITEMTEXTA
  3480. #endif
  3481.  
  3482. #define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) \
  3483. { LV_ITEM _ms_lvi;\
  3484.   _ms_lvi.iSubItem = iSubItem_;\
  3485.   _ms_lvi.pszText = pszText_;\
  3486.   SNDMSG((hwndLV), LVM_SETITEMTEXT, (WPARAM)(i), (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  3487. }
  3488.  
  3489. #if (_WIN32_IE >= 0x0300)
  3490. // these flags only apply to LVS_OWNERDATA listviews in report or list mode
  3491. #define LVSICF_NOINVALIDATEALL  0x00000001
  3492. #define LVSICF_NOSCROLL         0x00000002
  3493. #endif
  3494.  
  3495. #define LVM_SETITEMCOUNT        (LVM_FIRST + 47)
  3496. #define ListView_SetItemCount(hwndLV, cItems) \
  3497.   SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)(cItems), 0)
  3498.  
  3499. #if (_WIN32_IE >= 0x0300)
  3500. #define ListView_SetItemCountEx(hwndLV, cItems, dwFlags) \
  3501.   SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)(cItems), (LPARAM)(dwFlags))
  3502. #endif
  3503.  
  3504. typedef int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
  3505.  
  3506.  
  3507. #define LVM_SORTITEMS           (LVM_FIRST + 48)
  3508. #define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) \
  3509.   (BOOL)SNDMSG((hwndLV), LVM_SORTITEMS, (WPARAM)(LPARAM)(_lPrm), \
  3510.   (LPARAM)(PFNLVCOMPARE)(_pfnCompare))
  3511.  
  3512.  
  3513. #define LVM_SETITEMPOSITION32   (LVM_FIRST + 49)
  3514. #define ListView_SetItemPosition32(hwndLV, i, x0, y0) \
  3515. {   POINT ptNewPos; \
  3516.     ptNewPos.x = x0; ptNewPos.y = y0; \
  3517.     SNDMSG((hwndLV), LVM_SETITEMPOSITION32, (WPARAM)(int)(i), (LPARAM)&ptNewPos); \
  3518. }
  3519.  
  3520.  
  3521. #define LVM_GETSELECTEDCOUNT    (LVM_FIRST + 50)
  3522. #define ListView_GetSelectedCount(hwndLV) \
  3523.     (UINT)SNDMSG((hwndLV), LVM_GETSELECTEDCOUNT, 0, 0L)
  3524.  
  3525.  
  3526. #define LVM_GETITEMSPACING      (LVM_FIRST + 51)
  3527. #define ListView_GetItemSpacing(hwndLV, fSmall) \
  3528.         (DWORD)SNDMSG((hwndLV), LVM_GETITEMSPACING, fSmall, 0L)
  3529.  
  3530.  
  3531. #define LVM_GETISEARCHSTRINGA   (LVM_FIRST + 52)
  3532. #define LVM_GETISEARCHSTRINGW   (LVM_FIRST + 117)
  3533.  
  3534. #ifdef UNICODE
  3535. #define LVM_GETISEARCHSTRING    LVM_GETISEARCHSTRINGW
  3536. #else
  3537. #define LVM_GETISEARCHSTRING    LVM_GETISEARCHSTRINGA
  3538. #endif
  3539.  
  3540. #define ListView_GetISearchString(hwndLV, lpsz) \
  3541.         (BOOL)SNDMSG((hwndLV), LVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)(lpsz))
  3542.  
  3543. #if (_WIN32_IE >= 0x0300)
  3544. #define LVM_SETICONSPACING      (LVM_FIRST + 53)
  3545. // -1 for cx and cy means we'll use the default (system settings)
  3546. // 0 for cx or cy means use the current setting (allows you to change just one param)
  3547. #define ListView_SetIconSpacing(hwndLV, cx, cy) \
  3548.         (DWORD)SNDMSG((hwndLV), LVM_SETICONSPACING, 0, MAKELONG(cx,cy))
  3549.  
  3550.  
  3551. #define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 54)   // optional wParam == mask
  3552. #define ListView_SetExtendedListViewStyle(hwndLV, dw)\
  3553.         (DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw)
  3554. #if (_WIN32_IE >= 0x0400)
  3555. #define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)\
  3556.         (DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, dwMask, dw)
  3557. #endif
  3558.  
  3559. #define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 55)
  3560. #define ListView_GetExtendedListViewStyle(hwndLV)\
  3561.         (DWORD)SNDMSG((hwndLV), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
  3562.  
  3563. #define LVS_EX_GRIDLINES        0x00000001
  3564. #define LVS_EX_SUBITEMIMAGES    0x00000002
  3565. #define LVS_EX_CHECKBOXES       0x00000004
  3566. #define LVS_EX_TRACKSELECT      0x00000008
  3567. #define LVS_EX_HEADERDRAGDROP   0x00000010
  3568. #define LVS_EX_FULLROWSELECT    0x00000020 // applies to report mode only
  3569. #define LVS_EX_ONECLICKACTIVATE 0x00000040
  3570. #define LVS_EX_TWOCLICKACTIVATE 0x00000080
  3571. #if (_WIN32_IE >= 0x0400)
  3572. #define LVS_EX_FLATSB           0x00000100
  3573. #define LVS_EX_REGIONAL         0x00000200
  3574. #define LVS_EX_INFOTIP          0x00000400 // listview does InfoTips for you
  3575. #define LVS_EX_UNDERLINEHOT     0x00000800
  3576. #define LVS_EX_UNDERLINECOLD    0x00001000
  3577. #define LVS_EX_MULTIWORKAREAS   0x00002000
  3578. #endif
  3579.  
  3580. #if (_WIN32_IE >= 0x0500)
  3581. #define LVS_EX_LABELTIP         0x00004000 // listview unfolds partly hidden labels if it does not have infotip text
  3582. #endif  // End (_WIN32_IE >= 0x0500)
  3583.  
  3584. #define LVM_GETSUBITEMRECT      (LVM_FIRST + 56)
  3585. #define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
  3586.         (BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
  3587.                 ((prc) ? ((((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))
  3588.  
  3589. #define LVM_SUBITEMHITTEST      (LVM_FIRST + 57)
  3590. #define ListView_SubItemHitTest(hwnd, plvhti) \
  3591.         (int)SNDMSG((hwnd), LVM_SUBITEMHITTEST, 0, (LPARAM)(LPLVHITTESTINFO)(plvhti))
  3592.  
  3593. #define LVM_SETCOLUMNORDERARRAY (LVM_FIRST + 58)
  3594. #define ListView_SetColumnOrderArray(hwnd, iCount, pi) \
  3595.         (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNORDERARRAY, (WPARAM)(iCount), (LPARAM)(LPINT)(pi))
  3596.  
  3597. #define LVM_GETCOLUMNORDERARRAY (LVM_FIRST + 59)
  3598. #define ListView_GetColumnOrderArray(hwnd, iCount, pi) \
  3599.         (BOOL)SNDMSG((hwnd), LVM_GETCOLUMNORDERARRAY, (WPARAM)(iCount), (LPARAM)(LPINT)(pi))
  3600.  
  3601. #define LVM_SETHOTITEM  (LVM_FIRST + 60)
  3602. #define ListView_SetHotItem(hwnd, i) \
  3603.         (int)SNDMSG((hwnd), LVM_SETHOTITEM, (WPARAM)(i), 0)
  3604.  
  3605. #define LVM_GETHOTITEM  (LVM_FIRST + 61)
  3606. #define ListView_GetHotItem(hwnd) \
  3607.         (int)SNDMSG((hwnd), LVM_GETHOTITEM, 0, 0)
  3608.  
  3609. #define LVM_SETHOTCURSOR  (LVM_FIRST + 62)
  3610. #define ListView_SetHotCursor(hwnd, hcur) \
  3611.         (HCURSOR)SNDMSG((hwnd), LVM_SETHOTCURSOR, 0, (LPARAM)(hcur))
  3612.  
  3613. #define LVM_GETHOTCURSOR  (LVM_FIRST + 63)
  3614. #define ListView_GetHotCursor(hwnd) \
  3615.         (HCURSOR)SNDMSG((hwnd), LVM_GETHOTCURSOR, 0, 0)
  3616.  
  3617. #define LVM_APPROXIMATEVIEWRECT (LVM_FIRST + 64)
  3618. #define ListView_ApproximateViewRect(hwnd, iWidth, iHeight, iCount) \
  3619.         (DWORD)SNDMSG((hwnd), LVM_APPROXIMATEVIEWRECT, iCount, MAKELPARAM(iWidth, iHeight))
  3620. #endif      // _WIN32_IE >= 0x0300
  3621.  
  3622. #if (_WIN32_IE >= 0x0400)
  3623.  
  3624. #define LV_MAX_WORKAREAS         16
  3625. #define LVM_SETWORKAREAS         (LVM_FIRST + 65)
  3626. #define ListView_SetWorkAreas(hwnd, nWorkAreas, prc) \
  3627.     (BOOL)SNDMSG((hwnd), LVM_SETWORKAREAS, (WPARAM)(int)(nWorkAreas), (LPARAM)(RECT FAR*)(prc))
  3628.  
  3629. #define LVM_GETWORKAREAS        (LVM_FIRST + 70)
  3630. #define ListView_GetWorkAreas(hwnd, nWorkAreas, prc) \
  3631.     (BOOL)SNDMSG((hwnd), LVM_GETWORKAREAS, (WPARAM)(int)(nWorkAreas), (LPARAM)(RECT FAR*)(prc))
  3632.  
  3633.  
  3634. #define LVM_GETNUMBEROFWORKAREAS  (LVM_FIRST + 73)
  3635. #define ListView_GetNumberOfWorkAreas(hwnd, pnWorkAreas) \
  3636.     (BOOL)SNDMSG((hwnd), LVM_GETNUMBEROFWORKAREAS, 0, (LPARAM)(UINT *)(pnWorkAreas))
  3637.  
  3638.  
  3639. #define LVM_GETSELECTIONMARK    (LVM_FIRST + 66)
  3640. #define ListView_GetSelectionMark(hwnd) \
  3641.     (int)SNDMSG((hwnd), LVM_GETSELECTIONMARK, 0, 0)
  3642.  
  3643. #define LVM_SETSELECTIONMARK    (LVM_FIRST + 67)
  3644. #define ListView_SetSelectionMark(hwnd, i) \
  3645.     (int)SNDMSG((hwnd), LVM_SETSELECTIONMARK, 0, (LPARAM)(i))
  3646.  
  3647. #define LVM_SETHOVERTIME        (LVM_FIRST + 71)
  3648. #define ListView_SetHoverTime(hwndLV, dwHoverTimeMs)\
  3649.         (DWORD)SNDMSG((hwndLV), LVM_SETHOVERTIME, 0, (LPARAM)(dwHoverTimeMs))
  3650.  
  3651. #define LVM_GETHOVERTIME        (LVM_FIRST + 72)
  3652. #define ListView_GetHoverTime(hwndLV)\
  3653.         (DWORD)SNDMSG((hwndLV), LVM_GETHOVERTIME, 0, 0)
  3654.  
  3655. #define LVM_SETTOOLTIPS       (LVM_FIRST + 74)
  3656. #define ListView_SetToolTips(hwndLV, hwndNewHwnd)\
  3657.         (HWND)SNDMSG((hwndLV), LVM_SETTOOLTIPS, (WPARAM)(hwndNewHwnd), 0)
  3658.  
  3659. #define LVM_GETTOOLTIPS       (LVM_FIRST + 78)
  3660. #define ListView_GetToolTips(hwndLV)\
  3661.         (HWND)SNDMSG((hwndLV), LVM_GETTOOLTIPS, 0, 0)
  3662.  
  3663.  
  3664. #define LVM_SORTITEMSEX          (LVM_FIRST + 81)
  3665. #define ListView_SortItemsEx(hwndLV, _pfnCompare, _lPrm) \
  3666.   (BOOL)SNDMSG((hwndLV), LVM_SORTITEMSEX, (WPARAM)(LPARAM)(_lPrm), (LPARAM)(PFNLVCOMPARE)(_pfnCompare))
  3667.  
  3668. typedef struct tagLVBKIMAGEA
  3669. {
  3670.     ULONG ulFlags;              // LVBKIF_*
  3671.     HBITMAP hbm;
  3672.     LPSTR pszImage;
  3673.     UINT cchImageMax;
  3674.     int xOffsetPercent;
  3675.     int yOffsetPercent;
  3676. } LVBKIMAGEA, FAR *LPLVBKIMAGEA;
  3677. typedef struct tagLVBKIMAGEW
  3678. {
  3679.     ULONG ulFlags;              // LVBKIF_*
  3680.     HBITMAP hbm;
  3681.     LPWSTR pszImage;
  3682.     UINT cchImageMax;
  3683.     int xOffsetPercent;
  3684.     int yOffsetPercent;
  3685. } LVBKIMAGEW, FAR *LPLVBKIMAGEW;
  3686.  
  3687. #define LVBKIF_SOURCE_NONE      0x00000000
  3688. #define LVBKIF_SOURCE_HBITMAP   0x00000001
  3689. #define LVBKIF_SOURCE_URL       0x00000002
  3690. #define LVBKIF_SOURCE_MASK      0x00000003
  3691. #define LVBKIF_STYLE_NORMAL     0x00000000
  3692. #define LVBKIF_STYLE_TILE       0x00000010
  3693. #define LVBKIF_STYLE_MASK       0x00000010
  3694.  
  3695. #define LVM_SETBKIMAGEA         (LVM_FIRST + 68)
  3696. #define LVM_SETBKIMAGEW         (LVM_FIRST + 138)
  3697. #define LVM_GETBKIMAGEA         (LVM_FIRST + 69)
  3698. #define LVM_GETBKIMAGEW         (LVM_FIRST + 139)
  3699.  
  3700. #ifdef UNICODE
  3701. #define LVBKIMAGE               LVBKIMAGEW
  3702. #define LPLVBKIMAGE             LPLVBKIMAGEW
  3703. #define LVM_SETBKIMAGE          LVM_SETBKIMAGEW
  3704. #define LVM_GETBKIMAGE          LVM_GETBKIMAGEW
  3705. #else
  3706. #define LVBKIMAGE               LVBKIMAGEA
  3707. #define LPLVBKIMAGE             LPLVBKIMAGEA
  3708. #define LVM_SETBKIMAGE          LVM_SETBKIMAGEA
  3709. #define LVM_GETBKIMAGE          LVM_GETBKIMAGEA
  3710. #endif
  3711.  
  3712.  
  3713. #define ListView_SetBkImage(hwnd, plvbki) \
  3714.     (BOOL)SNDMSG((hwnd), LVM_SETBKIMAGE, 0, (LPARAM)(plvbki))
  3715.  
  3716. #define ListView_GetBkImage(hwnd, plvbki) \
  3717.     (BOOL)SNDMSG((hwnd), LVM_GETBKIMAGE, 0, (LPARAM)(plvbki))
  3718.  
  3719.  
  3720. #endif      // _WIN32_IE >= 0x0400
  3721.  
  3722. #if (_WIN32_IE >= 0x0300)
  3723. #define LPNM_LISTVIEW   LPNMLISTVIEW
  3724. #define NM_LISTVIEW     NMLISTVIEW
  3725. #else
  3726. #define tagNMLISTVIEW   _NM_LISTVIEW
  3727. #define    NMLISTVIEW    NM_LISTVIEW
  3728. #define  LPNMLISTVIEW  LPNM_LISTVIEW
  3729. #endif
  3730.  
  3731. typedef struct tagNMLISTVIEW
  3732. {
  3733.     NMHDR   hdr;
  3734.     int     iItem;
  3735.     int     iSubItem;
  3736.     UINT    uNewState;
  3737.     UINT    uOldState;
  3738.     UINT    uChanged;
  3739.     POINT   ptAction;
  3740.     LPARAM  lParam;
  3741. } NMLISTVIEW, FAR *LPNMLISTVIEW;
  3742.  
  3743.  
  3744. #if (_WIN32_IE >= 0x400)
  3745. // NMITEMACTIVATE is used instead of NMLISTVIEW in IE >= 0x400
  3746. // therefore all the fields are the same except for extra uKeyFlags
  3747. // they are used to store key flags at the time of the single click with
  3748. // delayed activation - because by the time the timer goes off a user may
  3749. // not hold the keys (shift, ctrl) any more
  3750. typedef struct tagNMITEMACTIVATE
  3751. {
  3752.     NMHDR   hdr;
  3753.     int     iItem;
  3754.     int     iSubItem;
  3755.     UINT    uNewState;
  3756.     UINT    uOldState;
  3757.     UINT    uChanged;
  3758.     POINT   ptAction;
  3759.     LPARAM  lParam;
  3760.     UINT    uKeyFlags;
  3761. } NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;
  3762.  
  3763. // key flags stored in uKeyFlags
  3764. #define LVKF_ALT       0x0001
  3765. #define LVKF_CONTROL   0x0002
  3766. #define LVKF_SHIFT     0x0004
  3767. #endif //(_WIN32_IE >= 0x0400)
  3768.  
  3769.  
  3770. #if (_WIN32_IE >= 0x0300)
  3771. #define NMLVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMLVCUSTOMDRW, clrTextBk)
  3772.  
  3773. typedef struct tagNMLVCUSTOMDRAW
  3774. {
  3775.     NMCUSTOMDRAW nmcd;
  3776.     COLORREF clrText;
  3777.     COLORREF clrTextBk;
  3778. #if (_WIN32_IE >= 0x0400)
  3779.     int iSubItem;
  3780. #endif
  3781. } NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
  3782.  
  3783. typedef struct tagNMLVCACHEHINT
  3784. {
  3785.     NMHDR   hdr;
  3786.     int     iFrom;
  3787.     int     iTo;
  3788. } NMLVCACHEHINT, FAR *LPNMLVCACHEHINT;
  3789.  
  3790. #define LPNM_CACHEHINT  LPNMLVCACHEHINT
  3791. #define PNM_CACHEHINT   LPNMLVCACHEHINT
  3792. #define NM_CACHEHINT    NMLVCACHEHINT
  3793.  
  3794. typedef struct tagNMLVFINDITEMA
  3795. {
  3796.     NMHDR   hdr;
  3797.     int     iStart;
  3798.     LVFINDINFOA lvfi;
  3799. } NMLVFINDITEMA, FAR *LPNMLVFINDITEMA;
  3800.  
  3801. typedef struct tagNMLVFINDITEMW
  3802. {
  3803.     NMHDR   hdr;
  3804.     int     iStart;
  3805.     LVFINDINFOW lvfi;
  3806. } NMLVFINDITEMW, FAR *LPNMLVFINDITEMW;
  3807.  
  3808. #define PNM_FINDITEMA   LPNMLVFINDITEMA
  3809. #define LPNM_FINDITEMA  LPNMLVFINDITEMA
  3810. #define NM_FINDITEMA    NMLVFINDITEMA
  3811.  
  3812. #define PNM_FINDITEMW   LPNMLVFINDITEMW
  3813. #define LPNM_FINDITEMW  LPNMLVFINDITEMW
  3814. #define NM_FINDITEMW    NMLVFINDITEMW
  3815.  
  3816. #ifdef UNICODE
  3817. #define PNM_FINDITEM    PNM_FINDITEMW
  3818. #define LPNM_FINDITEM   LPNM_FINDITEMW
  3819. #define NM_FINDITEM     NM_FINDITEMW
  3820. #define NMLVFINDITEM    NMLVFINDITEMW
  3821. #define LPNMLVFINDITEM  LPNMLVFINDITEMW
  3822. #else
  3823. #define PNM_FINDITEM    PNM_FINDITEMA
  3824. #define LPNM_FINDITEM   LPNM_FINDITEMA
  3825. #define NM_FINDITEM     NM_FINDITEMA
  3826. #define NMLVFINDITEM    NMLVFINDITEMA
  3827. #define LPNMLVFINDITEM  LPNMLVFINDITEMA
  3828. #endif
  3829.  
  3830. typedef struct tagNMLVODSTATECHANGE
  3831. {
  3832.     NMHDR hdr;
  3833.     int iFrom;
  3834.     int iTo;
  3835.     UINT uNewState;
  3836.     UINT uOldState;
  3837. } NMLVODSTATECHANGE, FAR *LPNMLVODSTATECHANGE;
  3838.  
  3839. #define PNM_ODSTATECHANGE   LPNMLVODSTATECHANGE
  3840. #define LPNM_ODSTATECHANGE  LPNMLVODSTATECHANGE
  3841. #define NM_ODSTATECHANGE    NMLVODSTATECHANGE
  3842. #endif      // _WIN32_IE >= 0x0300
  3843.  
  3844.  
  3845. #define LVN_ITEMCHANGING        (LVN_FIRST-0)
  3846. #define LVN_ITEMCHANGED         (LVN_FIRST-1)
  3847. #define LVN_INSERTITEM          (LVN_FIRST-2)
  3848. #define LVN_DELETEITEM          (LVN_FIRST-3)
  3849. #define LVN_DELETEALLITEMS      (LVN_FIRST-4)
  3850. #define LVN_BEGINLABELEDITA     (LVN_FIRST-5)
  3851. #define LVN_BEGINLABELEDITW     (LVN_FIRST-75)
  3852. #define LVN_ENDLABELEDITA       (LVN_FIRST-6)
  3853. #define LVN_ENDLABELEDITW       (LVN_FIRST-76)
  3854. #define LVN_COLUMNCLICK         (LVN_FIRST-8)
  3855. #define LVN_BEGINDRAG           (LVN_FIRST-9)
  3856. #define LVN_BEGINRDRAG          (LVN_FIRST-11)
  3857.  
  3858. #if (_WIN32_IE >= 0x0300)
  3859. #define LVN_ODCACHEHINT         (LVN_FIRST-13)
  3860. #define LVN_ODFINDITEMA         (LVN_FIRST-52)
  3861. #define LVN_ODFINDITEMW         (LVN_FIRST-79)
  3862.  
  3863. #define LVN_ITEMACTIVATE        (LVN_FIRST-14)
  3864. #define LVN_ODSTATECHANGED      (LVN_FIRST-15)
  3865.  
  3866. #ifdef UNICODE
  3867. #define LVN_ODFINDITEM          LVN_ODFINDITEMW
  3868. #else
  3869. #define LVN_ODFINDITEM          LVN_ODFINDITEMA
  3870. #endif
  3871. #endif      // _WIN32_IE >= 0x0300
  3872.  
  3873.  
  3874. #if (_WIN32_IE >= 0x0400)
  3875. #define LVN_HOTTRACK            (LVN_FIRST-21)
  3876. #endif
  3877.  
  3878. #define LVN_GETDISPINFOA        (LVN_FIRST-50)
  3879. #define LVN_GETDISPINFOW        (LVN_FIRST-77)
  3880. #define LVN_SETDISPINFOA        (LVN_FIRST-51)
  3881. #define LVN_SETDISPINFOW        (LVN_FIRST-78)
  3882.  
  3883. #ifdef UNICODE
  3884. #define LVN_BEGINLABELEDIT      LVN_BEGINLABELEDITW
  3885. #define LVN_ENDLABELEDIT        LVN_ENDLABELEDITW
  3886. #define LVN_GETDISPINFO         LVN_GETDISPINFOW
  3887. #define LVN_SETDISPINFO         LVN_SETDISPINFOW
  3888. #else
  3889. #define LVN_BEGINLABELEDIT      LVN_BEGINLABELEDITA
  3890. #define LVN_ENDLABELEDIT        LVN_ENDLABELEDITA
  3891. #define LVN_GETDISPINFO         LVN_GETDISPINFOA
  3892. #define LVN_SETDISPINFO         LVN_SETDISPINFOA
  3893. #endif
  3894.  
  3895.  
  3896. #define LVIF_DI_SETITEM         0x1000
  3897.  
  3898. #if (_WIN32_IE >= 0x0300)
  3899. #define LV_DISPINFOA    NMLVDISPINFOA
  3900. #define LV_DISPINFOW    NMLVDISPINFOW
  3901. #else
  3902. #define tagLVDISPINFO   _LV_DISPINFO
  3903. #define NMLVDISPINFOA    LV_DISPINFOA
  3904. #define tagLVDISPINFOW  _LV_DISPINFOW
  3905. #define NMLVDISPINFOW    LV_DISPINFOW
  3906. #endif
  3907.  
  3908. #define LV_DISPINFO     NMLVDISPINFO
  3909.  
  3910. typedef struct tagLVDISPINFO {
  3911.     NMHDR hdr;
  3912.     LVITEMA item;
  3913. } NMLVDISPINFOA, FAR *LPNMLVDISPINFOA;
  3914.  
  3915. typedef struct tagLVDISPINFOW {
  3916.     NMHDR hdr;
  3917.     LVITEMW item;
  3918. } NMLVDISPINFOW, FAR * LPNMLVDISPINFOW;
  3919.  
  3920. #ifdef UNICODE
  3921. #define  NMLVDISPINFO           NMLVDISPINFOW
  3922. #else
  3923. #define  NMLVDISPINFO           NMLVDISPINFOA
  3924. #endif
  3925.  
  3926. #define LVN_KEYDOWN             (LVN_FIRST-55)
  3927.  
  3928. #if (_WIN32_IE >= 0x0300)
  3929. #define LV_KEYDOWN              NMLVKEYDOWN
  3930. #else
  3931. #define tagLVKEYDOWN            _LV_KEYDOWN
  3932. #define NMLVKEYDOWN              LV_KEYDOWN
  3933. #endif
  3934.  
  3935. #ifdef _WIN32
  3936. #include <pshpack1.h>
  3937. #endif
  3938.  
  3939. typedef struct tagLVKEYDOWN
  3940. {
  3941.     NMHDR hdr;
  3942.     WORD wVKey;
  3943.     UINT flags;
  3944. } NMLVKEYDOWN, FAR *LPNMLVKEYDOWN;
  3945.  
  3946. #ifdef _WIN32
  3947. #include <poppack.h>
  3948. #endif
  3949.  
  3950. #if (_WIN32_IE >= 0x0300)
  3951. #define LVN_MARQUEEBEGIN        (LVN_FIRST-56)
  3952. #endif
  3953.  
  3954. #if (_WIN32_IE >= 0x0400)
  3955. typedef struct tagNMLVGETINFOTIPA
  3956. {
  3957.     NMHDR hdr;
  3958.     DWORD dwFlags;
  3959.     LPSTR pszText;
  3960.     int cchTextMax;
  3961.     int iItem;
  3962.     int iSubItem;
  3963.     LPARAM lParam;
  3964. } NMLVGETINFOTIPA, *LPNMLVGETINFOTIPA;
  3965.  
  3966. typedef struct tagNMLVGETINFOTIPW
  3967. {
  3968.     NMHDR hdr;
  3969.     DWORD dwFlags;
  3970.     LPWSTR pszText;
  3971.     int cchTextMax;
  3972.     int iItem;
  3973.     int iSubItem;
  3974.     LPARAM lParam;
  3975. } NMLVGETINFOTIPW, *LPNMLVGETINFOTIPW;
  3976.  
  3977. // NMLVGETINFOTIPA.dwFlag values
  3978.  
  3979. #define LVGIT_UNFOLDED  0x0001
  3980.  
  3981. #define LVN_GETINFOTIPA          (LVN_FIRST-57)
  3982. #define LVN_GETINFOTIPW          (LVN_FIRST-58)
  3983.  
  3984. #ifdef UNICODE
  3985. #define LVN_GETINFOTIP          LVN_GETINFOTIPW
  3986. #define NMLVGETINFOTIP          NMLVGETINFOTIPW
  3987. #define LPNMLVGETINFOTIP        LPNMLVGETINFOTIPW
  3988. #else
  3989. #define LVN_GETINFOTIP          LVN_GETINFOTIPA
  3990. #define NMLVGETINFOTIP          NMLVGETINFOTIPA
  3991. #define LPNMLVGETINFOTIP        LPNMLVGETINFOTIPA
  3992. #endif
  3993.  
  3994.  
  3995. #endif      // _WIN32_IE >= 0x0400
  3996.  
  3997.  
  3998. #endif // NOLISTVIEW
  3999.  
  4000. //====== TREEVIEW CONTROL =====================================================
  4001.  
  4002. #ifndef NOTREEVIEW
  4003.  
  4004. #ifdef _WIN32
  4005. #define WC_TREEVIEWA            "SysTreeView32"
  4006. #define WC_TREEVIEWW            L"SysTreeView32"
  4007.  
  4008. #ifdef UNICODE
  4009. #define  WC_TREEVIEW            WC_TREEVIEWW
  4010. #else
  4011. #define  WC_TREEVIEW            WC_TREEVIEWA
  4012. #endif
  4013.  
  4014. #else
  4015. #define WC_TREEVIEW             "SysTreeView"
  4016. #endif
  4017.  
  4018. // begin_r_commctrl
  4019.  
  4020. #define TVS_HASBUTTONS          0x0001
  4021. #define TVS_HASLINES            0x0002
  4022. #define TVS_LINESATROOT         0x0004
  4023. #define TVS_EDITLABELS          0x0008
  4024. #define TVS_DISABLEDRAGDROP     0x0010
  4025. #define TVS_SHOWSELALWAYS       0x0020
  4026. #if (_WIN32_IE >= 0x0300)
  4027. #define TVS_RTLREADING          0x0040
  4028.  
  4029. #define TVS_NOTOOLTIPS          0x0080
  4030. #define TVS_CHECKBOXES          0x0100
  4031. #define TVS_TRACKSELECT         0x0200
  4032. #if (_WIN32_IE >= 0x0400)
  4033. #define TVS_SINGLEEXPAND        0x0400
  4034. #define TVS_INFOTIP             0x0800
  4035. #define TVS_FULLROWSELECT       0x1000
  4036. #define TVS_NOSCROLL            0x2000
  4037. #define TVS_NONEVENHEIGHT       0x4000
  4038. #endif
  4039. #if (_WIN32_IE >= 0x500)
  4040. #define TVS_NOHSCROLL           0x8000  // TVS_NOSCROLL overrides this
  4041. #endif
  4042.  
  4043. #endif
  4044.  
  4045. // end_r_commctrl
  4046.  
  4047. typedef struct _TREEITEM FAR* HTREEITEM;
  4048.  
  4049. #define TVIF_TEXT               0x0001
  4050. #define TVIF_IMAGE              0x0002
  4051. #define TVIF_PARAM              0x0004
  4052. #define TVIF_STATE              0x0008
  4053. #define TVIF_HANDLE             0x0010
  4054. #define TVIF_SELECTEDIMAGE      0x0020
  4055. #define TVIF_CHILDREN           0x0040
  4056. #if (_WIN32_IE >= 0x0400)
  4057. #define TVIF_INTEGRAL           0x0080
  4058. #endif
  4059. #define TVIS_SELECTED           0x0002
  4060. #define TVIS_CUT                0x0004
  4061. #define TVIS_DROPHILITED        0x0008
  4062. #define TVIS_BOLD               0x0010
  4063. #define TVIS_EXPANDED           0x0020
  4064. #define TVIS_EXPANDEDONCE       0x0040
  4065. #if (_WIN32_IE >= 0x0300)
  4066. #define TVIS_EXPANDPARTIAL      0x0080
  4067. #endif
  4068.  
  4069. #define TVIS_OVERLAYMASK        0x0F00
  4070. #define TVIS_STATEIMAGEMASK     0xF000
  4071. #define TVIS_USERMASK           0xF000
  4072.  
  4073. #define I_CHILDRENCALLBACK  (-1)
  4074.  
  4075. #if (_WIN32_IE >= 0x0300)
  4076. #define LPTV_ITEMW              LPTVITEMW
  4077. #define LPTV_ITEMA              LPTVITEMA
  4078. #define TV_ITEMW                TVITEMW
  4079. #define TV_ITEMA                TVITEMA
  4080. #else
  4081. #define tagTVITEMA             _TV_ITEMA
  4082. #define    TVITEMA              TV_ITEMA
  4083. #define  LPTVITEMA            LPTV_ITEMA
  4084. #define tagTVITEMW             _TV_ITEMW
  4085. #define    TVITEMW              TV_ITEMW
  4086. #define  LPTVITEMW            LPTV_ITEMW
  4087. #endif
  4088.  
  4089. #define LPTV_ITEM               LPTVITEM
  4090. #define TV_ITEM                 TVITEM
  4091.  
  4092. typedef struct tagTVITEMA {
  4093.     UINT      mask;
  4094.     HTREEITEM hItem;
  4095.     UINT      state;
  4096.     UINT      stateMask;
  4097.     LPSTR     pszText;
  4098.     int       cchTextMax;
  4099.     int       iImage;
  4100.     int       iSelectedImage;
  4101.     int       cChildren;
  4102.     LPARAM    lParam;
  4103. } TVITEMA, FAR *LPTVITEMA;
  4104.  
  4105. typedef struct tagTVITEMW {
  4106.     UINT      mask;
  4107.     HTREEITEM hItem;
  4108.     UINT      state;
  4109.     UINT      stateMask;
  4110.     LPWSTR    pszText;
  4111.     int       cchTextMax;
  4112.     int       iImage;
  4113.     int       iSelectedImage;
  4114.     int       cChildren;
  4115.     LPARAM    lParam;
  4116. } TVITEMW, FAR *LPTVITEMW;
  4117.  
  4118. #if (_WIN32_IE >= 0x0400)
  4119. // only used for Get and Set messages.  no notifies
  4120. typedef struct tagTVITEMEXA {
  4121.     UINT      mask;
  4122.     HTREEITEM hItem;
  4123.     UINT      state;
  4124.     UINT      stateMask;
  4125.     LPSTR     pszText;
  4126.     int       cchTextMax;
  4127.     int       iImage;
  4128.     int       iSelectedImage;
  4129.     int       cChildren;
  4130.     LPARAM    lParam;
  4131.     int       iIntegral;
  4132. } TVITEMEXA, FAR *LPTVITEMEXA;
  4133. // only used for Get and Set messages.  no notifies
  4134. typedef struct tagTVITEMEXW {
  4135.     UINT      mask;
  4136.     HTREEITEM hItem;
  4137.     UINT      state;
  4138.     UINT      stateMask;
  4139.     LPWSTR    pszText;
  4140.     int       cchTextMax;
  4141.     int       iImage;
  4142.     int       iSelectedImage;
  4143.     int       cChildren;
  4144.     LPARAM    lParam;
  4145.     int       iIntegral;
  4146. } TVITEMEXW, FAR *LPTVITEMEXW;
  4147. #ifdef UNICODE
  4148. typedef TVITEMEXW TVITEMEX;
  4149. typedef LPTVITEMEXW LPTVITEMEX;
  4150. #else
  4151. typedef TVITEMEXA TVITEMEX;
  4152. typedef LPTVITEMEXA LPTVITEMEX;
  4153. #endif // UNICODE
  4154.  
  4155. #endif
  4156.  
  4157. #ifdef UNICODE
  4158. #define  TVITEM                 TVITEMW
  4159. #define  LPTVITEM               LPTVITEMW
  4160. #else
  4161. #define  TVITEM                 TVITEMA
  4162. #define  LPTVITEM               LPTVITEMA
  4163. #endif
  4164.  
  4165.  
  4166. #define TVI_ROOT                ((HTREEITEM)(ULONG_PTR)-0x10000)
  4167. #define TVI_FIRST               ((HTREEITEM)(ULONG_PTR)-0x0FFFF)
  4168. #define TVI_LAST                ((HTREEITEM)(ULONG_PTR)-0x0FFFE)
  4169. #define TVI_SORT                ((HTREEITEM)(ULONG_PTR)-0x0FFFD)
  4170.  
  4171. #if (_WIN32_IE >= 0x0300)
  4172. #define LPTV_INSERTSTRUCTA      LPTVINSERTSTRUCTA
  4173. #define LPTV_INSERTSTRUCTW      LPTVINSERTSTRUCTW
  4174. #define TV_INSERTSTRUCTA        TVINSERTSTRUCTA
  4175. #define TV_INSERTSTRUCTW        TVINSERTSTRUCTW
  4176. #else
  4177. #define tagTVINSERTSTRUCTA     _TV_INSERTSTRUCTA
  4178. #define    TVINSERTSTRUCTA      TV_INSERTSTRUCTA
  4179. #define  LPTVINSERTSTRUCTA    LPTV_INSERTSTRUCTA
  4180. #define tagTVINSERTSTRUCTW     _TV_INSERTSTRUCTW
  4181. #define    TVINSERTSTRUCTW      TV_INSERTSTRUCTW
  4182. #define  LPTVINSERTSTRUCTW    LPTV_INSERTSTRUCTW
  4183. #endif
  4184.  
  4185. #define TV_INSERTSTRUCT         TVINSERTSTRUCT
  4186. #define LPTV_INSERTSTRUCT       LPTVINSERTSTRUCT
  4187.  
  4188.  
  4189. #define TVINSERTSTRUCTA_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTA, item)
  4190. #define TVINSERTSTRUCTW_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTW, item)
  4191.  
  4192. typedef struct tagTVINSERTSTRUCTA {
  4193.     HTREEITEM hParent;
  4194.     HTREEITEM hInsertAfter;
  4195. #if (_WIN32_IE >= 0x0400)
  4196.     union
  4197.     {
  4198.         TVITEMEXA itemex;
  4199.         TV_ITEMA  item;
  4200.     } DUMMYUNIONNAME;
  4201. #else
  4202.     TV_ITEMA item;
  4203. #endif
  4204. } TVINSERTSTRUCTA, FAR *LPTVINSERTSTRUCTA;
  4205.  
  4206. typedef struct tagTVINSERTSTRUCTW {
  4207.     HTREEITEM hParent;
  4208.     HTREEITEM hInsertAfter;
  4209. #if (_WIN32_IE >= 0x0400)
  4210.     union
  4211.     {
  4212.         TVITEMEXW itemex;
  4213.         TV_ITEMW  item;
  4214.     } DUMMYUNIONNAME;
  4215. #else
  4216.     TV_ITEMW item;
  4217. #endif
  4218. } TVINSERTSTRUCTW, FAR *LPTVINSERTSTRUCTW;
  4219.  
  4220. #ifdef UNICODE
  4221. #define  TVINSERTSTRUCT         TVINSERTSTRUCTW
  4222. #define  LPTVINSERTSTRUCT       LPTVINSERTSTRUCTW
  4223. #define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTW_V1_SIZE
  4224. #else
  4225. #define  TVINSERTSTRUCT         TVINSERTSTRUCTA
  4226. #define  LPTVINSERTSTRUCT       LPTVINSERTSTRUCTA
  4227. #define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTA_V1_SIZE
  4228. #endif
  4229.  
  4230. #define TVM_INSERTITEMA         (TV_FIRST + 0)
  4231. #define TVM_INSERTITEMW         (TV_FIRST + 50)
  4232. #ifdef UNICODE
  4233. #define  TVM_INSERTITEM         TVM_INSERTITEMW
  4234. #else
  4235. #define  TVM_INSERTITEM         TVM_INSERTITEMA
  4236. #endif
  4237.  
  4238. #define TreeView_InsertItem(hwnd, lpis) \
  4239.     (HTREEITEM)SNDMSG((hwnd), TVM_INSERTITEM, 0, (LPARAM)(LPTV_INSERTSTRUCT)(lpis))
  4240.  
  4241.  
  4242. #define TVM_DELETEITEM          (TV_FIRST + 1)
  4243. #define TreeView_DeleteItem(hwnd, hitem) \
  4244.     (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hitem))
  4245.  
  4246.  
  4247. #define TreeView_DeleteAllItems(hwnd) \
  4248.     (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT)
  4249.  
  4250.  
  4251. #define TVM_EXPAND              (TV_FIRST + 2)
  4252. #define TreeView_Expand(hwnd, hitem, code) \
  4253.     (BOOL)SNDMSG((hwnd), TVM_EXPAND, (WPARAM)(code), (LPARAM)(HTREEITEM)(hitem))
  4254.  
  4255.  
  4256. #define TVE_COLLAPSE            0x0001
  4257. #define TVE_EXPAND              0x0002
  4258. #define TVE_TOGGLE              0x0003
  4259. #if (_WIN32_IE >= 0x0300)
  4260. #define TVE_EXPANDPARTIAL       0x4000
  4261. #endif
  4262. #define TVE_COLLAPSERESET       0x8000
  4263.  
  4264.  
  4265. #define TVM_GETITEMRECT         (TV_FIRST + 4)
  4266. #define TreeView_GetItemRect(hwnd, hitem, prc, code) \
  4267.     (*(HTREEITEM FAR *)prc = (hitem), (BOOL)SNDMSG((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT FAR*)(prc)))
  4268.  
  4269.  
  4270. #define TVM_GETCOUNT            (TV_FIRST + 5)
  4271. #define TreeView_GetCount(hwnd) \
  4272.     (UINT)SNDMSG((hwnd), TVM_GETCOUNT, 0, 0)
  4273.  
  4274.  
  4275. #define TVM_GETINDENT           (TV_FIRST + 6)
  4276. #define TreeView_GetIndent(hwnd) \
  4277.     (UINT)SNDMSG((hwnd), TVM_GETINDENT, 0, 0)
  4278.  
  4279.  
  4280. #define TVM_SETINDENT           (TV_FIRST + 7)
  4281. #define TreeView_SetIndent(hwnd, indent) \
  4282.     (BOOL)SNDMSG((hwnd), TVM_SETINDENT, (WPARAM)(indent), 0)
  4283.  
  4284.  
  4285. #define TVM_GETIMAGELIST        (TV_FIRST + 8)
  4286. #define TreeView_GetImageList(hwnd, iImage) \
  4287.     (HIMAGELIST)SNDMSG((hwnd), TVM_GETIMAGELIST, iImage, 0)
  4288.  
  4289.  
  4290. #define TVSIL_NORMAL            0
  4291. #define TVSIL_STATE             2
  4292.  
  4293.  
  4294. #define TVM_SETIMAGELIST        (TV_FIRST + 9)
  4295. #define TreeView_SetImageList(hwnd, himl, iImage) \
  4296.     (HIMAGELIST)SNDMSG((hwnd), TVM_SETIMAGELIST, iImage, (LPARAM)(HIMAGELIST)(himl))
  4297.  
  4298.  
  4299. #define TVM_GETNEXTITEM         (TV_FIRST + 10)
  4300. #define TreeView_GetNextItem(hwnd, hitem, code) \
  4301.     (HTREEITEM)SNDMSG((hwnd), TVM_GETNEXTITEM, (WPARAM)(code), (LPARAM)(HTREEITEM)(hitem))
  4302.  
  4303.  
  4304. #define TVGN_ROOT               0x0000
  4305. #define TVGN_NEXT               0x0001
  4306. #define TVGN_PREVIOUS           0x0002
  4307. #define TVGN_PARENT             0x0003
  4308. #define TVGN_CHILD              0x0004
  4309. #define TVGN_FIRSTVISIBLE       0x0005
  4310. #define TVGN_NEXTVISIBLE        0x0006
  4311. #define TVGN_PREVIOUSVISIBLE    0x0007
  4312. #define TVGN_DROPHILITE         0x0008
  4313. #define TVGN_CARET              0x0009
  4314. #if (_WIN32_IE >= 0x0400)
  4315. #define TVGN_LASTVISIBLE        0x000A
  4316. #endif      // _WIN32_IE >= 0x0400
  4317.  
  4318. #define TreeView_GetChild(hwnd, hitem)          TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD)
  4319. #define TreeView_GetNextSibling(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT)
  4320. #define TreeView_GetPrevSibling(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS)
  4321. #define TreeView_GetParent(hwnd, hitem)         TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT)
  4322. #define TreeView_GetFirstVisible(hwnd)          TreeView_GetNextItem(hwnd, NULL,  TVGN_FIRSTVISIBLE)
  4323. #define TreeView_GetNextVisible(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE)
  4324. #define TreeView_GetPrevVisible(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE)
  4325. #define TreeView_GetSelection(hwnd)             TreeView_GetNextItem(hwnd, NULL,  TVGN_CARET)
  4326. #define TreeView_GetDropHilight(hwnd)           TreeView_GetNextItem(hwnd, NULL,  TVGN_DROPHILITE)
  4327. #define TreeView_GetRoot(hwnd)                  TreeView_GetNextItem(hwnd, NULL,  TVGN_ROOT)
  4328. #if (_WIN32_IE >= 0x0400)
  4329. #define TreeView_GetLastVisible(hwnd)          TreeView_GetNextItem(hwnd, NULL,  TVGN_LASTVISIBLE)
  4330. #endif      // _WIN32_IE >= 0x0400
  4331.  
  4332.  
  4333. #define TVM_SELECTITEM          (TV_FIRST + 11)
  4334. #define TreeView_Select(hwnd, hitem, code) \
  4335.     (BOOL)SNDMSG((hwnd), TVM_SELECTITEM, (WPARAM)(code), (LPARAM)(HTREEITEM)(hitem))
  4336.  
  4337.  
  4338. #define TreeView_SelectItem(hwnd, hitem)            TreeView_Select(hwnd, hitem, TVGN_CARET)
  4339. #define TreeView_SelectDropTarget(hwnd, hitem)      TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
  4340. #define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
  4341.  
  4342. #define TVM_GETITEMA            (TV_FIRST + 12)
  4343. #define TVM_GETITEMW            (TV_FIRST + 62)
  4344.  
  4345. #ifdef UNICODE
  4346. #define  TVM_GETITEM            TVM_GETITEMW
  4347. #else
  4348. #define  TVM_GETITEM            TVM_GETITEMA
  4349. #endif
  4350.  
  4351. #define TreeView_GetItem(hwnd, pitem) \
  4352.     (BOOL)SNDMSG((hwnd), TVM_GETITEM, 0, (LPARAM)(TV_ITEM FAR*)(pitem))
  4353.  
  4354.  
  4355. #define TVM_SETITEMA            (TV_FIRST + 13)
  4356. #define TVM_SETITEMW            (TV_FIRST + 63)
  4357.  
  4358. #ifdef UNICODE
  4359. #define  TVM_SETITEM            TVM_SETITEMW
  4360. #else
  4361. #define  TVM_SETITEM            TVM_SETITEMA
  4362. #endif
  4363.  
  4364. #define TreeView_SetItem(hwnd, pitem) \
  4365.     (BOOL)SNDMSG((hwnd), TVM_SETITEM, 0, (LPARAM)(const TV_ITEM FAR*)(pitem))
  4366.  
  4367.  
  4368. #define TVM_EDITLABELA          (TV_FIRST + 14)
  4369. #define TVM_EDITLABELW          (TV_FIRST + 65)
  4370. #ifdef UNICODE
  4371. #define TVM_EDITLABEL           TVM_EDITLABELW
  4372. #else
  4373. #define TVM_EDITLABEL           TVM_EDITLABELA
  4374. #endif
  4375.  
  4376. #define TreeView_EditLabel(hwnd, hitem) \
  4377.     (HWND)SNDMSG((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
  4378.  
  4379.  
  4380. #define TVM_GETEDITCONTROL      (TV_FIRST + 15)
  4381. #define TreeView_GetEditControl(hwnd) \
  4382.     (HWND)SNDMSG((hwnd), TVM_GETEDITCONTROL, 0, 0)
  4383.  
  4384.  
  4385. #define TVM_GETVISIBLECOUNT     (TV_FIRST + 16)
  4386. #define TreeView_GetVisibleCount(hwnd) \
  4387.     (UINT)SNDMSG((hwnd), TVM_GETVISIBLECOUNT, 0, 0)
  4388.  
  4389.  
  4390. #define TVM_HITTEST             (TV_FIRST + 17)
  4391. #define TreeView_HitTest(hwnd, lpht) \
  4392.     (HTREEITEM)SNDMSG((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht))
  4393.  
  4394.  
  4395. #if (_WIN32_IE >= 0x0300)
  4396. #define LPTV_HITTESTINFO   LPTVHITTESTINFO
  4397. #define   TV_HITTESTINFO     TVHITTESTINFO
  4398. #else
  4399. #define tagTVHITTESTINFO    _TV_HITTESTINFO
  4400. #define    TVHITTESTINFO     TV_HITTESTINFO
  4401. #define  LPTVHITTESTINFO   LPTV_HITTESTINFO
  4402. #endif
  4403.  
  4404. typedef struct tagTVHITTESTINFO {
  4405.     POINT       pt;
  4406.     UINT        flags;
  4407.     HTREEITEM   hItem;
  4408. } TVHITTESTINFO, FAR *LPTVHITTESTINFO;
  4409.  
  4410. #define TVHT_NOWHERE            0x0001
  4411. #define TVHT_ONITEMICON         0x0002
  4412. #define TVHT_ONITEMLABEL        0x0004
  4413. #define TVHT_ONITEM             (TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON)
  4414. #define TVHT_ONITEMINDENT       0x0008
  4415. #define TVHT_ONITEMBUTTON       0x0010
  4416. #define TVHT_ONITEMRIGHT        0x0020
  4417. #define TVHT_ONITEMSTATEICON    0x0040
  4418.  
  4419. #define TVHT_ABOVE              0x0100
  4420. #define TVHT_BELOW              0x0200
  4421. #define TVHT_TORIGHT            0x0400
  4422. #define TVHT_TOLEFT             0x0800
  4423.  
  4424.  
  4425. #define TVM_CREATEDRAGIMAGE     (TV_FIRST + 18)
  4426. #define TreeView_CreateDragImage(hwnd, hitem) \
  4427.     (HIMAGELIST)SNDMSG((hwnd), TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(hitem))
  4428.  
  4429.  
  4430. #define TVM_SORTCHILDREN        (TV_FIRST + 19)
  4431. #define TreeView_SortChildren(hwnd, hitem, recurse) \
  4432.     (BOOL)SNDMSG((hwnd), TVM_SORTCHILDREN, (WPARAM)(recurse), (LPARAM)(HTREEITEM)(hitem))
  4433.  
  4434.  
  4435. #define TVM_ENSUREVISIBLE       (TV_FIRST + 20)
  4436. #define TreeView_EnsureVisible(hwnd, hitem) \
  4437.     (BOOL)SNDMSG((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem))
  4438.  
  4439.  
  4440. #define TVM_SORTCHILDRENCB      (TV_FIRST + 21)
  4441. #define TreeView_SortChildrenCB(hwnd, psort, recurse) \
  4442.     (BOOL)SNDMSG((hwnd), TVM_SORTCHILDRENCB, (WPARAM)(recurse), \
  4443.     (LPARAM)(LPTV_SORTCB)(psort))
  4444.  
  4445.  
  4446. #define TVM_ENDEDITLABELNOW     (TV_FIRST + 22)
  4447. #define TreeView_EndEditLabelNow(hwnd, fCancel) \
  4448.     (BOOL)SNDMSG((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)(fCancel), 0)
  4449.  
  4450.  
  4451. #define TVM_GETISEARCHSTRINGA   (TV_FIRST + 23)
  4452. #define TVM_GETISEARCHSTRINGW   (TV_FIRST + 64)
  4453.  
  4454. #ifdef UNICODE
  4455. #define TVM_GETISEARCHSTRING     TVM_GETISEARCHSTRINGW
  4456. #else
  4457. #define TVM_GETISEARCHSTRING     TVM_GETISEARCHSTRINGA
  4458. #endif
  4459.  
  4460. #if (_WIN32_IE >= 0x0300)
  4461. #define TVM_SETTOOLTIPS         (TV_FIRST + 24)
  4462. #define TreeView_SetToolTips(hwnd,  hwndTT) \
  4463.     (HWND)SNDMSG((hwnd), TVM_SETTOOLTIPS, (WPARAM)(hwndTT), 0)
  4464. #define TVM_GETTOOLTIPS         (TV_FIRST + 25)
  4465. #define TreeView_GetToolTips(hwnd) \
  4466.     (HWND)SNDMSG((hwnd), TVM_GETTOOLTIPS, 0, 0)
  4467. #endif
  4468.  
  4469. #define TreeView_GetISearchString(hwndTV, lpsz) \
  4470.         (BOOL)SNDMSG((hwndTV), TVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)(lpsz))
  4471.  
  4472. #if (_WIN32_IE >= 0x0400)
  4473. #define TVM_SETINSERTMARK       (TV_FIRST + 26)
  4474. #define TreeView_SetInsertMark(hwnd, hItem, fAfter) \
  4475.         (BOOL)SNDMSG((hwnd), TVM_SETINSERTMARK, (WPARAM) (fAfter), (LPARAM) (hItem))
  4476.  
  4477. #define TVM_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  4478. #define TreeView_SetUnicodeFormat(hwnd, fUnicode)  \
  4479.     (BOOL)SNDMSG((hwnd), TVM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  4480.  
  4481. #define TVM_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  4482. #define TreeView_GetUnicodeFormat(hwnd)  \
  4483.     (BOOL)SNDMSG((hwnd), TVM_GETUNICODEFORMAT, 0, 0)
  4484.  
  4485. #endif
  4486.  
  4487. #if (_WIN32_IE >= 0x0400)
  4488. #define TVM_SETITEMHEIGHT         (TV_FIRST + 27)
  4489. #define TreeView_SetItemHeight(hwnd,  iHeight) \
  4490.     (int)SNDMSG((hwnd), TVM_SETITEMHEIGHT, (WPARAM)(iHeight), 0)
  4491. #define TVM_GETITEMHEIGHT         (TV_FIRST + 28)
  4492. #define TreeView_GetItemHeight(hwnd) \
  4493.     (int)SNDMSG((hwnd), TVM_GETITEMHEIGHT, 0, 0)
  4494.  
  4495. #define TVM_SETBKCOLOR              (TV_FIRST + 29)
  4496. #define TreeView_SetBkColor(hwnd, clr) \
  4497.     (COLORREF)SNDMSG((hwnd), TVM_SETBKCOLOR, 0, (LPARAM)(clr))
  4498.  
  4499. #define TVM_SETTEXTCOLOR              (TV_FIRST + 30)
  4500. #define TreeView_SetTextColor(hwnd, clr) \
  4501.     (COLORREF)SNDMSG((hwnd), TVM_SETTEXTCOLOR, 0, (LPARAM)(clr))
  4502.  
  4503. #define TVM_GETBKCOLOR              (TV_FIRST + 31)
  4504. #define TreeView_GetBkColor(hwnd) \
  4505.     (COLORREF)SNDMSG((hwnd), TVM_GETBKCOLOR, 0, 0)
  4506.  
  4507. #define TVM_GETTEXTCOLOR              (TV_FIRST + 32)
  4508. #define TreeView_GetTextColor(hwnd) \
  4509.     (COLORREF)SNDMSG((hwnd), TVM_GETTEXTCOLOR, 0, 0)
  4510.  
  4511. #define TVM_SETSCROLLTIME              (TV_FIRST + 33)
  4512. #define TreeView_SetScrollTime(hwnd, uTime) \
  4513.     (UINT)SNDMSG((hwnd), TVM_SETSCROLLTIME, uTime, 0)
  4514.  
  4515. #define TVM_GETSCROLLTIME              (TV_FIRST + 34)
  4516. #define TreeView_GetScrollTime(hwnd) \
  4517.     (UINT)SNDMSG((hwnd), TVM_GETSCROLLTIME, 0, 0)
  4518.  
  4519.  
  4520. #define TVM_SETINSERTMARKCOLOR              (TV_FIRST + 37)
  4521. #define TreeView_SetInsertMarkColor(hwnd, clr) \
  4522.     (COLORREF)SNDMSG((hwnd), TVM_SETINSERTMARKCOLOR, 0, (LPARAM)(clr))
  4523. #define TVM_GETINSERTMARKCOLOR              (TV_FIRST + 38)
  4524. #define TreeView_GetInsertMarkColor(hwnd) \
  4525.     (COLORREF)SNDMSG((hwnd), TVM_GETINSERTMARKCOLOR, 0, 0)
  4526.  
  4527. #endif  /* (_WIN32_IE >= 0x0400) */
  4528.  
  4529. #if (_WIN32_IE >= 0x0500)
  4530. // tvm_?etitemstate only uses mask, state and stateMask.
  4531. // so unicode or ansi is irrelevant.
  4532. #define TreeView_SetItemState(hwndTV, hti, data, _mask) \
  4533. { TVITEM _ms_TVi;\
  4534.   _ms_TVi.mask = TVIF_STATE; \
  4535.   _ms_TVi.hItem = hti; \
  4536.   _ms_TVi.stateMask = _mask;\
  4537.   _ms_TVi.state = data;\
  4538.   SNDMSG((hwndTV), TVM_SETITEM, 0, (LPARAM)(TV_ITEM FAR *)&_ms_TVi);\
  4539. }
  4540.  
  4541. #define TreeView_SetCheckState(hwndTV, hti, fCheck) \
  4542.   TreeView_SetItemState(hwndTV, hti, INDEXTOSTATEIMAGEMASK((fCheck)?2:1), TVIS_STATEIMAGEMASK)
  4543.  
  4544. #define TVM_GETITEMSTATE        (TV_FIRST + 39)
  4545. #define TreeView_GetItemState(hwndTV, hti, mask) \
  4546.    (UINT)SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), (LPARAM)(mask))
  4547.  
  4548. #define TreeView_GetCheckState(hwndTV, hti) \
  4549.    ((((UINT)(SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), TVIS_STATEIMAGEMASK))) >> 12) -1)
  4550.  
  4551.  
  4552. #define TVM_SETLINECOLOR            (TV_FIRST + 40)
  4553. #define TreeView_SetLineColor(hwnd, clr) \
  4554.     (COLORREF)SNDMSG((hwnd), TVM_SETLINECOLOR, 0, (LPARAM)(clr))
  4555.  
  4556. #define TVM_GETLINECOLOR            (TV_FIRST + 41)
  4557. #define TreeView_GetLineColor(hwnd) \
  4558.     (COLORREF)SNDMSG((hwnd), TVM_GETLINECOLOR, 0, 0)
  4559.  
  4560. #endif
  4561.  
  4562. typedef int (CALLBACK *PFNTVCOMPARE)(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  4563.  
  4564. #if (_WIN32_IE >= 0x0300)
  4565. #define LPTV_SORTCB    LPTVSORTCB
  4566. #define   TV_SORTCB      TVSORTCB
  4567. #else
  4568. #define tagTVSORTCB    _TV_SORTCB
  4569. #define    TVSORTCB     TV_SORTCB
  4570. #define  LPTVSORTCB   LPTV_SORTCB
  4571. #endif
  4572.  
  4573. typedef struct tagTVSORTCB
  4574. {
  4575.         HTREEITEM       hParent;
  4576.         PFNTVCOMPARE    lpfnCompare;
  4577.         LPARAM          lParam;
  4578. } TVSORTCB, FAR *LPTVSORTCB;
  4579.  
  4580.  
  4581. #if (_WIN32_IE >= 0x0300)
  4582. #define LPNM_TREEVIEWA          LPNMTREEVIEWA
  4583. #define LPNM_TREEVIEWW          LPNMTREEVIEWW
  4584. #define NM_TREEVIEWW            NMTREEVIEWW
  4585. #define NM_TREEVIEWA            NMTREEVIEWA
  4586. #else
  4587. #define tagNMTREEVIEWA          _NM_TREEVIEWA
  4588. #define tagNMTREEVIEWW          _NM_TREEVIEWW
  4589. #define NMTREEVIEWA             NM_TREEVIEWA
  4590. #define NMTREEVIEWW             NM_TREEVIEWW
  4591. #define LPNMTREEVIEWA           LPNM_TREEVIEWA
  4592. #define LPNMTREEVIEWW           LPNM_TREEVIEWW
  4593. #endif
  4594.  
  4595. #define LPNM_TREEVIEW           LPNMTREEVIEW
  4596. #define NM_TREEVIEW             NMTREEVIEW
  4597.  
  4598. typedef struct tagNMTREEVIEWA {
  4599.     NMHDR       hdr;
  4600.     UINT        action;
  4601.     TVITEMA    itemOld;
  4602.     TVITEMA    itemNew;
  4603.     POINT       ptDrag;
  4604. } NMTREEVIEWA, FAR *LPNMTREEVIEWA;
  4605.  
  4606.  
  4607. typedef struct tagNMTREEVIEWW {
  4608.     NMHDR       hdr;
  4609.     UINT        action;
  4610.     TVITEMW    itemOld;
  4611.     TVITEMW    itemNew;
  4612.     POINT       ptDrag;
  4613. } NMTREEVIEWW, FAR *LPNMTREEVIEWW;
  4614.  
  4615.  
  4616. #ifdef UNICODE
  4617. #define  NMTREEVIEW             NMTREEVIEWW
  4618. #define  LPNMTREEVIEW           LPNMTREEVIEWW
  4619. #else
  4620. #define  NMTREEVIEW             NMTREEVIEWA
  4621. #define  LPNMTREEVIEW           LPNMTREEVIEWA
  4622. #endif
  4623.  
  4624.  
  4625. #define TVN_SELCHANGINGA        (TVN_FIRST-1)
  4626. #define TVN_SELCHANGINGW        (TVN_FIRST-50)
  4627. #define TVN_SELCHANGEDA         (TVN_FIRST-2)
  4628. #define TVN_SELCHANGEDW         (TVN_FIRST-51)
  4629.  
  4630. #define TVC_UNKNOWN             0x0000
  4631. #define TVC_BYMOUSE             0x0001
  4632. #define TVC_BYKEYBOARD          0x0002
  4633.  
  4634. #define TVN_GETDISPINFOA        (TVN_FIRST-3)
  4635. #define TVN_GETDISPINFOW        (TVN_FIRST-52)
  4636. #define TVN_SETDISPINFOA        (TVN_FIRST-4)
  4637. #define TVN_SETDISPINFOW        (TVN_FIRST-53)
  4638.  
  4639. #define TVIF_DI_SETITEM         0x1000
  4640.  
  4641. #if (_WIN32_IE >= 0x0300)
  4642. #define TV_DISPINFOA            NMTVDISPINFOA
  4643. #define TV_DISPINFOW            NMTVDISPINFOW
  4644. #else
  4645. #define tagTVDISPINFOA  _TV_DISPINFOA
  4646. #define NMTVDISPINFOA    TV_DISPINFOA
  4647. #define tagTVDISPINFOW  _TV_DISPINFOW
  4648. #define NMTVDISPINFOW    TV_DISPINFOW
  4649. #endif
  4650.  
  4651. #define TV_DISPINFO             NMTVDISPINFO
  4652.  
  4653. typedef struct tagTVDISPINFOA {
  4654.     NMHDR hdr;
  4655.     TVITEMA item;
  4656. } NMTVDISPINFOA, FAR *LPNMTVDISPINFOA;
  4657.  
  4658. typedef struct tagTVDISPINFOW {
  4659.     NMHDR hdr;
  4660.     TVITEMW item;
  4661. } NMTVDISPINFOW, FAR *LPNMTVDISPINFOW;
  4662.  
  4663.  
  4664. #ifdef UNICODE
  4665. #define NMTVDISPINFO            NMTVDISPINFOW
  4666. #define LPNMTVDISPINFO          LPNMTVDISPINFOW
  4667. #else
  4668. #define NMTVDISPINFO            NMTVDISPINFOA
  4669. #define LPNMTVDISPINFO          LPNMTVDISPINFOA
  4670. #endif
  4671.  
  4672. #define TVN_ITEMEXPANDINGA      (TVN_FIRST-5)
  4673. #define TVN_ITEMEXPANDINGW      (TVN_FIRST-54)
  4674. #define TVN_ITEMEXPANDEDA       (TVN_FIRST-6)
  4675. #define TVN_ITEMEXPANDEDW       (TVN_FIRST-55)
  4676. #define TVN_BEGINDRAGA          (TVN_FIRST-7)
  4677. #define TVN_BEGINDRAGW          (TVN_FIRST-56)
  4678. #define TVN_BEGINRDRAGA         (TVN_FIRST-8)
  4679. #define TVN_BEGINRDRAGW         (TVN_FIRST-57)
  4680. #define TVN_DELETEITEMA         (TVN_FIRST-9)
  4681. #define TVN_DELETEITEMW         (TVN_FIRST-58)
  4682. #define TVN_BEGINLABELEDITA     (TVN_FIRST-10)
  4683. #define TVN_BEGINLABELEDITW     (TVN_FIRST-59)
  4684. #define TVN_ENDLABELEDITA       (TVN_FIRST-11)
  4685. #define TVN_ENDLABELEDITW       (TVN_FIRST-60)
  4686. #define TVN_KEYDOWN             (TVN_FIRST-12)
  4687.  
  4688. #if (_WIN32_IE >= 0x0400)
  4689. #define TVN_GETINFOTIPA         (TVN_FIRST-13)
  4690. #define TVN_GETINFOTIPW         (TVN_FIRST-14)
  4691. #define TVN_SINGLEEXPAND        (TVN_FIRST-15)
  4692.  
  4693. #define TVNRET_DEFAULT          0
  4694. #define TVNRET_SKIPOLD          1
  4695. #define TVNRET_SKIPNEW          2
  4696.  
  4697. #endif // 0x400
  4698.  
  4699.  
  4700. #if (_WIN32_IE >= 0x0300)
  4701. #define TV_KEYDOWN      NMTVKEYDOWN
  4702. #else
  4703. #define tagTVKEYDOWN    _TV_KEYDOWN
  4704. #define  NMTVKEYDOWN     TV_KEYDOWN
  4705. #endif
  4706.  
  4707. #ifdef _WIN32
  4708. #include <pshpack1.h>
  4709. #endif
  4710.  
  4711. typedef struct tagTVKEYDOWN {
  4712.     NMHDR hdr;
  4713.     WORD wVKey;
  4714.     UINT flags;
  4715. } NMTVKEYDOWN, FAR *LPNMTVKEYDOWN;
  4716.  
  4717. #ifdef _WIN32
  4718. #include <poppack.h>
  4719. #endif
  4720.  
  4721.  
  4722. #ifdef UNICODE
  4723. #define TVN_SELCHANGING         TVN_SELCHANGINGW
  4724. #define TVN_SELCHANGED          TVN_SELCHANGEDW
  4725. #define TVN_GETDISPINFO         TVN_GETDISPINFOW
  4726. #define TVN_SETDISPINFO         TVN_SETDISPINFOW
  4727. #define TVN_ITEMEXPANDING       TVN_ITEMEXPANDINGW
  4728. #define TVN_ITEMEXPANDED        TVN_ITEMEXPANDEDW
  4729. #define TVN_BEGINDRAG           TVN_BEGINDRAGW
  4730. #define TVN_BEGINRDRAG          TVN_BEGINRDRAGW
  4731. #define TVN_DELETEITEM          TVN_DELETEITEMW
  4732. #define TVN_BEGINLABELEDIT      TVN_BEGINLABELEDITW
  4733. #define TVN_ENDLABELEDIT        TVN_ENDLABELEDITW
  4734. #else
  4735. #define TVN_SELCHANGING         TVN_SELCHANGINGA
  4736. #define TVN_SELCHANGED          TVN_SELCHANGEDA
  4737. #define TVN_GETDISPINFO         TVN_GETDISPINFOA
  4738. #define TVN_SETDISPINFO         TVN_SETDISPINFOA
  4739. #define TVN_ITEMEXPANDING       TVN_ITEMEXPANDINGA
  4740. #define TVN_ITEMEXPANDED        TVN_ITEMEXPANDEDA
  4741. #define TVN_BEGINDRAG           TVN_BEGINDRAGA
  4742. #define TVN_BEGINRDRAG          TVN_BEGINRDRAGA
  4743. #define TVN_DELETEITEM          TVN_DELETEITEMA
  4744. #define TVN_BEGINLABELEDIT      TVN_BEGINLABELEDITA
  4745. #define TVN_ENDLABELEDIT        TVN_ENDLABELEDITA
  4746. #endif
  4747.  
  4748. #if (_WIN32_IE >= 0x0300)
  4749. #define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW, clrTextBk)
  4750.  
  4751. typedef struct tagNMTVCUSTOMDRAW
  4752. {
  4753.     NMCUSTOMDRAW nmcd;
  4754.     COLORREF     clrText;
  4755.     COLORREF     clrTextBk;
  4756. #if (_WIN32_IE >= 0x0400)
  4757.     int iLevel;
  4758. #endif
  4759. } NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
  4760. #endif
  4761.  
  4762.  
  4763. #if (_WIN32_IE >= 0x0400)
  4764.  
  4765. // for tooltips
  4766.  
  4767. typedef struct tagNMTVGETINFOTIPA
  4768. {
  4769.     NMHDR hdr;
  4770.     LPSTR pszText;
  4771.     int cchTextMax;
  4772.     HTREEITEM hItem;
  4773.     LPARAM lParam;
  4774. } NMTVGETINFOTIPA, *LPNMTVGETINFOTIPA;
  4775.  
  4776. typedef struct tagNMTVGETINFOTIPW
  4777. {
  4778.     NMHDR hdr;
  4779.     LPWSTR pszText;
  4780.     int cchTextMax;
  4781.     HTREEITEM hItem;
  4782.     LPARAM lParam;
  4783. } NMTVGETINFOTIPW, *LPNMTVGETINFOTIPW;
  4784.  
  4785.  
  4786. #ifdef UNICODE
  4787. #define TVN_GETINFOTIP          TVN_GETINFOTIPW
  4788. #define NMTVGETINFOTIP          NMTVGETINFOTIPW
  4789. #define LPNMTVGETINFOTIP        LPNMTVGETINFOTIPW
  4790. #else
  4791. #define TVN_GETINFOTIP          TVN_GETINFOTIPA
  4792. #define NMTVGETINFOTIP          NMTVGETINFOTIPA
  4793. #define LPNMTVGETINFOTIP        LPNMTVGETINFOTIPA
  4794. #endif
  4795.  
  4796. // treeview's customdraw return meaning don't draw images.  valid on CDRF_NOTIFYITEMPREPAINT
  4797. #define TVCDRF_NOIMAGES         0x00010000
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804. #endif      // _WIN32_IE >= 0x0400
  4805.  
  4806. #endif      // NOTREEVIEW
  4807.  
  4808. #if (_WIN32_IE >= 0x0300)
  4809.  
  4810. #ifndef NOUSEREXCONTROLS
  4811.  
  4812. ////////////////////  ComboBoxEx ////////////////////////////////
  4813.  
  4814.  
  4815. #define WC_COMBOBOXEXW         L"ComboBoxEx32"
  4816. #define WC_COMBOBOXEXA         "ComboBoxEx32"
  4817.  
  4818. #ifdef UNICODE
  4819. #define WC_COMBOBOXEX          WC_COMBOBOXEXW
  4820. #else
  4821. #define WC_COMBOBOXEX          WC_COMBOBOXEXA
  4822. #endif
  4823.  
  4824.  
  4825. #define CBEIF_TEXT              0x00000001
  4826. #define CBEIF_IMAGE             0x00000002
  4827. #define CBEIF_SELECTEDIMAGE     0x00000004
  4828. #define CBEIF_OVERLAY           0x00000008
  4829. #define CBEIF_INDENT            0x00000010
  4830. #define CBEIF_LPARAM            0x00000020
  4831.  
  4832. #define CBEIF_DI_SETITEM        0x10000000
  4833.  
  4834. typedef struct tagCOMBOBOXEXITEMA
  4835. {
  4836.     UINT mask;
  4837.     INT_PTR iItem;
  4838.     LPSTR pszText;
  4839.     int cchTextMax;
  4840.     int iImage;
  4841.     int iSelectedImage;
  4842.     int iOverlay;
  4843.     int iIndent;
  4844.     LPARAM lParam;
  4845. } COMBOBOXEXITEMA, *PCOMBOBOXEXITEMA;
  4846. typedef COMBOBOXEXITEMA CONST *PCCOMBOEXITEMA;
  4847.  
  4848.  
  4849. typedef struct tagCOMBOBOXEXITEMW
  4850. {
  4851.     UINT mask;
  4852.     INT_PTR iItem;
  4853.     LPWSTR pszText;
  4854.     int cchTextMax;
  4855.     int iImage;
  4856.     int iSelectedImage;
  4857.     int iOverlay;
  4858.     int iIndent;
  4859.     LPARAM lParam;
  4860. } COMBOBOXEXITEMW, *PCOMBOBOXEXITEMW;
  4861. typedef COMBOBOXEXITEMW CONST *PCCOMBOEXITEMW;
  4862.  
  4863. #ifdef UNICODE
  4864. #define COMBOBOXEXITEM            COMBOBOXEXITEMW
  4865. #define PCOMBOBOXEXITEM           PCOMBOBOXEXITEMW
  4866. #define PCCOMBOBOXEXITEM          PCCOMBOBOXEXITEMW
  4867. #else
  4868. #define COMBOBOXEXITEM            COMBOBOXEXITEMA
  4869. #define PCOMBOBOXEXITEM           PCOMBOBOXEXITEMA
  4870. #define PCCOMBOBOXEXITEM          PCCOMBOBOXEXITEMA
  4871. #endif
  4872.  
  4873. #define CBEM_INSERTITEMA        (WM_USER + 1)
  4874. #define CBEM_SETIMAGELIST       (WM_USER + 2)
  4875. #define CBEM_GETIMAGELIST       (WM_USER + 3)
  4876. #define CBEM_GETITEMA           (WM_USER + 4)
  4877. #define CBEM_SETITEMA           (WM_USER + 5)
  4878. #define CBEM_DELETEITEM         CB_DELETESTRING
  4879. #define CBEM_GETCOMBOCONTROL    (WM_USER + 6)
  4880. #define CBEM_GETEDITCONTROL     (WM_USER + 7)
  4881. #if (_WIN32_IE >= 0x0400)
  4882. #define CBEM_SETEXSTYLE         (WM_USER + 8)  // use  SETEXTENDEDSTYLE instead
  4883. #define CBEM_SETEXTENDEDSTYLE   (WM_USER + 14)   // lparam == new style, wParam (optional) == mask
  4884. #define CBEM_GETEXSTYLE         (WM_USER + 9) // use GETEXTENDEDSTYLE instead
  4885. #define CBEM_GETEXTENDEDSTYLE   (WM_USER + 9)
  4886. #define CBEM_SETUNICODEFORMAT   CCM_SETUNICODEFORMAT
  4887. #define CBEM_GETUNICODEFORMAT   CCM_GETUNICODEFORMAT
  4888. #else
  4889. #define CBEM_SETEXSTYLE         (WM_USER + 8)
  4890. #define CBEM_GETEXSTYLE         (WM_USER + 9)
  4891. #endif
  4892. #define CBEM_HASEDITCHANGED     (WM_USER + 10)
  4893. #define CBEM_INSERTITEMW        (WM_USER + 11)
  4894. #define CBEM_SETITEMW           (WM_USER + 12)
  4895. #define CBEM_GETITEMW           (WM_USER + 13)
  4896.  
  4897. #ifdef UNICODE
  4898. #define CBEM_INSERTITEM         CBEM_INSERTITEMW
  4899. #define CBEM_SETITEM            CBEM_SETITEMW
  4900. #define CBEM_GETITEM            CBEM_GETITEMW
  4901. #else
  4902. #define CBEM_INSERTITEM         CBEM_INSERTITEMA
  4903. #define CBEM_SETITEM            CBEM_SETITEMA
  4904. #define CBEM_GETITEM            CBEM_GETITEMA
  4905. #endif
  4906.  
  4907. #define CBES_EX_NOEDITIMAGE          0x00000001
  4908. #define CBES_EX_NOEDITIMAGEINDENT    0x00000002
  4909. #define CBES_EX_PATHWORDBREAKPROC    0x00000004
  4910. #if (_WIN32_IE >= 0x0400)
  4911. #define CBES_EX_NOSIZELIMIT          0x00000008
  4912. #define CBES_EX_CASESENSITIVE        0x00000010
  4913.  
  4914. typedef struct {
  4915.     NMHDR hdr;
  4916.     COMBOBOXEXITEMA ceItem;
  4917. } NMCOMBOBOXEXA, *PNMCOMBOBOXEXA;
  4918.  
  4919. typedef struct {
  4920.     NMHDR hdr;
  4921.     COMBOBOXEXITEMW ceItem;
  4922. } NMCOMBOBOXEXW, *PNMCOMBOBOXEXW;
  4923.  
  4924. #ifdef UNICODE
  4925. #define NMCOMBOBOXEX            NMCOMBOBOXEXW
  4926. #define PNMCOMBOBOXEX           PNMCOMBOBOXEXW
  4927. #define CBEN_GETDISPINFO        CBEN_GETDISPINFOW
  4928. #else
  4929. #define NMCOMBOBOXEX            NMCOMBOBOXEXA
  4930. #define PNMCOMBOBOXEX           PNMCOMBOBOXEXA
  4931. #define CBEN_GETDISPINFO        CBEN_GETDISPINFOA
  4932. #endif
  4933.  
  4934. #else
  4935. typedef struct {
  4936.     NMHDR hdr;
  4937.     COMBOBOXEXITEM ceItem;
  4938. } NMCOMBOBOXEX, *PNMCOMBOBOXEX;
  4939.  
  4940. #define CBEN_GETDISPINFO         (CBEN_FIRST - 0)
  4941.  
  4942. #endif      // _WIN32_IE >= 0x0400
  4943.  
  4944. #if (_WIN32_IE >= 0x0400)
  4945. #define CBEN_GETDISPINFOA        (CBEN_FIRST - 0)
  4946. #endif
  4947. #define CBEN_INSERTITEM          (CBEN_FIRST - 1)
  4948. #define CBEN_DELETEITEM          (CBEN_FIRST - 2)
  4949. #define CBEN_BEGINEDIT           (CBEN_FIRST - 4)
  4950. #define CBEN_ENDEDITA            (CBEN_FIRST - 5)
  4951. #define CBEN_ENDEDITW            (CBEN_FIRST - 6)
  4952.  
  4953. #if (_WIN32_IE >= 0x0400)
  4954. #define CBEN_GETDISPINFOW        (CBEN_FIRST - 7)
  4955. #endif
  4956.  
  4957. #if (_WIN32_IE >= 0x0400)
  4958. #define CBEN_DRAGBEGINA                  (CBEN_FIRST - 8)
  4959. #define CBEN_DRAGBEGINW                  (CBEN_FIRST - 9)
  4960.  
  4961. #ifdef UNICODE
  4962. #define CBEN_DRAGBEGIN CBEN_DRAGBEGINW
  4963. #else
  4964. #define CBEN_DRAGBEGIN CBEN_DRAGBEGINA
  4965. #endif
  4966.  
  4967. #endif  //(_WIN32_IE >= 0x0400)
  4968.  
  4969. // lParam specifies why the endedit is happening
  4970. #ifdef UNICODE
  4971. #define CBEN_ENDEDIT CBEN_ENDEDITW
  4972. #else
  4973. #define CBEN_ENDEDIT CBEN_ENDEDITA
  4974. #endif
  4975.  
  4976. #define CBENF_KILLFOCUS         1
  4977. #define CBENF_RETURN            2
  4978. #define CBENF_ESCAPE            3
  4979. #define CBENF_DROPDOWN          4
  4980.  
  4981. #define CBEMAXSTRLEN 260
  4982.  
  4983. #if (_WIN32_IE >= 0x0400)
  4984. // CBEN_DRAGBEGIN sends this information ...
  4985.  
  4986. typedef struct {
  4987.     NMHDR hdr;
  4988.     int   iItemid;
  4989.     WCHAR szText[CBEMAXSTRLEN];
  4990. }NMCBEDRAGBEGINW, *LPNMCBEDRAGBEGINW, *PNMCBEDRAGBEGINW;
  4991.  
  4992.  
  4993. typedef struct {
  4994.     NMHDR hdr;
  4995.     int   iItemid;
  4996.     char szText[CBEMAXSTRLEN];
  4997. }NMCBEDRAGBEGINA, *LPNMCBEDRAGBEGINA, *PNMCBEDRAGBEGINA;
  4998.  
  4999. #ifdef UNICODE
  5000. #define  NMCBEDRAGBEGIN NMCBEDRAGBEGINW
  5001. #define  LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINW
  5002. #define  PNMCBEDRAGBEGIN PNMCBEDRAGBEGINW
  5003. #else
  5004. #define  NMCBEDRAGBEGIN NMCBEDRAGBEGINA
  5005. #define  LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINA
  5006. #define  PNMCBEDRAGBEGIN PNMCBEDRAGBEGINA
  5007. #endif
  5008. #endif      // _WIN32_IE >= 0x0400
  5009.  
  5010. // CBEN_ENDEDIT sends this information...
  5011. // fChanged if the user actually did anything
  5012. // iNewSelection gives what would be the new selection unless the notify is failed
  5013. //                      iNewSelection may be CB_ERR if there's no match
  5014. typedef struct {
  5015.         NMHDR hdr;
  5016.         BOOL fChanged;
  5017.         int iNewSelection;
  5018.         WCHAR szText[CBEMAXSTRLEN];
  5019.         int iWhy;
  5020. } NMCBEENDEDITW, *LPNMCBEENDEDITW, *PNMCBEENDEDITW;
  5021.  
  5022. typedef struct {
  5023.         NMHDR hdr;
  5024.         BOOL fChanged;
  5025.         int iNewSelection;
  5026.         char szText[CBEMAXSTRLEN];
  5027.         int iWhy;
  5028. } NMCBEENDEDITA, *LPNMCBEENDEDITA,*PNMCBEENDEDITA;
  5029.  
  5030. #ifdef UNICODE
  5031. #define  NMCBEENDEDIT NMCBEENDEDITW
  5032. #define  LPNMCBEENDEDIT LPNMCBEENDEDITW
  5033. #define  PNMCBEENDEDIT PNMCBEENDEDITW
  5034. #else
  5035. #define  NMCBEENDEDIT NMCBEENDEDITA
  5036. #define  LPNMCBEENDEDIT LPNMCBEENDEDITA
  5037. #define  PNMCBEENDEDIT PNMCBEENDEDITA
  5038. #endif
  5039.  
  5040. #endif
  5041.  
  5042. #endif      // _WIN32_IE >= 0x0300
  5043.  
  5044.  
  5045. //====== TAB CONTROL ==========================================================
  5046.  
  5047. #ifndef NOTABCONTROL
  5048.  
  5049. #ifdef _WIN32
  5050.  
  5051. #define WC_TABCONTROLA          "SysTabControl32"
  5052. #define WC_TABCONTROLW          L"SysTabControl32"
  5053.  
  5054. #ifdef UNICODE
  5055. #define  WC_TABCONTROL          WC_TABCONTROLW
  5056. #else
  5057. #define  WC_TABCONTROL          WC_TABCONTROLA
  5058. #endif
  5059.  
  5060. #else
  5061. #define WC_TABCONTROL           "SysTabControl"
  5062. #endif
  5063.  
  5064. // begin_r_commctrl
  5065.  
  5066. #if (_WIN32_IE >= 0x0300)
  5067. #define TCS_SCROLLOPPOSITE      0x0001   // assumes multiline tab
  5068. #define TCS_BOTTOM              0x0002
  5069. #define TCS_RIGHT               0x0002
  5070. #define TCS_MULTISELECT         0x0004  // allow multi-select in button mode
  5071. #endif
  5072. #if (_WIN32_IE >= 0x0400)
  5073. #define TCS_FLATBUTTONS         0x0008
  5074. #endif
  5075. #define TCS_FORCEICONLEFT       0x0010
  5076. #define TCS_FORCELABELLEFT      0x0020
  5077. #if (_WIN32_IE >= 0x0300)
  5078. #define TCS_HOTTRACK            0x0040
  5079. #define TCS_VERTICAL            0x0080
  5080. #endif
  5081. #define TCS_TABS                0x0000
  5082. #define TCS_BUTTONS             0x0100
  5083. #define TCS_SINGLELINE          0x0000
  5084. #define TCS_MULTILINE           0x0200
  5085. #define TCS_RIGHTJUSTIFY        0x0000
  5086. #define TCS_FIXEDWIDTH          0x0400
  5087. #define TCS_RAGGEDRIGHT         0x0800
  5088. #define TCS_FOCUSONBUTTONDOWN   0x1000
  5089. #define TCS_OWNERDRAWFIXED      0x2000
  5090. #define TCS_TOOLTIPS            0x4000
  5091. #define TCS_FOCUSNEVER          0x8000
  5092.  
  5093. // end_r_commctrl
  5094.  
  5095. #if (_WIN32_IE >= 0x0400)
  5096. // EX styles for use with TCM_SETEXTENDEDSTYLE
  5097. #define TCS_EX_FLATSEPARATORS   0x00000001
  5098. #define TCS_EX_REGISTERDROP     0x00000002
  5099. #endif
  5100.  
  5101.  
  5102. #define TCM_GETIMAGELIST        (TCM_FIRST + 2)
  5103. #define TabCtrl_GetImageList(hwnd) \
  5104.     (HIMAGELIST)SNDMSG((hwnd), TCM_GETIMAGELIST, 0, 0L)
  5105.  
  5106.  
  5107. #define TCM_SETIMAGELIST        (TCM_FIRST + 3)
  5108. #define TabCtrl_SetImageList(hwnd, himl) \
  5109.     (HIMAGELIST)SNDMSG((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(HIMAGELIST)(himl))
  5110.  
  5111.  
  5112. #define TCM_GETITEMCOUNT        (TCM_FIRST + 4)
  5113. #define TabCtrl_GetItemCount(hwnd) \
  5114.     (int)SNDMSG((hwnd), TCM_GETITEMCOUNT, 0, 0L)
  5115.  
  5116.  
  5117. #define TCIF_TEXT               0x0001
  5118. #define TCIF_IMAGE              0x0002
  5119. #define TCIF_RTLREADING         0x0004
  5120. #define TCIF_PARAM              0x0008
  5121. #if (_WIN32_IE >= 0x0300)
  5122. #define TCIF_STATE              0x0010
  5123.  
  5124.  
  5125. #define TCIS_BUTTONPRESSED      0x0001
  5126. #endif
  5127. #if (_WIN32_IE >= 0x0400)
  5128. #define TCIS_HIGHLIGHTED        0x0002
  5129. #endif
  5130.  
  5131. #if (_WIN32_IE >= 0x0300)
  5132. #define TC_ITEMHEADERA         TCITEMHEADERA
  5133. #define TC_ITEMHEADERW         TCITEMHEADERW
  5134. #else
  5135. #define tagTCITEMHEADERA       _TC_ITEMHEADERA
  5136. #define    TCITEMHEADERA        TC_ITEMHEADERA
  5137. #define tagTCITEMHEADERW       _TC_ITEMHEADERW
  5138. #define    TCITEMHEADERW        TC_ITEMHEADERW
  5139. #endif
  5140. #define TC_ITEMHEADER          TCITEMHEADER
  5141.  
  5142. typedef struct tagTCITEMHEADERA
  5143. {
  5144.     UINT mask;
  5145.     UINT lpReserved1;
  5146.     UINT lpReserved2;
  5147.     LPSTR pszText;
  5148.     int cchTextMax;
  5149.     int iImage;
  5150. } TCITEMHEADERA, FAR *LPTCITEMHEADERA;
  5151.  
  5152. typedef struct tagTCITEMHEADERW
  5153. {
  5154.     UINT mask;
  5155.     UINT lpReserved1;
  5156.     UINT lpReserved2;
  5157.     LPWSTR pszText;
  5158.     int cchTextMax;
  5159.     int iImage;
  5160. } TCITEMHEADERW, FAR *LPTCITEMHEADERW;
  5161.  
  5162. #ifdef UNICODE
  5163. #define  TCITEMHEADER          TCITEMHEADERW
  5164. #define  LPTCITEMHEADER        LPTCITEMHEADERW
  5165. #else
  5166. #define  TCITEMHEADER          TCITEMHEADERA
  5167. #define  LPTCITEMHEADER        LPTCITEMHEADERA
  5168. #endif
  5169.  
  5170.  
  5171. #if (_WIN32_IE >= 0x0300)
  5172. #define TC_ITEMA                TCITEMA
  5173. #define TC_ITEMW                TCITEMW
  5174. #else
  5175. #define tagTCITEMA              _TC_ITEMA
  5176. #define    TCITEMA               TC_ITEMA
  5177. #define tagTCITEMW              _TC_ITEMW
  5178. #define    TCITEMW               TC_ITEMW
  5179. #endif
  5180. #define TC_ITEM                 TCITEM
  5181.  
  5182. typedef struct tagTCITEMA
  5183. {
  5184.     UINT mask;
  5185. #if (_WIN32_IE >= 0x0300)
  5186.     DWORD dwState;
  5187.     DWORD dwStateMask;
  5188. #else
  5189.     UINT lpReserved1;
  5190.     UINT lpReserved2;
  5191. #endif
  5192.     LPSTR pszText;
  5193.     int cchTextMax;
  5194.     int iImage;
  5195.  
  5196.     LPARAM lParam;
  5197. } TCITEMA, FAR *LPTCITEMA;
  5198.  
  5199. typedef struct tagTCITEMW
  5200. {
  5201.     UINT mask;
  5202. #if (_WIN32_IE >= 0x0300)
  5203.     DWORD dwState;
  5204.     DWORD dwStateMask;
  5205. #else
  5206.     UINT lpReserved1;
  5207.     UINT lpReserved2;
  5208. #endif
  5209.     LPWSTR pszText;
  5210.     int cchTextMax;
  5211.     int iImage;
  5212.  
  5213.     LPARAM lParam;
  5214. } TCITEMW, FAR *LPTCITEMW;
  5215.  
  5216. #ifdef UNICODE
  5217. #define  TCITEM                 TCITEMW
  5218. #define  LPTCITEM               LPTCITEMW
  5219. #else
  5220. #define  TCITEM                 TCITEMA
  5221. #define  LPTCITEM               LPTCITEMA
  5222. #endif
  5223.  
  5224.  
  5225. #define TCM_GETITEMA            (TCM_FIRST + 5)
  5226. #define TCM_GETITEMW            (TCM_FIRST + 60)
  5227.  
  5228. #ifdef UNICODE
  5229. #define TCM_GETITEM             TCM_GETITEMW
  5230. #else
  5231. #define TCM_GETITEM             TCM_GETITEMA
  5232. #endif
  5233.  
  5234. #define TabCtrl_GetItem(hwnd, iItem, pitem) \
  5235.     (BOOL)SNDMSG((hwnd), TCM_GETITEM, (WPARAM)(int)(iItem), (LPARAM)(TC_ITEM FAR*)(pitem))
  5236.  
  5237.  
  5238. #define TCM_SETITEMA            (TCM_FIRST + 6)
  5239. #define TCM_SETITEMW            (TCM_FIRST + 61)
  5240.  
  5241. #ifdef UNICODE
  5242. #define TCM_SETITEM             TCM_SETITEMW
  5243. #else
  5244. #define TCM_SETITEM             TCM_SETITEMA
  5245. #endif
  5246.  
  5247. #define TabCtrl_SetItem(hwnd, iItem, pitem) \
  5248.     (BOOL)SNDMSG((hwnd), TCM_SETITEM, (WPARAM)(int)(iItem), (LPARAM)(TC_ITEM FAR*)(pitem))
  5249.  
  5250.  
  5251. #define TCM_INSERTITEMA         (TCM_FIRST + 7)
  5252. #define TCM_INSERTITEMW         (TCM_FIRST + 62)
  5253.  
  5254. #ifdef UNICODE
  5255. #define TCM_INSERTITEM          TCM_INSERTITEMW
  5256. #else
  5257. #define TCM_INSERTITEM          TCM_INSERTITEMA
  5258. #endif
  5259.  
  5260. #define TabCtrl_InsertItem(hwnd, iItem, pitem)   \
  5261.     (int)SNDMSG((hwnd), TCM_INSERTITEM, (WPARAM)(int)(iItem), (LPARAM)(const TC_ITEM FAR*)(pitem))
  5262.  
  5263.  
  5264. #define TCM_DELETEITEM          (TCM_FIRST + 8)
  5265. #define TabCtrl_DeleteItem(hwnd, i) \
  5266.     (BOOL)SNDMSG((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L)
  5267.  
  5268.  
  5269. #define TCM_DELETEALLITEMS      (TCM_FIRST + 9)
  5270. #define TabCtrl_DeleteAllItems(hwnd) \
  5271.     (BOOL)SNDMSG((hwnd), TCM_DELETEALLITEMS, 0, 0L)
  5272.  
  5273.  
  5274. #define TCM_GETITEMRECT         (TCM_FIRST + 10)
  5275. #define TabCtrl_GetItemRect(hwnd, i, prc) \
  5276.     (BOOL)SNDMSG((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT FAR*)(prc))
  5277.  
  5278.  
  5279. #define TCM_GETCURSEL           (TCM_FIRST + 11)
  5280. #define TabCtrl_GetCurSel(hwnd) \
  5281.     (int)SNDMSG((hwnd), TCM_GETCURSEL, 0, 0)
  5282.  
  5283.  
  5284. #define TCM_SETCURSEL           (TCM_FIRST + 12)
  5285. #define TabCtrl_SetCurSel(hwnd, i) \
  5286.     (int)SNDMSG((hwnd), TCM_SETCURSEL, (WPARAM)(i), 0)
  5287.  
  5288.  
  5289. #define TCHT_NOWHERE            0x0001
  5290. #define TCHT_ONITEMICON         0x0002
  5291. #define TCHT_ONITEMLABEL        0x0004
  5292. #define TCHT_ONITEM             (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
  5293.  
  5294. #if (_WIN32_IE >= 0x0300)
  5295. #define LPTC_HITTESTINFO        LPTCHITTESTINFO
  5296. #define TC_HITTESTINFO          TCHITTESTINFO
  5297. #else
  5298. #define tagTCHITTESTINFO        _TC_HITTESTINFO
  5299. #define    TCHITTESTINFO         TC_HITTESTINFO
  5300. #define  LPTCHITTESTINFO       LPTC_HITTESTINFO
  5301. #endif
  5302.  
  5303. typedef struct tagTCHITTESTINFO
  5304. {
  5305.     POINT pt;
  5306.     UINT flags;
  5307. } TCHITTESTINFO, FAR * LPTCHITTESTINFO;
  5308.  
  5309. #define TCM_HITTEST             (TCM_FIRST + 13)
  5310. #define TabCtrl_HitTest(hwndTC, pinfo) \
  5311.     (int)SNDMSG((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO FAR*)(pinfo))
  5312.  
  5313.  
  5314. #define TCM_SETITEMEXTRA        (TCM_FIRST + 14)
  5315. #define TabCtrl_SetItemExtra(hwndTC, cb) \
  5316.     (BOOL)SNDMSG((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L)
  5317.  
  5318.  
  5319. #define TCM_ADJUSTRECT          (TCM_FIRST + 40)
  5320. #define TabCtrl_AdjustRect(hwnd, bLarger, prc) \
  5321.     (int)SNDMSG(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)(bLarger), (LPARAM)(RECT FAR *)prc)
  5322.  
  5323.  
  5324. #define TCM_SETITEMSIZE         (TCM_FIRST + 41)
  5325. #define TabCtrl_SetItemSize(hwnd, x, y) \
  5326.     (DWORD)SNDMSG((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y))
  5327.  
  5328.  
  5329. #define TCM_REMOVEIMAGE         (TCM_FIRST + 42)
  5330. #define TabCtrl_RemoveImage(hwnd, i) \
  5331.         (void)SNDMSG((hwnd), TCM_REMOVEIMAGE, i, 0L)
  5332.  
  5333.  
  5334. #define TCM_SETPADDING          (TCM_FIRST + 43)
  5335. #define TabCtrl_SetPadding(hwnd,  cx, cy) \
  5336.         (void)SNDMSG((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
  5337.  
  5338.  
  5339. #define TCM_GETROWCOUNT         (TCM_FIRST + 44)
  5340. #define TabCtrl_GetRowCount(hwnd) \
  5341.         (int)SNDMSG((hwnd), TCM_GETROWCOUNT, 0, 0L)
  5342.  
  5343.  
  5344. #define TCM_GETTOOLTIPS         (TCM_FIRST + 45)
  5345. #define TabCtrl_GetToolTips(hwnd) \
  5346.         (HWND)SNDMSG((hwnd), TCM_GETTOOLTIPS, 0, 0L)
  5347.  
  5348.  
  5349. #define TCM_SETTOOLTIPS         (TCM_FIRST + 46)
  5350. #define TabCtrl_SetToolTips(hwnd, hwndTT) \
  5351.         (void)SNDMSG((hwnd), TCM_SETTOOLTIPS, (WPARAM)(hwndTT), 0L)
  5352.  
  5353.  
  5354. #define TCM_GETCURFOCUS         (TCM_FIRST + 47)
  5355. #define TabCtrl_GetCurFocus(hwnd) \
  5356.     (int)SNDMSG((hwnd), TCM_GETCURFOCUS, 0, 0)
  5357.  
  5358. #define TCM_SETCURFOCUS         (TCM_FIRST + 48)
  5359. #define TabCtrl_SetCurFocus(hwnd, i) \
  5360.     SNDMSG((hwnd),TCM_SETCURFOCUS, i, 0)
  5361.  
  5362. #if (_WIN32_IE >= 0x0300)
  5363. #define TCM_SETMINTABWIDTH      (TCM_FIRST + 49)
  5364. #define TabCtrl_SetMinTabWidth(hwnd, x) \
  5365.         (int)SNDMSG((hwnd), TCM_SETMINTABWIDTH, 0, x)
  5366.  
  5367.  
  5368. #define TCM_DESELECTALL         (TCM_FIRST + 50)
  5369. #define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\
  5370.         (void)SNDMSG((hwnd), TCM_DESELECTALL, fExcludeFocus, 0)
  5371. #endif
  5372.  
  5373. #if (_WIN32_IE >= 0x0400)
  5374.  
  5375. #define TCM_HIGHLIGHTITEM       (TCM_FIRST + 51)
  5376. #define TabCtrl_HighlightItem(hwnd, i, fHighlight) \
  5377.     (BOOL)SNDMSG((hwnd), TCM_HIGHLIGHTITEM, (WPARAM)(i), (LPARAM)MAKELONG (fHighlight, 0))
  5378.  
  5379. #define TCM_SETEXTENDEDSTYLE    (TCM_FIRST + 52)  // optional wParam == mask
  5380. #define TabCtrl_SetExtendedStyle(hwnd, dw)\
  5381.         (DWORD)SNDMSG((hwnd), TCM_SETEXTENDEDSTYLE, 0, dw)
  5382.  
  5383. #define TCM_GETEXTENDEDSTYLE    (TCM_FIRST + 53)
  5384. #define TabCtrl_GetExtendedStyle(hwnd)\
  5385.         (DWORD)SNDMSG((hwnd), TCM_GETEXTENDEDSTYLE, 0, 0)
  5386.  
  5387. #define TCM_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  5388. #define TabCtrl_SetUnicodeFormat(hwnd, fUnicode)  \
  5389.     (BOOL)SNDMSG((hwnd), TCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  5390.  
  5391. #define TCM_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  5392. #define TabCtrl_GetUnicodeFormat(hwnd)  \
  5393.     (BOOL)SNDMSG((hwnd), TCM_GETUNICODEFORMAT, 0, 0)
  5394.  
  5395. #endif      // _WIN32_IE >= 0x0400
  5396.  
  5397. #define TCN_KEYDOWN             (TCN_FIRST - 0)
  5398.  
  5399. #if (_WIN32_IE >= 0x0300)
  5400. #define TC_KEYDOWN              NMTCKEYDOWN
  5401. #else
  5402. #define tagTCKEYDOWN            _TC_KEYDOWN
  5403. #define  NMTCKEYDOWN             TC_KEYDOWN
  5404. #endif
  5405.  
  5406. #ifdef _WIN32
  5407. #include <pshpack1.h>
  5408. #endif
  5409.  
  5410. typedef struct tagTCKEYDOWN
  5411. {
  5412.     NMHDR hdr;
  5413.     WORD wVKey;
  5414.     UINT flags;
  5415. } NMTCKEYDOWN;
  5416.  
  5417. #ifdef _WIN32
  5418. #include <poppack.h>
  5419. #endif
  5420.  
  5421. #define TCN_SELCHANGE           (TCN_FIRST - 1)
  5422. #define TCN_SELCHANGING         (TCN_FIRST - 2)
  5423. #if (_WIN32_IE >= 0x0400)
  5424. #define TCN_GETOBJECT           (TCN_FIRST - 3)
  5425. #endif      // _WIN32_IE >= 0x0400
  5426. #if (_WIN32_IE >= 0x0500)
  5427. #define TCN_FOCUSCHANGE         (TCN_FIRST - 4)
  5428. #endif      // _WIN32_IE >= 0x0500
  5429. #endif      // NOTABCONTROL
  5430.  
  5431.  
  5432.  
  5433.  
  5434. //====== ANIMATE CONTROL ======================================================
  5435.  
  5436. #ifndef NOANIMATE
  5437.  
  5438. #ifdef _WIN32
  5439.  
  5440. #define ANIMATE_CLASSW          L"SysAnimate32"
  5441. #define ANIMATE_CLASSA          "SysAnimate32"
  5442.  
  5443. #ifdef UNICODE
  5444. #define ANIMATE_CLASS           ANIMATE_CLASSW
  5445. #else
  5446. #define ANIMATE_CLASS           ANIMATE_CLASSA
  5447. #endif
  5448.  
  5449. // begin_r_commctrl
  5450.  
  5451. #define ACS_CENTER              0x0001
  5452. #define ACS_TRANSPARENT         0x0002
  5453. #define ACS_AUTOPLAY            0x0004
  5454. #if (_WIN32_IE >= 0x0300)
  5455. #define ACS_TIMER               0x0008  // don't use threads... use timers
  5456. #endif
  5457.  
  5458. // end_r_commctrl
  5459.  
  5460. #define ACM_OPENA               (WM_USER+100)
  5461. #define ACM_OPENW               (WM_USER+103)
  5462.  
  5463. #ifdef UNICODE
  5464. #define ACM_OPEN                ACM_OPENW
  5465. #else
  5466. #define ACM_OPEN                ACM_OPENA
  5467. #endif
  5468.  
  5469. #define ACM_PLAY                (WM_USER+101)
  5470. #define ACM_STOP                (WM_USER+102)
  5471.  
  5472.  
  5473. #define ACN_START               1
  5474. #define ACN_STOP                2
  5475.  
  5476.  
  5477. #define Animate_Create(hwndP, id, dwStyle, hInstance)   \
  5478.             CreateWindow(ANIMATE_CLASS, NULL,           \
  5479.                 dwStyle, 0, 0, 0, 0, hwndP, (HMENU)(id), hInstance, NULL)
  5480.  
  5481. #define Animate_Open(hwnd, szName)          (BOOL)SNDMSG(hwnd, ACM_OPEN, 0, (LPARAM)(LPTSTR)(szName))
  5482. #define Animate_OpenEx(hwnd, hInst, szName) (BOOL)SNDMSG(hwnd, ACM_OPEN, (WPARAM)(hInst), (LPARAM)(LPTSTR)(szName))
  5483. #define Animate_Play(hwnd, from, to, rep)   (BOOL)SNDMSG(hwnd, ACM_PLAY, (WPARAM)(rep), (LPARAM)MAKELONG(from, to))
  5484. #define Animate_Stop(hwnd)                  (BOOL)SNDMSG(hwnd, ACM_STOP, 0, 0)
  5485. #define Animate_Close(hwnd)                 Animate_Open(hwnd, NULL)
  5486. #define Animate_Seek(hwnd, frame)           Animate_Play(hwnd, frame, frame, 1)
  5487. #endif
  5488.  
  5489. #endif      // NOANIMATE
  5490.  
  5491. #if (_WIN32_IE >= 0x0300)
  5492. //====== MONTHCAL CONTROL ======================================================
  5493.  
  5494. #ifndef NOMONTHCAL
  5495. #ifdef _WIN32
  5496.  
  5497. #define MONTHCAL_CLASSW          L"SysMonthCal32"
  5498. #define MONTHCAL_CLASSA          "SysMonthCal32"
  5499.  
  5500. #ifdef UNICODE
  5501. #define MONTHCAL_CLASS           MONTHCAL_CLASSW
  5502. #else
  5503. #define MONTHCAL_CLASS           MONTHCAL_CLASSA
  5504. #endif
  5505.  
  5506. // bit-packed array of "bold" info for a month
  5507. // if a bit is on, that day is drawn bold
  5508. typedef DWORD MONTHDAYSTATE, FAR * LPMONTHDAYSTATE;
  5509.  
  5510.  
  5511. #define MCM_FIRST           0x1000
  5512.  
  5513. // BOOL MonthCal_GetCurSel(HWND hmc, LPSYSTEMTIME pst)
  5514. //   returns FALSE if MCS_MULTISELECT
  5515. //   returns TRUE and sets *pst to the currently selected date otherwise
  5516. #define MCM_GETCURSEL       (MCM_FIRST + 1)
  5517. #define MonthCal_GetCurSel(hmc, pst)    (BOOL)SNDMSG(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst))
  5518.  
  5519. // BOOL MonthCal_SetCurSel(HWND hmc, LPSYSTEMTIME pst)
  5520. //   returns FALSE if MCS_MULTISELECT
  5521. //   returns TURE and sets the currently selected date to *pst otherwise
  5522. #define MCM_SETCURSEL       (MCM_FIRST + 2)
  5523. #define MonthCal_SetCurSel(hmc, pst)    (BOOL)SNDMSG(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst))
  5524.  
  5525. // DWORD MonthCal_GetMaxSelCount(HWND hmc)
  5526. //   returns the maximum number of selectable days allowed
  5527. #define MCM_GETMAXSELCOUNT  (MCM_FIRST + 3)
  5528. #define MonthCal_GetMaxSelCount(hmc)    (DWORD)SNDMSG(hmc, MCM_GETMAXSELCOUNT, 0, 0L)
  5529.  
  5530. // BOOL MonthCal_SetMaxSelCount(HWND hmc, UINT n)
  5531. //   sets the max number days that can be selected iff MCS_MULTISELECT
  5532. #define MCM_SETMAXSELCOUNT  (MCM_FIRST + 4)
  5533. #define MonthCal_SetMaxSelCount(hmc, n) (BOOL)SNDMSG(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L)
  5534.  
  5535. // BOOL MonthCal_GetSelRange(HWND hmc, LPSYSTEMTIME rgst)
  5536. //   sets rgst[0] to the first day of the selection range
  5537. //   sets rgst[1] to the last day of the selection range
  5538. #define MCM_GETSELRANGE     (MCM_FIRST + 5)
  5539. #define MonthCal_GetSelRange(hmc, rgst) SNDMSG(hmc, MCM_GETSELRANGE, 0, (LPARAM)(rgst))
  5540.  
  5541. // BOOL MonthCal_SetSelRange(HWND hmc, LPSYSTEMTIME rgst)
  5542. //   selects the range of days from rgst[0] to rgst[1]
  5543. #define MCM_SETSELRANGE     (MCM_FIRST + 6)
  5544. #define MonthCal_SetSelRange(hmc, rgst) SNDMSG(hmc, MCM_SETSELRANGE, 0, (LPARAM)(rgst))
  5545.  
  5546. // DWORD MonthCal_GetMonthRange(HWND hmc, DWORD gmr, LPSYSTEMTIME rgst)
  5547. //   if rgst specified, sets rgst[0] to the starting date and
  5548. //      and rgst[1] to the ending date of the the selectable (non-grayed)
  5549. //      days if GMR_VISIBLE or all the displayed days (including grayed)
  5550. //      if GMR_DAYSTATE.
  5551. //   returns the number of months spanned by the above range.
  5552. #define MCM_GETMONTHRANGE   (MCM_FIRST + 7)
  5553. #define MonthCal_GetMonthRange(hmc, gmr, rgst)  (DWORD)SNDMSG(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst))
  5554.  
  5555. // BOOL MonthCal_SetDayState(HWND hmc, int cbds, DAYSTATE *rgds)
  5556. //   cbds is the count of DAYSTATE items in rgds and it must be equal
  5557. //   to the value returned from MonthCal_GetMonthRange(hmc, GMR_DAYSTATE, NULL)
  5558. //   This sets the DAYSTATE bits for each month (grayed and non-grayed
  5559. //   days) displayed in the calendar. The first bit in a month's DAYSTATE
  5560. //   corresponts to bolding day 1, the second bit affects day 2, etc.
  5561. #define MCM_SETDAYSTATE     (MCM_FIRST + 8)
  5562. #define MonthCal_SetDayState(hmc, cbds, rgds)   SNDMSG(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds))
  5563.  
  5564. // BOOL MonthCal_GetMinReqRect(HWND hmc, LPRECT prc)
  5565. //   sets *prc the minimal size needed to display one month
  5566. //   To display two months, undo the AdjustWindowRect calculation already done to
  5567. //   this rect, double the width, and redo the AdjustWindowRect calculation --
  5568. //   the monthcal control will display two calendars in this window (if you also
  5569. //   double the vertical size, you will get 4 calendars)
  5570. //   NOTE: if you want to gurantee that the "Today" string is not clipped,
  5571. //   get the MCM_GETMAXTODAYWIDTH and use the max of that width and this width
  5572. #define MCM_GETMINREQRECT   (MCM_FIRST + 9)
  5573. #define MonthCal_GetMinReqRect(hmc, prc)        SNDMSG(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc))
  5574.  
  5575. // set colors to draw control with -- see MCSC_ bits below
  5576. #define MCM_SETCOLOR            (MCM_FIRST + 10)
  5577. #define MonthCal_SetColor(hmc, iColor, clr) SNDMSG(hmc, MCM_SETCOLOR, iColor, clr)
  5578.  
  5579. #define MCM_GETCOLOR            (MCM_FIRST + 11)
  5580. #define MonthCal_GetColor(hmc, iColor) SNDMSG(hmc, MCM_GETCOLOR, iColor, 0)
  5581.  
  5582. #define MCSC_BACKGROUND   0   // the background color (between months)
  5583. #define MCSC_TEXT         1   // the dates
  5584. #define MCSC_TITLEBK      2   // background of the title
  5585. #define MCSC_TITLETEXT    3
  5586. #define MCSC_MONTHBK      4   // background within the month cal
  5587. #define MCSC_TRAILINGTEXT 5   // the text color of header & trailing days
  5588.  
  5589. // set what day is "today"   send NULL to revert back to real date
  5590. #define MCM_SETTODAY    (MCM_FIRST + 12)
  5591. #define MonthCal_SetToday(hmc, pst)             SNDMSG(hmc, MCM_SETTODAY, 0, (LPARAM)(pst))
  5592.  
  5593. // get what day is "today"
  5594. // returns BOOL for success/failure
  5595. #define MCM_GETTODAY    (MCM_FIRST + 13)
  5596. #define MonthCal_GetToday(hmc, pst)             (BOOL)SNDMSG(hmc, MCM_GETTODAY, 0, (LPARAM)(pst))
  5597.  
  5598. // determine what pinfo->pt is over
  5599. #define MCM_HITTEST          (MCM_FIRST + 14)
  5600. #define MonthCal_HitTest(hmc, pinfo) \
  5601.         SNDMSG(hmc, MCM_HITTEST, 0, (LPARAM)(PMCHITTESTINFO)(pinfo))
  5602.  
  5603. typedef struct {
  5604.         UINT cbSize;
  5605.         POINT pt;
  5606.  
  5607.         UINT uHit;   // out param
  5608.         SYSTEMTIME st;
  5609. } MCHITTESTINFO, *PMCHITTESTINFO;
  5610.  
  5611. #define MCHT_TITLE                      0x00010000
  5612. #define MCHT_CALENDAR                   0x00020000
  5613. #define MCHT_TODAYLINK                  0x00030000
  5614.  
  5615. #define MCHT_NEXT                       0x01000000   // these indicate that hitting
  5616. #define MCHT_PREV                       0x02000000  // here will go to the next/prev month
  5617.  
  5618. #define MCHT_NOWHERE                    0x00000000
  5619.  
  5620. #define MCHT_TITLEBK                    (MCHT_TITLE)
  5621. #define MCHT_TITLEMONTH                 (MCHT_TITLE | 0x0001)
  5622. #define MCHT_TITLEYEAR                  (MCHT_TITLE | 0x0002)
  5623. #define MCHT_TITLEBTNNEXT               (MCHT_TITLE | MCHT_NEXT | 0x0003)
  5624. #define MCHT_TITLEBTNPREV               (MCHT_TITLE | MCHT_PREV | 0x0003)
  5625.  
  5626. #define MCHT_CALENDARBK                 (MCHT_CALENDAR)
  5627. #define MCHT_CALENDARDATE               (MCHT_CALENDAR | 0x0001)
  5628. #define MCHT_CALENDARDATENEXT           (MCHT_CALENDARDATE | MCHT_NEXT)
  5629. #define MCHT_CALENDARDATEPREV           (MCHT_CALENDARDATE | MCHT_PREV)
  5630. #define MCHT_CALENDARDAY                (MCHT_CALENDAR | 0x0002)
  5631. #define MCHT_CALENDARWEEKNUM            (MCHT_CALENDAR | 0x0003)
  5632.  
  5633. // set first day of week to iDay:
  5634. // 0 for Monday, 1 for Tuesday, ..., 6 for Sunday
  5635. // -1 for means use locale info
  5636. #define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15)
  5637. #define MonthCal_SetFirstDayOfWeek(hmc, iDay) \
  5638.         SNDMSG(hmc, MCM_SETFIRSTDAYOFWEEK, 0, iDay)
  5639.  
  5640. // DWORD result...  low word has the day.  high word is bool if this is app set
  5641. // or not (FALSE == using locale info)
  5642. #define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16)
  5643. #define MonthCal_GetFirstDayOfWeek(hmc) \
  5644.         (DWORD)SNDMSG(hmc, MCM_GETFIRSTDAYOFWEEK, 0, 0)
  5645.  
  5646. // DWORD MonthCal_GetRange(HWND hmc, LPSYSTEMTIME rgst)
  5647. //   modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
  5648. //   modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
  5649. //   returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
  5650. #define MCM_GETRANGE (MCM_FIRST + 17)
  5651. #define MonthCal_GetRange(hmc, rgst) \
  5652.         (DWORD)SNDMSG(hmc, MCM_GETRANGE, 0, (LPARAM)(rgst))
  5653.  
  5654. // BOOL MonthCal_SetRange(HWND hmc, DWORD gdtr, LPSYSTEMTIME rgst)
  5655. //   if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
  5656. //   if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
  5657. //   returns TRUE on success, FALSE on error (such as invalid parameters)
  5658. #define MCM_SETRANGE (MCM_FIRST + 18)
  5659. #define MonthCal_SetRange(hmc, gd, rgst) \
  5660.         (BOOL)SNDMSG(hmc, MCM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
  5661.  
  5662. // int MonthCal_GetMonthDelta(HWND hmc)
  5663. //   returns the number of months one click on a next/prev button moves by
  5664. #define MCM_GETMONTHDELTA (MCM_FIRST + 19)
  5665. #define MonthCal_GetMonthDelta(hmc) \
  5666.         (int)SNDMSG(hmc, MCM_GETMONTHDELTA, 0, 0)
  5667.  
  5668. // int MonthCal_SetMonthDelta(HWND hmc, int n)
  5669. //   sets the month delta to n. n==0 reverts to moving by a page of months
  5670. //   returns the previous value of n.
  5671. #define MCM_SETMONTHDELTA (MCM_FIRST + 20)
  5672. #define MonthCal_SetMonthDelta(hmc, n) \
  5673.         (int)SNDMSG(hmc, MCM_SETMONTHDELTA, n, 0)
  5674.  
  5675. // DWORD MonthCal_GetMaxTodayWidth(HWND hmc, LPSIZE psz)
  5676. //   sets *psz to the maximum width/height of the "Today" string displayed
  5677. //   at the bottom of the calendar (as long as MCS_NOTODAY is not specified)
  5678. #define MCM_GETMAXTODAYWIDTH (MCM_FIRST + 21)
  5679. #define MonthCal_GetMaxTodayWidth(hmc) \
  5680.         (DWORD)SNDMSG(hmc, MCM_GETMAXTODAYWIDTH, 0, 0)
  5681.  
  5682. #if (_WIN32_IE >= 0x0400)
  5683. #define MCM_SETUNICODEFORMAT     CCM_SETUNICODEFORMAT
  5684. #define MonthCal_SetUnicodeFormat(hwnd, fUnicode)  \
  5685.     (BOOL)SNDMSG((hwnd), MCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  5686.  
  5687. #define MCM_GETUNICODEFORMAT     CCM_GETUNICODEFORMAT
  5688. #define MonthCal_GetUnicodeFormat(hwnd)  \
  5689.     (BOOL)SNDMSG((hwnd), MCM_GETUNICODEFORMAT, 0, 0)
  5690. #endif
  5691.  
  5692. // MCN_SELCHANGE is sent whenever the currently displayed date changes
  5693. // via month change, year change, keyboard navigation, prev/next button
  5694. //
  5695. typedef struct tagNMSELCHANGE
  5696. {
  5697.     NMHDR           nmhdr;  // this must be first, so we don't break WM_NOTIFY
  5698.  
  5699.     SYSTEMTIME      stSelStart;
  5700.     SYSTEMTIME      stSelEnd;
  5701. } NMSELCHANGE, FAR * LPNMSELCHANGE;
  5702.  
  5703. #define MCN_SELCHANGE       (MCN_FIRST + 1)
  5704.  
  5705. // MCN_GETDAYSTATE is sent for MCS_DAYSTATE controls whenever new daystate
  5706. // information is needed (month or year scroll) to draw bolding information.
  5707. // The app must fill in cDayState months worth of information starting from
  5708. // stStart date. The app may fill in the array at prgDayState or change
  5709. // prgDayState to point to a different array out of which the information
  5710. // will be copied. (similar to tooltips)
  5711. //
  5712. typedef struct tagNMDAYSTATE
  5713. {
  5714.     NMHDR           nmhdr;  // this must be first, so we don't break WM_NOTIFY
  5715.  
  5716.     SYSTEMTIME      stStart;
  5717.     int             cDayState;
  5718.  
  5719.     LPMONTHDAYSTATE prgDayState; // points to cDayState MONTHDAYSTATEs
  5720. } NMDAYSTATE, FAR * LPNMDAYSTATE;
  5721.  
  5722. #define MCN_GETDAYSTATE     (MCN_FIRST + 3)
  5723.  
  5724. // MCN_SELECT is sent whenever a selection has occured (via mouse or keyboard)
  5725. //
  5726. typedef NMSELCHANGE NMSELECT, FAR * LPNMSELECT;
  5727.  
  5728.  
  5729. #define MCN_SELECT          (MCN_FIRST + 4)
  5730.  
  5731.  
  5732. // begin_r_commctrl
  5733.  
  5734. #define MCS_DAYSTATE        0x0001
  5735. #define MCS_MULTISELECT     0x0002
  5736. #define MCS_WEEKNUMBERS     0x0004
  5737. #if (_WIN32_IE >= 0x0400)
  5738. #define MCS_NOTODAYCIRCLE   0x0008
  5739. #define MCS_NOTODAY         0x0010
  5740. #else
  5741. #define MCS_NOTODAY         0x0008
  5742. #endif
  5743.  
  5744.  
  5745. // end_r_commctrl
  5746.  
  5747. #define GMR_VISIBLE     0       // visible portion of display
  5748. #define GMR_DAYSTATE    1       // above plus the grayed out parts of
  5749.                                 // partially displayed months
  5750.  
  5751.  
  5752. #endif // _WIN32
  5753. #endif // NOMONTHCAL
  5754.  
  5755.  
  5756. //====== DATETIMEPICK CONTROL ==================================================
  5757.  
  5758. #ifndef NODATETIMEPICK
  5759. #ifdef _WIN32
  5760.  
  5761. #define DATETIMEPICK_CLASSW          L"SysDateTimePick32"
  5762. #define DATETIMEPICK_CLASSA          "SysDateTimePick32"
  5763.  
  5764. #ifdef UNICODE
  5765. #define DATETIMEPICK_CLASS           DATETIMEPICK_CLASSW
  5766. #else
  5767. #define DATETIMEPICK_CLASS           DATETIMEPICK_CLASSA
  5768. #endif
  5769.  
  5770. #define DTM_FIRST        0x1000
  5771.  
  5772. // DWORD DateTimePick_GetSystemtime(HWND hdp, LPSYSTEMTIME pst)
  5773. //   returns GDT_NONE if "none" is selected (DTS_SHOWNONE only)
  5774. //   returns GDT_VALID and modifies *pst to be the currently selected value
  5775. #define DTM_GETSYSTEMTIME   (DTM_FIRST + 1)
  5776. #define DateTime_GetSystemtime(hdp, pst)    (DWORD)SNDMSG(hdp, DTM_GETSYSTEMTIME, 0, (LPARAM)(pst))
  5777.  
  5778. // BOOL DateTime_SetSystemtime(HWND hdp, DWORD gd, LPSYSTEMTIME pst)
  5779. //   if gd==GDT_NONE, sets datetimepick to None (DTS_SHOWNONE only)
  5780. //   if gd==GDT_VALID, sets datetimepick to *pst
  5781. //   returns TRUE on success, FALSE on error (such as bad params)
  5782. #define DTM_SETSYSTEMTIME   (DTM_FIRST + 2)
  5783. #define DateTime_SetSystemtime(hdp, gd, pst)    (BOOL)SNDMSG(hdp, DTM_SETSYSTEMTIME, (WPARAM)(gd), (LPARAM)(pst))
  5784.  
  5785. // DWORD DateTime_GetRange(HWND hdp, LPSYSTEMTIME rgst)
  5786. //   modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
  5787. //   modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
  5788. //   returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
  5789. #define DTM_GETRANGE (DTM_FIRST + 3)
  5790. #define DateTime_GetRange(hdp, rgst)  (DWORD)SNDMSG(hdp, DTM_GETRANGE, 0, (LPARAM)(rgst))
  5791.  
  5792. // BOOL DateTime_SetRange(HWND hdp, DWORD gdtr, LPSYSTEMTIME rgst)
  5793. //   if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
  5794. //   if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
  5795. //   returns TRUE on success, FALSE on error (such as invalid parameters)
  5796. #define DTM_SETRANGE (DTM_FIRST + 4)
  5797. #define DateTime_SetRange(hdp, gd, rgst)  (BOOL)SNDMSG(hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
  5798.  
  5799. // BOOL DateTime_SetFormat(HWND hdp, LPCTSTR sz)
  5800. //   sets the display formatting string to sz (see GetDateFormat and GetTimeFormat for valid formatting chars)
  5801. //   NOTE: 'X' is a valid formatting character which indicates that the application
  5802. //   will determine how to display information. Such apps must support DTN_WMKEYDOWN,
  5803. //   DTN_FORMAT, and DTN_FORMATQUERY.
  5804. #define DTM_SETFORMATA (DTM_FIRST + 5)
  5805. #define DTM_SETFORMATW (DTM_FIRST + 50)
  5806.  
  5807. #ifdef UNICODE
  5808. #define DTM_SETFORMAT       DTM_SETFORMATW
  5809. #else
  5810. #define DTM_SETFORMAT       DTM_SETFORMATA
  5811. #endif
  5812.  
  5813. #define DateTime_SetFormat(hdp, sz)  (BOOL)SNDMSG(hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
  5814.  
  5815.  
  5816. #define DTM_SETMCCOLOR    (DTM_FIRST + 6)
  5817. #define DateTime_SetMonthCalColor(hdp, iColor, clr) SNDMSG(hdp, DTM_SETMCCOLOR, iColor, clr)
  5818.  
  5819. #define DTM_GETMCCOLOR    (DTM_FIRST + 7)
  5820. #define DateTime_GetMonthCalColor(hdp, iColor) SNDMSG(hdp, DTM_GETMCCOLOR, iColor, 0)
  5821.  
  5822. // HWND DateTime_GetMonthCal(HWND hdp)
  5823. //   returns the HWND of the MonthCal popup window. Only valid
  5824. // between DTN_DROPDOWN and DTN_CLOSEUP notifications.
  5825. #define DTM_GETMONTHCAL   (DTM_FIRST + 8)
  5826. #define DateTime_GetMonthCal(hdp) (HWND)SNDMSG(hdp, DTM_GETMONTHCAL, 0, 0)
  5827.  
  5828. #if (_WIN32_IE >= 0x0400)
  5829.  
  5830. #define DTM_SETMCFONT     (DTM_FIRST + 9)
  5831. #define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) SNDMSG(hdp, DTM_SETMCFONT, (WPARAM)(hfont), (LPARAM)(fRedraw))
  5832.  
  5833. #define DTM_GETMCFONT     (DTM_FIRST + 10)
  5834. #define DateTime_GetMonthCalFont(hdp) SNDMSG(hdp, DTM_GETMCFONT, 0, 0)
  5835.  
  5836. #endif      // _WIN32_IE >= 0x0400
  5837.  
  5838. // begin_r_commctrl
  5839.  
  5840. #define DTS_UPDOWN          0x0001 // use UPDOWN instead of MONTHCAL
  5841. #define DTS_SHOWNONE        0x0002 // allow a NONE selection
  5842. #define DTS_SHORTDATEFORMAT 0x0000 // use the short date format (app must forward WM_WININICHANGE messages)
  5843. #define DTS_LONGDATEFORMAT  0x0004 // use the long date format (app must forward WM_WININICHANGE messages)
  5844. #if (_WIN32_IE >= 0x500)
  5845. #define DTS_SHORTDATECENTURYFORMAT 0x000C// short date format with century (app must forward WM_WININICHANGE messages)
  5846. #endif // (_WIN32_IE >= 0x500)
  5847. #define DTS_TIMEFORMAT      0x0009 // use the time format (app must forward WM_WININICHANGE messages)
  5848. #define DTS_APPCANPARSE     0x0010 // allow user entered strings (app MUST respond to DTN_USERSTRING)
  5849. #define DTS_RIGHTALIGN      0x0020 // right-align popup instead of left-align it
  5850.  
  5851. // end_r_commctrl
  5852.  
  5853. #define DTN_DATETIMECHANGE  (DTN_FIRST + 1) // the systemtime has changed
  5854. typedef struct tagNMDATETIMECHANGE
  5855. {
  5856.     NMHDR       nmhdr;
  5857.     DWORD       dwFlags;    // GDT_VALID or GDT_NONE
  5858.     SYSTEMTIME  st;         // valid iff dwFlags==GDT_VALID
  5859. } NMDATETIMECHANGE, FAR * LPNMDATETIMECHANGE;
  5860.  
  5861. #define DTN_USERSTRINGA  (DTN_FIRST + 2) // the user has entered a string
  5862. #define DTN_USERSTRINGW  (DTN_FIRST + 15)
  5863. typedef struct tagNMDATETIMESTRINGA
  5864. {
  5865.     NMHDR      nmhdr;
  5866.     LPCSTR     pszUserString;  // string user entered
  5867.     SYSTEMTIME st;             // app fills this in
  5868.     DWORD      dwFlags;        // GDT_VALID or GDT_NONE
  5869. } NMDATETIMESTRINGA, FAR * LPNMDATETIMESTRINGA;
  5870.  
  5871. typedef struct tagNMDATETIMESTRINGW
  5872. {
  5873.     NMHDR      nmhdr;
  5874.     LPCWSTR    pszUserString;  // string user entered
  5875.     SYSTEMTIME st;             // app fills this in
  5876.     DWORD      dwFlags;        // GDT_VALID or GDT_NONE
  5877. } NMDATETIMESTRINGW, FAR * LPNMDATETIMESTRINGW;
  5878.  
  5879. #ifdef UNICODE
  5880. #define DTN_USERSTRING          DTN_USERSTRINGW
  5881. #define NMDATETIMESTRING        NMDATETIMESTRINGW
  5882. #define LPNMDATETIMESTRING      LPNMDATETIMESTRINGW
  5883. #else
  5884. #define DTN_USERSTRING          DTN_USERSTRINGA
  5885. #define NMDATETIMESTRING        NMDATETIMESTRINGA
  5886. #define LPNMDATETIMESTRING      LPNMDATETIMESTRINGA
  5887. #endif
  5888.  
  5889.  
  5890. #define DTN_WMKEYDOWNA  (DTN_FIRST + 3) // modify keydown on app format field (X)
  5891. #define DTN_WMKEYDOWNW  (DTN_FIRST + 16)
  5892. typedef struct tagNMDATETIMEWMKEYDOWNA
  5893. {
  5894.     NMHDR      nmhdr;
  5895.     int        nVirtKey;  // virtual key code of WM_KEYDOWN which MODIFIES an X field
  5896.     LPCSTR     pszFormat; // format substring
  5897.     SYSTEMTIME st;        // current systemtime, app should modify based on key
  5898. } NMDATETIMEWMKEYDOWNA, FAR * LPNMDATETIMEWMKEYDOWNA;
  5899.  
  5900. typedef struct tagNMDATETIMEWMKEYDOWNW
  5901. {
  5902.     NMHDR      nmhdr;
  5903.     int        nVirtKey;  // virtual key code of WM_KEYDOWN which MODIFIES an X field
  5904.     LPCWSTR    pszFormat; // format substring
  5905.     SYSTEMTIME st;        // current systemtime, app should modify based on key
  5906. } NMDATETIMEWMKEYDOWNW, FAR * LPNMDATETIMEWMKEYDOWNW;
  5907.  
  5908. #ifdef UNICODE
  5909. #define DTN_WMKEYDOWN           DTN_WMKEYDOWNW
  5910. #define NMDATETIMEWMKEYDOWN     NMDATETIMEWMKEYDOWNW
  5911. #define LPNMDATETIMEWMKEYDOWN   LPNMDATETIMEWMKEYDOWNW
  5912. #else
  5913. #define DTN_WMKEYDOWN           DTN_WMKEYDOWNA
  5914. #define NMDATETIMEWMKEYDOWN     NMDATETIMEWMKEYDOWNA
  5915. #define LPNMDATETIMEWMKEYDOWN   LPNMDATETIMEWMKEYDOWNA
  5916. #endif
  5917.  
  5918.  
  5919. #define DTN_FORMATA  (DTN_FIRST + 4) // query display for app format field (X)
  5920. #define DTN_FORMATW  (DTN_FIRST + 17)
  5921. typedef struct tagNMDATETIMEFORMATA
  5922. {
  5923.     NMHDR nmhdr;
  5924.     LPCSTR  pszFormat;   // format substring
  5925.     SYSTEMTIME st;       // current systemtime
  5926.     LPCSTR pszDisplay;   // string to display
  5927.     CHAR szDisplay[64];  // buffer pszDisplay originally points at
  5928. } NMDATETIMEFORMATA, FAR * LPNMDATETIMEFORMATA;
  5929.  
  5930. typedef struct tagNMDATETIMEFORMATW
  5931. {
  5932.     NMHDR nmhdr;
  5933.     LPCWSTR pszFormat;   // format substring
  5934.     SYSTEMTIME st;       // current systemtime
  5935.     LPCWSTR pszDisplay;  // string to display
  5936.     WCHAR szDisplay[64]; // buffer pszDisplay originally points at
  5937. } NMDATETIMEFORMATW, FAR * LPNMDATETIMEFORMATW;
  5938.  
  5939. #ifdef UNICODE
  5940. #define DTN_FORMAT             DTN_FORMATW
  5941. #define NMDATETIMEFORMAT        NMDATETIMEFORMATW
  5942. #define LPNMDATETIMEFORMAT      LPNMDATETIMEFORMATW
  5943. #else
  5944. #define DTN_FORMAT             DTN_FORMATA
  5945. #define NMDATETIMEFORMAT        NMDATETIMEFORMATA
  5946. #define LPNMDATETIMEFORMAT      LPNMDATETIMEFORMATA
  5947. #endif
  5948.  
  5949.  
  5950. #define DTN_FORMATQUERYA  (DTN_FIRST + 5) // query formatting info for app format field (X)
  5951. #define DTN_FORMATQUERYW (DTN_FIRST + 18)
  5952. typedef struct tagNMDATETIMEFORMATQUERYA
  5953. {
  5954.     NMHDR nmhdr;
  5955.     LPCSTR pszFormat;  // format substring
  5956.     SIZE szMax;        // max bounding rectangle app will use for this format string
  5957. } NMDATETIMEFORMATQUERYA, FAR * LPNMDATETIMEFORMATQUERYA;
  5958.  
  5959. typedef struct tagNMDATETIMEFORMATQUERYW
  5960. {
  5961.     NMHDR nmhdr;
  5962.     LPCWSTR pszFormat; // format substring
  5963.     SIZE szMax;        // max bounding rectangle app will use for this format string
  5964. } NMDATETIMEFORMATQUERYW, FAR * LPNMDATETIMEFORMATQUERYW;
  5965.  
  5966. #ifdef UNICODE
  5967. #define DTN_FORMATQUERY         DTN_FORMATQUERYW
  5968. #define NMDATETIMEFORMATQUERY   NMDATETIMEFORMATQUERYW
  5969. #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYW
  5970. #else
  5971. #define DTN_FORMATQUERY         DTN_FORMATQUERYA
  5972. #define NMDATETIMEFORMATQUERY   NMDATETIMEFORMATQUERYA
  5973. #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYA
  5974. #endif
  5975.  
  5976.  
  5977. #define DTN_DROPDOWN    (DTN_FIRST + 6) // MonthCal has dropped down
  5978. #define DTN_CLOSEUP     (DTN_FIRST + 7) // MonthCal is popping up
  5979.  
  5980.  
  5981. #define GDTR_MIN     0x0001
  5982. #define GDTR_MAX     0x0002
  5983.  
  5984. #define GDT_ERROR    -1
  5985. #define GDT_VALID    0
  5986. #define GDT_NONE     1
  5987.  
  5988.  
  5989. #endif // _WIN32
  5990. #endif // NODATETIMEPICK
  5991.  
  5992.  
  5993. #if (_WIN32_IE >= 0x0400)
  5994.  
  5995. #ifndef NOIPADDRESS
  5996.  
  5997. ///////////////////////////////////////////////
  5998. ///    IP Address edit control
  5999.  
  6000. // Messages sent to IPAddress controls
  6001.  
  6002. #define IPM_CLEARADDRESS (WM_USER+100) // no parameters
  6003. #define IPM_SETADDRESS   (WM_USER+101) // lparam = TCP/IP address
  6004. #define IPM_GETADDRESS   (WM_USER+102) // lresult = # of non black fields.  lparam = LPDWORD for TCP/IP address
  6005. #define IPM_SETRANGE (WM_USER+103) // wparam = field, lparam = range
  6006. #define IPM_SETFOCUS (WM_USER+104) // wparam = field
  6007. #define IPM_ISBLANK  (WM_USER+105) // no parameters
  6008.  
  6009. #define WC_IPADDRESSW           L"SysIPAddress32"
  6010. #define WC_IPADDRESSA           "SysIPAddress32"
  6011.  
  6012. #ifdef UNICODE
  6013. #define WC_IPADDRESS          WC_IPADDRESSW
  6014. #else
  6015. #define WC_IPADDRESS          WC_IPADDRESSA
  6016. #endif
  6017.  
  6018. #define IPN_FIELDCHANGED                (IPN_FIRST - 0)
  6019. typedef struct tagNMIPADDRESS
  6020. {
  6021.         NMHDR hdr;
  6022.         int iField;
  6023.         int iValue;
  6024. } NMIPADDRESS, *LPNMIPADDRESS;
  6025.  
  6026. // The following is a useful macro for passing the range values in the
  6027. // IPM_SETRANGE message.
  6028.  
  6029. #define MAKEIPRANGE(low, high)    ((LPARAM)(WORD)(((BYTE)(high) << 8) + (BYTE)(low)))
  6030.  
  6031. // And this is a useful macro for making the IP Address to be passed
  6032. // as a LPARAM.
  6033.  
  6034. #define MAKEIPADDRESS(b1,b2,b3,b4)  ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4))))
  6035.  
  6036. // Get individual number
  6037. #define FIRST_IPADDRESS(x)  ((x>>24) & 0xff)
  6038. #define SECOND_IPADDRESS(x) ((x>>16) & 0xff)
  6039. #define THIRD_IPADDRESS(x)  ((x>>8) & 0xff)
  6040. #define FOURTH_IPADDRESS(x) (x & 0xff)
  6041.  
  6042.  
  6043. #endif // NOIPADDRESS
  6044.  
  6045.  
  6046. //---------------------------------------------------------------------------------------
  6047. //---------------------------------------------------------------------------------------
  6048. ///  ====================== Pager Control =============================
  6049. //---------------------------------------------------------------------------------------
  6050. //---------------------------------------------------------------------------------------
  6051.  
  6052. #ifndef NOPAGESCROLLER
  6053.  
  6054. //Pager Class Name
  6055. #define WC_PAGESCROLLERW           L"SysPager"
  6056. #define WC_PAGESCROLLERA           "SysPager"
  6057.  
  6058. #ifdef UNICODE
  6059. #define WC_PAGESCROLLER          WC_PAGESCROLLERW
  6060. #else
  6061. #define WC_PAGESCROLLER          WC_PAGESCROLLERA
  6062. #endif
  6063.  
  6064.  
  6065. //---------------------------------------------------------------------------------------
  6066. // Pager Control Styles
  6067. //---------------------------------------------------------------------------------------
  6068. // begin_r_commctrl
  6069.  
  6070. #define PGS_VERT                0x00000000
  6071. #define PGS_HORZ                0x00000001
  6072. #define PGS_AUTOSCROLL          0x00000002
  6073. #define PGS_DRAGNDROP           0x00000004
  6074.  
  6075. // end_r_commctrl
  6076.  
  6077.  
  6078. //---------------------------------------------------------------------------------------
  6079. // Pager Button State
  6080. //---------------------------------------------------------------------------------------
  6081. //The scroll can be in one of the following control State
  6082. #define  PGF_INVISIBLE   0      // Scroll button is not visible
  6083. #define  PGF_NORMAL      1      // Scroll button is in normal state
  6084. #define  PGF_GRAYED      2      // Scroll button is in grayed state
  6085. #define  PGF_DEPRESSED   4      // Scroll button is in depressed state
  6086. #define  PGF_HOT         8      // Scroll button is in hot state
  6087.  
  6088.  
  6089. // The following identifiers specifies the button control
  6090. #define PGB_TOPORLEFT       0
  6091. #define PGB_BOTTOMORRIGHT   1
  6092.  
  6093. //---------------------------------------------------------------------------------------
  6094. // Pager Control  Messages
  6095. //---------------------------------------------------------------------------------------
  6096. #define PGM_SETCHILD            (PGM_FIRST + 1)  // lParam == hwnd
  6097. #define Pager_SetChild(hwnd, hwndChild) \
  6098.         (void)SNDMSG((hwnd), PGM_SETCHILD, 0, (LPARAM)(hwndChild))
  6099.  
  6100. #define PGM_RECALCSIZE          (PGM_FIRST + 2)
  6101. #define Pager_RecalcSize(hwnd) \
  6102.         (void)SNDMSG((hwnd), PGM_RECALCSIZE, 0, 0)
  6103.  
  6104. #define PGM_FORWARDMOUSE        (PGM_FIRST + 3)
  6105. #define Pager_ForwardMouse(hwnd, bForward) \
  6106.         (void)SNDMSG((hwnd), PGM_FORWARDMOUSE, (WPARAM)(bForward), 0)
  6107.  
  6108. #define PGM_SETBKCOLOR          (PGM_FIRST + 4)
  6109. #define Pager_SetBkColor(hwnd, clr) \
  6110.         (COLORREF)SNDMSG((hwnd), PGM_SETBKCOLOR, 0, (LPARAM)(clr))
  6111.  
  6112. #define PGM_GETBKCOLOR          (PGM_FIRST + 5)
  6113. #define Pager_GetBkColor(hwnd) \
  6114.         (COLORREF)SNDMSG((hwnd), PGM_GETBKCOLOR, 0, 0)
  6115.  
  6116. #define PGM_SETBORDER          (PGM_FIRST + 6)
  6117. #define Pager_SetBorder(hwnd, iBorder) \
  6118.         (int)SNDMSG((hwnd), PGM_SETBORDER, 0, (LPARAM)(iBorder))
  6119.  
  6120. #define PGM_GETBORDER          (PGM_FIRST + 7)
  6121. #define Pager_GetBorder(hwnd) \
  6122.         (int)SNDMSG((hwnd), PGM_GETBORDER, 0, 0)
  6123.  
  6124. #define PGM_SETPOS              (PGM_FIRST + 8)
  6125. #define Pager_SetPos(hwnd, iPos) \
  6126.         (int)SNDMSG((hwnd), PGM_SETPOS, 0, (LPARAM)(iPos))
  6127.  
  6128. #define PGM_GETPOS              (PGM_FIRST + 9)
  6129. #define Pager_GetPos(hwnd) \
  6130.         (int)SNDMSG((hwnd), PGM_GETPOS, 0, 0)
  6131.  
  6132. #define PGM_SETBUTTONSIZE       (PGM_FIRST + 10)
  6133. #define Pager_SetButtonSize(hwnd, iSize) \
  6134.         (int)SNDMSG((hwnd), PGM_SETBUTTONSIZE, 0, (LPARAM)(iSize))
  6135.  
  6136. #define PGM_GETBUTTONSIZE       (PGM_FIRST + 11)
  6137. #define Pager_GetButtonSize(hwnd) \
  6138.         (int)SNDMSG((hwnd), PGM_GETBUTTONSIZE, 0,0)
  6139.  
  6140. #define PGM_GETBUTTONSTATE      (PGM_FIRST + 12)
  6141. #define Pager_GetButtonState(hwnd, iButton) \
  6142.         (DWORD)SNDMSG((hwnd), PGM_GETBUTTONSTATE, 0, (LPARAM)(iButton))
  6143.  
  6144. #define PGM_GETDROPTARGET       CCM_GETDROPTARGET
  6145. #define Pager_GetDropTarget(hwnd, ppdt) \
  6146.         (void)SNDMSG((hwnd), PGM_GETDROPTARGET, 0, (LPARAM)(ppdt))
  6147. //---------------------------------------------------------------------------------------
  6148. //Pager Control Notification Messages
  6149. //---------------------------------------------------------------------------------------
  6150.  
  6151.  
  6152. // PGN_SCROLL Notification Message
  6153.  
  6154. #define PGN_SCROLL          (PGN_FIRST-1)
  6155.  
  6156. #define PGF_SCROLLUP        1
  6157. #define PGF_SCROLLDOWN      2
  6158. #define PGF_SCROLLLEFT      4
  6159. #define PGF_SCROLLRIGHT     8
  6160.  
  6161.  
  6162. //Keys down
  6163. #define PGK_SHIFT           1
  6164. #define PGK_CONTROL         2
  6165. #define PGK_MENU            4
  6166.  
  6167.  
  6168. #ifdef _WIN32
  6169. #include <pshpack1.h>
  6170. #endif
  6171.  
  6172. // This structure is sent along with PGN_SCROLL notifications
  6173. typedef struct {
  6174.     NMHDR hdr;
  6175.     WORD fwKeys;            // Specifies which keys are down when this notification is send
  6176.     RECT rcParent;          // Contains Parent Window Rect
  6177.     int  iDir;              // Scrolling Direction
  6178.     int  iXpos;             // Horizontal scroll position
  6179.     int  iYpos;             // Vertical scroll position
  6180.     int  iScroll;           // [in/out] Amount to scroll
  6181. }NMPGSCROLL, *LPNMPGSCROLL;
  6182.  
  6183. #ifdef _WIN32
  6184. #include <poppack.h>
  6185. #endif
  6186.  
  6187. // PGN_CALCSIZE Notification Message
  6188.  
  6189. #define PGN_CALCSIZE        (PGN_FIRST-2)
  6190.  
  6191. #define PGF_CALCWIDTH       1
  6192. #define PGF_CALCHEIGHT      2
  6193.  
  6194. typedef struct {
  6195.     NMHDR   hdr;
  6196.     DWORD   dwFlag;
  6197.     int     iWidth;
  6198.     int     iHeight;
  6199. }NMPGCALCSIZE, *LPNMPGCALCSIZE;
  6200.  
  6201. #endif // NOPAGESCROLLER
  6202.  
  6203. ////======================  End Pager Control ==========================================
  6204.  
  6205. //
  6206. // === Native Font Control ===
  6207. //
  6208. #ifndef NONATIVEFONTCTL
  6209. //NativeFont Class Name
  6210. #define WC_NATIVEFONTCTLW           L"NativeFontCtl"
  6211. #define WC_NATIVEFONTCTLA           "NativeFontCtl"
  6212.  
  6213. #ifdef UNICODE
  6214. #define WC_NATIVEFONTCTL          WC_NATIVEFONTCTLW
  6215. #else
  6216. #define WC_NATIVEFONTCTL          WC_NATIVEFONTCTLA
  6217. #endif
  6218.  
  6219. // begin_r_commctrl
  6220.  
  6221. // style definition
  6222. #define NFS_EDIT                0x0001
  6223. #define NFS_STATIC              0x0002
  6224. #define NFS_LISTCOMBO           0x0004
  6225. #define NFS_BUTTON              0x0008
  6226. #define NFS_ALL                 0x0010
  6227. #define NFS_USEFONTASSOC        0x0020
  6228.  
  6229. // end_r_commctrl
  6230.  
  6231. #endif // NONATIVEFONTCTL
  6232. // === End Native Font Control ===
  6233.  
  6234. //
  6235. // === MUI APIs ===
  6236. //
  6237. #ifndef NOMUI
  6238. void WINAPI InitMUILanguage(LANGID uiLang);
  6239.  
  6240. LANGID WINAPI GetMUILanguage(void);
  6241. #endif  // NOMUI
  6242.  
  6243. #endif      // _WIN32_IE >= 0x0400
  6244.  
  6245. #ifdef _WIN32
  6246. //====== TrackMouseEvent  =====================================================
  6247.  
  6248. #ifndef NOTRACKMOUSEEVENT
  6249.  
  6250. //
  6251. // If the messages for TrackMouseEvent have not been defined then define them
  6252. // now.
  6253. //
  6254. #ifndef WM_MOUSEHOVER
  6255. #define WM_MOUSEHOVER                   0x02A1
  6256. #define WM_MOUSELEAVE                   0x02A3
  6257. #endif
  6258.  
  6259. //
  6260. // If the TRACKMOUSEEVENT structure and associated flags havent been declared
  6261. // then declare them now.
  6262. //
  6263. #ifndef TME_HOVER
  6264.  
  6265. #define TME_HOVER       0x00000001
  6266. #define TME_LEAVE       0x00000002
  6267. #if (WINVER >= 0x0500)
  6268. #define TME_NONCLIENT   0x00000010
  6269. #endif /* WINVER >= 0x0500 */
  6270. #define TME_QUERY       0x40000000
  6271. #define TME_CANCEL      0x80000000
  6272.  
  6273.  
  6274.  
  6275. #define HOVER_DEFAULT   0xFFFFFFFF
  6276.  
  6277. typedef struct tagTRACKMOUSEEVENT {
  6278.     DWORD cbSize;
  6279.     DWORD dwFlags;
  6280.     HWND  hwndTrack;
  6281.     DWORD dwHoverTime;
  6282. } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
  6283.  
  6284. #endif // !TME_HOVER
  6285.  
  6286. //
  6287. // Declare _TrackMouseEvent.  This API tries to use the window manager's
  6288. // implementation of TrackMouseEvent if it is present, otherwise it emulates.
  6289. //
  6290. WINCOMMCTRLAPI
  6291. BOOL
  6292. WINAPI
  6293. _TrackMouseEvent(
  6294.     LPTRACKMOUSEEVENT lpEventTrack);
  6295.  
  6296. #endif // !NOTRACKMOUSEEVENT
  6297.  
  6298. #if (_WIN32_IE >= 0x0400)
  6299.  
  6300. //====== Flat Scrollbar APIs=========================================
  6301. #ifndef NOFLATSBAPIS
  6302.  
  6303. #define WSB_PROP_CYVSCROLL  0x00000001L
  6304. #define WSB_PROP_CXHSCROLL  0x00000002L
  6305. #define WSB_PROP_CYHSCROLL  0x00000004L
  6306. #define WSB_PROP_CXVSCROLL  0x00000008L
  6307. #define WSB_PROP_CXHTHUMB   0x00000010L
  6308. #define WSB_PROP_CYVTHUMB   0x00000020L
  6309. #define WSB_PROP_VBKGCOLOR  0x00000040L
  6310. #define WSB_PROP_HBKGCOLOR  0x00000080L
  6311. #define WSB_PROP_VSTYLE     0x00000100L
  6312. #define WSB_PROP_HSTYLE     0x00000200L
  6313. #define WSB_PROP_WINSTYLE   0x00000400L
  6314. #define WSB_PROP_PALETTE    0x00000800L
  6315. #define WSB_PROP_MASK       0x00000FFFL
  6316.  
  6317. #define FSB_FLAT_MODE           2
  6318. #define FSB_ENCARTA_MODE        1
  6319. #define FSB_REGULAR_MODE        0
  6320.  
  6321. WINCOMMCTRLAPI BOOL WINAPI FlatSB_EnableScrollBar(HWND, int, UINT);
  6322. WINCOMMCTRLAPI BOOL WINAPI FlatSB_ShowScrollBar(HWND, int code, BOOL);
  6323.  
  6324. WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollRange(HWND, int code, LPINT, LPINT);
  6325. WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollInfo(HWND, int code, LPSCROLLINFO);
  6326. WINCOMMCTRLAPI int WINAPI FlatSB_GetScrollPos(HWND, int code);
  6327. WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollProp(HWND, int propIndex, LPINT);
  6328. #ifdef _WIN64
  6329. WINCOMMCTRLAPI BOOL WINAPI FlatSB_GetScrollPropPtr(HWND, int propIndex, PINT_PTR);
  6330. #else
  6331. #define FlatSB_GetScrollPropPtr  FlatSB_GetScrollProp
  6332. #endif
  6333.  
  6334. WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollPos(HWND, int code, int pos, BOOL fRedraw);
  6335. WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollInfo(HWND, int code, LPSCROLLINFO, BOOL fRedraw);
  6336.  
  6337. WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollRange(HWND, int code, int min, int max, BOOL fRedraw);
  6338. WINCOMMCTRLAPI BOOL WINAPI FlatSB_SetScrollProp(HWND, UINT index, INT_PTR newValue, BOOL);
  6339. #define FlatSB_SetScrollPropPtr FlatSB_SetScrollProp
  6340.  
  6341. WINCOMMCTRLAPI BOOL WINAPI InitializeFlatSB(HWND);
  6342. WINCOMMCTRLAPI HRESULT WINAPI UninitializeFlatSB(HWND);
  6343.  
  6344. #endif  //  NOFLATSBAPIS
  6345.  
  6346. #endif      // _WIN32_IE >= 0x0400
  6347.  
  6348. #endif /* _WIN32 */
  6349.  
  6350. #endif      // _WIN32_IE >= 0x0300
  6351.  
  6352.  
  6353.  
  6354. #ifdef __cplusplus
  6355. }
  6356. #endif
  6357.  
  6358. #endif
  6359.  
  6360.  
  6361. #pragma option pop /*P_O_Pop*/
  6362. #endif  // _INC_COMMCTRL
  6363.  
  6364.