Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4659 lines
150 KiB

4 years ago
  1. ;begin_both
  2. /*****************************************************************************\
  3. * *
  4. * commctrl.h - - Interface for the Windows Common Controls *
  5. * *
  6. * Version 1.2 *
  7. * *
  8. * Copyright (c) 1991-1996, Microsoft Corp. All rights reserved. *
  9. * *
  10. \*****************************************************************************/
  11. ;end_both
  12. /*REVIEW: this stuff needs Windows style in many places; find all REVIEWs. */ ;Internal
  13. ;Internal
  14. #ifndef _INC_COMMCTRL
  15. #define _INC_COMMCTRL
  16. #ifndef _INC_COMCTRLP ;internal
  17. #define _INC_COMCTRLP ;internal
  18. ;begin_both
  19. #ifndef NOUSER
  20. ;end_both
  21. //
  22. // Define API decoration for direct importing of DLL references.
  23. //
  24. #ifndef WINCOMMCTRLAPI
  25. #if !defined(_COMCTL32_) && defined(_WIN32)
  26. #define WINCOMMCTRLAPI DECLSPEC_IMPORT
  27. #else
  28. #define WINCOMMCTRLAPI
  29. #endif
  30. #endif // WINCOMMCTRLAPI
  31. //
  32. // For compilers that don't support nameless unions
  33. //
  34. #ifndef DUMMYUNIONNAME
  35. #ifdef NONAMELESSUNION
  36. #define DUMMYUNIONNAME u
  37. #define DUMMYUNIONNAME2 u2
  38. #define DUMMYUNIONNAME3 u3
  39. #else
  40. #define DUMMYUNIONNAME
  41. #define DUMMYUNIONNAME2
  42. #define DUMMYUNIONNAME3
  43. #endif
  44. #endif // DUMMYUNIONNAME
  45. ;begin_both
  46. #ifdef _WIN32
  47. #include <pshpack1.h>
  48. #endif
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52. //
  53. // Users of this header may define any number of these constants to avoid
  54. // the definitions of each functional group.
  55. //
  56. ;end_both
  57. // NOTOOLBAR Customizable bitmap-button toolbar control.
  58. // NOUPDOWN Up and Down arrow increment/decrement control.
  59. // NOSTATUSBAR Status bar control.
  60. // NOMENUHELP APIs to help manage menus, especially with a status bar.
  61. // NOTRACKBAR Customizable column-width tracking control.
  62. // NOBTNLIST A control which is a list of bitmap buttons. ;Internal
  63. // NODRAGLIST APIs to make a listbox source and sink drag&drop actions.
  64. // NOPROGRESS Progress gas gauge.
  65. // NOHOTKEY HotKey control
  66. // NOHEADER Header bar control.
  67. // NOIMAGEAPIS ImageList apis.
  68. // NOLISTVIEW ListView control.
  69. // NOTREEVIEW TreeView control.
  70. // NOTABCONTROL Tab control.
  71. // NOANIMATE Animate control.
  72. ;begin_both
  73. //
  74. //=============================================================================
  75. ;end_both
  76. #include <prsht.h>
  77. #if defined (WINNT) || defined (WINNT_ENV) ;internal
  78. #include <prshtp.h> ;internal
  79. #endif ;internal
  80. #ifndef SNDMSG
  81. #ifdef __cplusplus
  82. #define SNDMSG ::SendMessage
  83. #else
  84. #define SNDMSG SendMessage
  85. #endif
  86. #endif // ifndef SNDMSG
  87. // BUGBUG: we want to remove this to force new apps to use the Ex version ;internal
  88. WINCOMMCTRLAPI void WINAPI InitCommonControls(void);
  89. typedef struct tagINITCOMMONCONTROLSEX {
  90. DWORD dwSize; // size of this structure
  91. DWORD dwICC; // flags indicating which classes to be initialized
  92. } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
  93. #define ICC_LISTVIEW_CLASSES 0x00000001 // listview, header
  94. #define ICC_TREEVIEW_CLASSES 0x00000002 // treeview, tooltips
  95. #define ICC_BAR_CLASSES 0x00000004 // toolbar, statusbar, trackbar, tooltips
  96. #define ICC_TAB_CLASSES 0x00000008 // tab, tooltips
  97. #define ICC_UPDOWN_CLASS 0x00000010 // updown
  98. #define ICC_PROGRESS_CLASS 0x00000020 // progress
  99. #define ICC_HOTKEY_CLASS 0x00000040 // hotkey
  100. #define ICC_ANIMATE_CLASS 0x00000080 // animate
  101. #define ICC_WIN95_CLASSES 0x000000FF
  102. #define ICC_DATE_CLASSES 0x00000100 // month picker, date picker, time picker, updown
  103. #define ICC_USEREX_CLASSES 0x00000200 // comboex
  104. #define ICC_COOL_CLASSES 0x00000400 // rebar (coolbar) control
  105. #define ICC_ALL_CLASSES 0x000007FF // ;Internal
  106. WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
  107. // BUGBUG: should be in windows.h? ;Internal
  108. #define ODT_HEADER 100
  109. #define ODT_TAB 101
  110. #define ODT_LISTVIEW 102
  111. //====== Ranges for control message IDs =======================================
  112. #define LVM_FIRST 0x1000 // ListView messages
  113. #define TV_FIRST 0x1100 // TreeView messages
  114. #define HDM_FIRST 0x1200 // Header messages
  115. ;begin_internal
  116. WINCOMMCTRLAPI LRESULT WINAPI SendNotify(HWND hwndTo, HWND hwndFrom, int code, NMHDR FAR* pnmhdr);
  117. WINCOMMCTRLAPI LRESULT WINAPI SendNotifyEx(HWND hwndTo, HWND hwndFrom, int code, NMHDR FAR* pnmhdr, BOOL bUnicode);
  118. ;end_internal
  119. //====== WM_NOTIFY Macros =====================================================
  120. #define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \
  121. (fn)((hwnd), (int)(wParam), (NMHDR FAR*)(lParam))
  122. #define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) \
  123. (LRESULT)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(idFrom), (LPARAM)(NMHDR FAR*)(pnmhdr))
  124. //====== Generic WM_NOTIFY notification codes =================================
  125. #define NM_OUTOFMEMORY (NM_FIRST-1)
  126. #define NM_CLICK (NM_FIRST-2)
  127. #define NM_DBLCLK (NM_FIRST-3)
  128. #define NM_RETURN (NM_FIRST-4)
  129. #define NM_RCLICK (NM_FIRST-5)
  130. #define NM_RDBLCLK (NM_FIRST-6)
  131. #define NM_SETFOCUS (NM_FIRST-7)
  132. #define NM_KILLFOCUS (NM_FIRST-8)
  133. #define NM_STARTWAIT (NM_FIRST-9) ;Internal
  134. #define NM_ENDWAIT (NM_FIRST-10) ;Internal
  135. #define NM_BTNCLK (NM_FIRST-11) ;Internal
  136. #define NM_CUSTOMDRAW (NM_FIRST-12)
  137. #define NM_HOVER (NM_FIRST-13)
  138. //====== WM_NOTIFY codes (NMHDR.code values) ==================================
  139. #define NM_FIRST (0U- 0U) // generic to all controls
  140. #define NM_LAST (0U- 99U)
  141. #define LVN_FIRST (0U-100U) // listview
  142. #define LVN_LAST (0U-199U)
  143. #define HDN_FIRST (0U-300U) // header
  144. #define HDN_LAST (0U-399U)
  145. #define TVN_FIRST (0U-400U) // treeview
  146. #define TVN_LAST (0U-499U)
  147. #define TTN_FIRST (0U-520U) // tooltips
  148. #define TTN_LAST (0U-549U)
  149. #define TCN_FIRST (0U-550U) // tab control
  150. #define TCN_LAST (0U-580U)
  151. // Shell reserved (0U-580U) - (0U-589U)
  152. #define CDN_FIRST (0U-601U) // common dialog (new)
  153. #define CDN_LAST (0U-699U)
  154. #define TBN_FIRST (0U-700U) // toolbar
  155. #define TBN_LAST (0U-720U)
  156. #define UDN_FIRST (0U-721) // updown
  157. #define UDN_LAST (0U-740)
  158. #define MCN_FIRST (0U-750U) // monthcal
  159. #define MCN_LAST (0U-759U)
  160. #define DTN_FIRST (0U-760U) // datetimepick
  161. #define DTN_LAST (0U-799U)
  162. #define CBEN_FIRST (0U-800U) // combo box ex
  163. #define CBEN_LAST (0U-830U)
  164. #define RBN_FIRST (0U-831U) // rebar
  165. #define RBN_LAST (0U-859U)
  166. // Message Filter Proc codes - These are defined above MSGF_USER ;Internal
  167. #define MSGF_COMMCTRL_BEGINDRAG 0x4200
  168. #define MSGF_COMMCTRL_SIZEHEADER 0x4201
  169. #define MSGF_COMMCTRL_DRAGSELECT 0x4202
  170. #define MSGF_COMMCTRL_TOOLBARCUST 0x4203
  171. //==================== CUSTOM DRAW ==========================================
  172. // custom draw return flags
  173. // values under 0x00010000 are reserved for global custom draw values.
  174. // above that are for specific controls
  175. #define CDRF_DODEFAULT 0x00000000
  176. ///// 0x00000001 // don't use because some apps return 1 for all notifies ;Internal
  177. #define CDRF_NEWFONT 0x00000002
  178. #define CDRF_SKIPDEFAULT 0x00000004
  179. #define CDRF_NOTIFYPOSTPAINT 0x00000010
  180. #define CDRF_NOTIFYITEMDRAW 0x00000020
  181. #define CDRF_NOTIFYPOSTERASE 0x00000040
  182. #define CDRF_NOTIFYITEMERASE 0x00000080
  183. #define CDRF_VALIDFLAGS 0x000000F6 // ;Internal
  184. // drawstage flags
  185. // values under 0x00010000 are reserved for global custom draw values.
  186. // above that are for specific controls
  187. #define CDDS_PREPAINT 0x00000001
  188. #define CDDS_POSTPAINT 0x00000002
  189. #define CDDS_PREERASE 0x00000003
  190. #define CDDS_POSTERASE 0x00000004
  191. // the 0x000010000 bit means it's individual item specific
  192. #define CDDS_ITEM 0x00010000
  193. #define CDDS_ITEMPREPAINT (CDDS_ITEM | CDDS_PREPAINT)
  194. #define CDDS_ITEMPOSTPAINT (CDDS_ITEM | CDDS_POSTPAINT)
  195. #define CDDS_ITEMPREERASE (CDDS_ITEM | CDDS_PREERASE)
  196. #define CDDS_ITEMPOSTERASE (CDDS_ITEM | CDDS_POSTERASE)
  197. // itemState flags
  198. #define CDIS_SELECTED 0x0001
  199. #define CDIS_GRAYED 0x0002
  200. #define CDIS_DISABLED 0x0004
  201. #define CDIS_CHECKED 0x0008
  202. #define CDIS_FOCUS 0x0010
  203. #define CDIS_DEFAULT 0x0020
  204. #define CDIS_HOT 0x0040
  205. typedef struct tagNMCUSTOMDRAWINFO
  206. {
  207. NMHDR hdr;
  208. DWORD dwDrawStage;
  209. HDC hdc;
  210. RECT rc;
  211. DWORD dwItemSpec; // this is control specific, but it's how to specify an item. valid only with CDDS_ITEM bit set
  212. UINT uItemState;
  213. LPARAM lItemlParam;
  214. } NMCUSTOMDRAW, FAR * LPNMCUSTOMDRAW;
  215. // for tooltips
  216. typedef struct tagNMTTCUSTOMDRAW
  217. {
  218. NMCUSTOMDRAW nmcd;
  219. UINT uDrawFlags;
  220. } NMTTCUSTOMDRAW, FAR * LPNMTTCUSTOMDRAW;
  221. ;begin_internal
  222. #define SSI_DEFAULT ((UINT)-1)
  223. #define SSIF_SCROLLPROC 0x0001
  224. #define SSIF_MAXSCROLLTIME 0x0002
  225. #define SSIF_MINSCROLL 0x0003
  226. typedef int (CALLBACK *PFNSMOOTHSCROLLPROC)( HWND hWnd,
  227. int dx,
  228. int dy,
  229. CONST RECT *prcScroll,
  230. CONST RECT *prcClip ,
  231. HRGN hrgnUpdate,
  232. LPRECT prcUpdate,
  233. UINT flags);
  234. typedef struct tagSSWInfo{
  235. UINT cbSize;
  236. DWORD fMask;
  237. HWND hwnd;
  238. int dx;
  239. int dy;
  240. LPCRECT lprcSrc;
  241. LPCRECT lprcClip;
  242. HRGN hrgnUpdate;
  243. LPRECT lprcUpdate;
  244. UINT fuScroll;
  245. UINT uMaxScrollTime;
  246. UINT cxMinScroll;
  247. UINT cyMinScroll;
  248. PFNSMOOTHSCROLLPROC pfnScrollProc; // we'll call this back instead
  249. } SMOOTHSCROLLINFO, *PSMOOTHSCROLLINFO;
  250. WINCOMMCTRLAPI INT WINAPI SmoothScrollWindow(PSMOOTHSCROLLINFO pssi);
  251. #define SSW_EX_NOTIMELIMIT 0x00010000
  252. #define SSW_EX_IMMEDIATE 0x00020000
  253. #define SSW_EX_IGNORESETTINGS 0x00040000 // ignore system settings to turn on/off smooth scroll
  254. // ================ READER MODE ================
  255. typedef BOOL (CALLBACK *PFNREADERSCROLL)(struct tagReaderModeInfo*, int, int);
  256. typedef BOOL (CALLBACK *PFNREADERTRANSLATEDISPATCH)(LPMSG);
  257. typedef struct tagReaderModeInfo
  258. {
  259. UINT cbSize;
  260. HWND hwnd;
  261. DWORD fFlags;
  262. LPRECT prc;
  263. PFNREADERSCROLL pfnScroll;
  264. PFNREADERTRANSLATEDISPATCH pfnTranslateDispatch;
  265. LPARAM lParam;
  266. } READERMODEINFO, *PREADERMODEINFO;
  267. #define RMF_ZEROCURSOR 0x00000001
  268. #define RMF_VERTICALONLY 0x00000002
  269. #define RMF_HORIZONTALONLY 0x00000004
  270. #define RM_SCROLLUNIT 20
  271. WINCOMMCTRLAPI void WINAPI DoReaderMode(PREADERMODEINFO prmi);
  272. // Cursors and Bitmaps used by ReaderMode
  273. #ifdef RC_INVOKED
  274. #define IDC_VERTICALONLY 109
  275. #define IDC_HORIZONTALONLY 110
  276. #define IDC_MOVE2D 111
  277. #define IDC_NORTH 112
  278. #define IDC_SOUTH 113
  279. #define IDC_EAST 114
  280. #define IDC_WEST 115
  281. #define IDC_NORTHEAST 116
  282. #define IDC_NORTHWEST 117
  283. #define IDC_SOUTHEAST 118
  284. #define IDC_SOUTHWEST 119
  285. #define IDB_2DSCROLL 132
  286. #define IDB_VSCROLL 133
  287. #define IDB_HSCROLL 134
  288. #else
  289. #define IDC_VERTICALONLY MAKEINTRESOURCE(109)
  290. #define IDC_HORIZONTALONLY MAKEINTRESOURCE(110)
  291. #define IDC_MOVE2D MAKEINTRESOURCE(111)
  292. #define IDC_NORTH MAKEINTRESOURCE(112)
  293. #define IDC_SOUTH MAKEINTRESOURCE(113)
  294. #define IDC_EAST MAKEINTRESOURCE(114)
  295. #define IDC_WEST MAKEINTRESOURCE(115)
  296. #define IDC_NORTHEAST MAKEINTRESOURCE(116)
  297. #define IDC_NORTHWEST MAKEINTRESOURCE(117)
  298. #define IDC_SOUTHEAST MAKEINTRESOURCE(118)
  299. #define IDC_SOUTHWEST MAKEINTRESOURCE(119)
  300. #define IDB_2DSCROLL MAKEINTRESOURCE(132)
  301. #define IDB_VSCROLL MAKEINTRESOURCE(133)
  302. #define IDB_HSCROLL MAKEINTRESOURCE(134)
  303. #endif
  304. ;end_internal
  305. //====== IMAGE APIS ===========================================================
  306. #ifndef NOIMAGEAPIS
  307. #define CLR_NONE 0xFFFFFFFFL
  308. #define CLR_DEFAULT 0xFF000000L
  309. struct _IMAGELIST;
  310. typedef struct _IMAGELIST NEAR* HIMAGELIST;
  311. typedef struct _IMAGELISTDRAWPARAMS {
  312. DWORD cbSize;
  313. HIMAGELIST himl;
  314. int i;
  315. HDC hdcDst;
  316. int x;
  317. int y;
  318. int cx;
  319. int cy;
  320. int xBitmap; // x offest from the upperleft of bitmap
  321. int yBitmap; // y offset from the upperleft of bitmap
  322. COLORREF rgbBk;
  323. COLORREF rgbFg;
  324. UINT fStyle;
  325. DWORD dwRop;
  326. } IMAGELISTDRAWPARAMS, FAR * LPIMAGELISTDRAWPARAMS;
  327. #define ILC_MASK 0x0001
  328. #define ILC_COLOR 0x0000
  329. #define ILC_COLORMASK 0x00FE ;Internal
  330. #define ILC_COLORDDB 0x00FE
  331. #define ILC_COLOR4 0x0004
  332. #define ILC_COLOR8 0x0008
  333. #define ILC_COLOR16 0x0010
  334. #define ILC_COLOR24 0x0018
  335. #define ILC_COLOR32 0x0020
  336. #define ILC_SHARED 0x0100 // this is a shareable image list ;Internal
  337. #define ILC_LARGESMALL 0x0200 // (not implenented) contains both large and small images ;Internal
  338. #define ILC_UNIQUE 0x0400 // (not implenented) makes sure no dup. image exists in list ;Internal
  339. #define ILC_PALETTE 0x0800 // (no longer supported...never worked anyway)
  340. #define ILC_VIRTUAL 0x8000 // enables ImageList_SetFilter ;Internal
  341. #define ILC_VALID (ILC_MASK | ILC_COLORMASK | ILC_SHARED | ILC_PALETTE | ILC_VIRTUAL) // legal implemented flags ;Internal
  342. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow);
  343. WINCOMMCTRLAPI BOOL WINAPI ImageList_Destroy(HIMAGELIST himl);
  344. WINCOMMCTRLAPI int WINAPI ImageList_GetImageCount(HIMAGELIST himl);
  345. WINCOMMCTRLAPI BOOL WINAPI ImageList_SetImageCount(HIMAGELIST himl, UINT uNewCount);
  346. WINCOMMCTRLAPI int WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask);
  347. WINCOMMCTRLAPI int WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, int i, HICON hicon);
  348. WINCOMMCTRLAPI COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk);
  349. WINCOMMCTRLAPI COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST himl);
  350. WINCOMMCTRLAPI BOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl, int iImage, int iOverlay);
  351. #define ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon)
  352. #define ILD_NORMAL 0x0000
  353. #define ILD_TRANSPARENT 0x0001
  354. #define ILD_MASK 0x0010
  355. #define ILD_IMAGE 0x0020
  356. #define ILD_ROP 0x0040
  357. #define ILD_BLENDMASK 0x000E ;Internal
  358. #define ILD_BLEND25 0x0002
  359. #define ILD_BLEND50 0x0004
  360. #define ILD_BLEND75 0x0008 // not implemented ;Internal
  361. #define ILD_OVERLAYMASK 0x0F00
  362. #define INDEXTOOVERLAYMASK(i) ((i) << 8)
  363. #define OVERLAYMASKTOINDEX(i) ((((i) >> 8) & (ILD_OVERLAYMASK >> 8))-1) ;Internal
  364. #define ILD_SELECTED ILD_BLEND50
  365. #define ILD_FOCUS ILD_BLEND25
  366. #define ILD_BLEND ILD_BLEND50
  367. #define CLR_HILIGHT CLR_DEFAULT
  368. WINCOMMCTRLAPI BOOL WINAPI ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle);
  369. ;begin_internal
  370. // BUGBUG remove these!
  371. WINCOMMCTRLAPI BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, int FAR *cx, int FAR *cy);
  372. WINCOMMCTRLAPI BOOL WINAPI ImageList_GetImageRect(HIMAGELIST himl, int i, RECT FAR* prcImage);
  373. 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);
  374. WINCOMMCTRLAPI BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS* pimldp);
  375. WINCOMMCTRLAPI BOOL WINAPI ImageList_Remove(HIMAGELIST himl, int i);
  376. ;end_internal
  377. #ifdef _WIN32
  378. WINCOMMCTRLAPI BOOL WINAPI ImageList_Replace(HIMAGELIST himl, int i, HBITMAP hbmImage, HBITMAP hbmMask);
  379. WINCOMMCTRLAPI int WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask);
  380. 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);
  381. WINCOMMCTRLAPI BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS* pimldp);
  382. WINCOMMCTRLAPI BOOL WINAPI ImageList_Remove(HIMAGELIST himl, int i);
  383. WINCOMMCTRLAPI HICON WINAPI ImageList_GetIcon(HIMAGELIST himl, int i, UINT flags);
  384. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  385. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  386. #ifdef UNICODE
  387. #define ImageList_LoadImage ImageList_LoadImageW
  388. #else
  389. #define ImageList_LoadImage ImageList_LoadImageA
  390. #endif
  391. #define ILCF_MOVE (0x00000000)
  392. #define ILCF_SWAP (0x00000001)
  393. #define ILCF_VALID (ILCF_SWAP) ;internal
  394. WINCOMMCTRLAPI BOOL WINAPI ImageList_Copy(HIMAGELIST himlDst, int iDst, HIMAGELIST himlSrc, int iSrc, UINT uFlags);
  395. WINCOMMCTRLAPI BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, int iTrack, int dxHotspot, int dyHotspot);
  396. WINCOMMCTRLAPI void WINAPI ImageList_EndDrag();
  397. WINCOMMCTRLAPI BOOL WINAPI ImageList_DragEnter(HWND hwndLock, int x, int y);
  398. WINCOMMCTRLAPI BOOL WINAPI ImageList_DragLeave(HWND hwndLock);
  399. WINCOMMCTRLAPI BOOL WINAPI ImageList_DragMove(int x, int y);
  400. WINCOMMCTRLAPI BOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag, int iDrag, int dxHotspot, int dyHotspot);
  401. WINCOMMCTRLAPI BOOL WINAPI ImageList_DragShowNolock(BOOL fShow);
  402. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_GetDragImage(POINT FAR* ppt,POINT FAR* pptHotspot);
  403. #define ImageList_RemoveAll(himl) ImageList_Remove(himl, -1)
  404. #define ImageList_ExtractIcon(hi, himl, i) ImageList_GetIcon(himl, i, 0)
  405. #define ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask) ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0)
  406. #ifdef __IStream_INTERFACE_DEFINED__
  407. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
  408. WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM pstm);
  409. #endif
  410. typedef struct _IMAGEINFO
  411. {
  412. HBITMAP hbmImage;
  413. HBITMAP hbmMask;
  414. int Unused1;
  415. int Unused2;
  416. RECT rcImage;
  417. } IMAGEINFO, FAR *LPIMAGEINFO;
  418. WINCOMMCTRLAPI BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, int FAR *cx, int FAR *cy);
  419. WINCOMMCTRLAPI BOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl, int cx, int cy);
  420. WINCOMMCTRLAPI BOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl, int i, IMAGEINFO FAR* pImageInfo);
  421. WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy);
  422. ;begin_internal
  423. typedef BOOL (CALLBACK *PFNIMLFILTER)(HIMAGELIST *, int *, LPARAM, BOOL);
  424. WINCOMMCTRLAPI BOOL WINAPI ImageList_SetFilter(HIMAGELIST himl, PFNIMLFILTER pfnFilter, LPARAM lParamFilter);
  425. ;end_internal
  426. #endif
  427. #endif
  428. //====== HEADER CONTROL =======================================================
  429. #ifndef NOHEADER
  430. #ifdef _WIN32
  431. #define WC_HEADERA "SysHeader32"
  432. #define WC_HEADERW L"SysHeader32"
  433. #ifdef UNICODE
  434. #define WC_HEADER WC_HEADERW
  435. #else
  436. #define WC_HEADER WC_HEADERA
  437. #endif
  438. #else
  439. #define WC_HEADER "SysHeader"
  440. #endif
  441. #define HDS_HORZ 0x0000
  442. #define HDS_VERT 0x0001 // BUGBUG: not implemente ;Internal
  443. #define HDS_BUTTONS 0x0002
  444. #define HDS_HOTTRACK 0x0004
  445. #define HDS_HIDDEN 0x0008
  446. #define HDS_SHAREDIMAGELISTS 0x0000 ;internal
  447. #define HDS_PRIVATEIMAGELISTS 0x0010 ;internal
  448. #define HDS_OWNERDATA 0x0020 ;internal
  449. #define HDS_DRAGDROP 0x0040
  450. #define HDS_FULLDRAG 0x0080
  451. typedef struct _HD_ITEMA
  452. {
  453. UINT mask;
  454. int cxy;
  455. LPSTR pszText;
  456. HBITMAP hbm;
  457. int cchTextMax;
  458. int fmt;
  459. LPARAM lParam;
  460. int iImage; // index of bitmap in ImageList
  461. int iOrder; // where to draw this item
  462. } HDITEMA, FAR * LPHDITEMA;
  463. typedef struct _HD_ITEMW
  464. {
  465. UINT mask;
  466. int cxy;
  467. LPWSTR pszText;
  468. HBITMAP hbm;
  469. int cchTextMax;
  470. int fmt;
  471. LPARAM lParam;
  472. int iImage; // index of bitmap in ImageList
  473. int iOrder;
  474. } HDITEMW, FAR * LPHDITEMW;
  475. #define HD_ITEMA HDITEMA
  476. #define HD_ITEMW HDITEMW
  477. #ifdef UNICODE
  478. #define HDITEM HDITEMW
  479. #define LPHDITEM LPHDITEMW
  480. #else
  481. #define HDITEM HDITEMA
  482. #define LPHDITEM LPHDITEMW
  483. #endif
  484. #define HD_ITEM HDITEM
  485. #define HDI_WIDTH 0x0001
  486. #define HDI_HEIGHT HDI_WIDTH
  487. #define HDI_TEXT 0x0002
  488. #define HDI_FORMAT 0x0004
  489. #define HDI_LPARAM 0x0008
  490. #define HDI_BITMAP 0x0010
  491. #define HDI_IMAGE 0x0020
  492. #define HDI_DI_SETITEM 0x0040
  493. #define HDI_ORDER 0x0080
  494. #define HDI_ALL 0x00Bf ;Internal
  495. #define HDF_LEFT 0
  496. #define HDF_RIGHT 1
  497. #define HDF_CENTER 2
  498. #define HDF_JUSTIFYMASK 0x0003
  499. #define HDF_RTLREADING 4
  500. #define HDF_OWNERDRAW 0x8000
  501. #define HDF_STRING 0x4000
  502. #define HDF_BITMAP 0x2000
  503. #define HDF_BITMAP_ON_RIGHT 0x1000
  504. #define HDF_IMAGE 0x0800
  505. #define HDM_GETITEMCOUNT (HDM_FIRST + 0)
  506. #define Header_GetItemCount(hwndHD) \
  507. (int)SNDMSG((hwndHD), HDM_GETITEMCOUNT, 0, 0L)
  508. #define HDM_INSERTITEMA (HDM_FIRST + 1)
  509. #define HDM_INSERTITEMW (HDM_FIRST + 10)
  510. #ifdef UNICODE
  511. #define HDM_INSERTITEM HDM_INSERTITEMW
  512. #else
  513. #define HDM_INSERTITEM HDM_INSERTITEMA
  514. #endif
  515. #define Header_InsertItem(hwndHD, i, phdi) \
  516. (int)SNDMSG((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  517. #define HDM_DELETEITEM (HDM_FIRST + 2)
  518. #define Header_DeleteItem(hwndHD, i) \
  519. (BOOL)SNDMSG((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(i), 0L)
  520. #define HDM_GETITEMA (HDM_FIRST + 3)
  521. #define HDM_GETITEMW (HDM_FIRST + 11)
  522. #ifdef UNICODE
  523. #define HDM_GETITEM HDM_GETITEMW
  524. #else
  525. #define HDM_GETITEM HDM_GETITEMA
  526. #endif
  527. #define Header_GetItem(hwndHD, i, phdi) \
  528. (BOOL)SNDMSG((hwndHD), HDM_GETITEM, (WPARAM)(int)(i), (LPARAM)(HD_ITEM FAR*)(phdi))
  529. #define HDM_SETITEMA (HDM_FIRST + 4)
  530. #define HDM_SETITEMW (HDM_FIRST + 12)
  531. #ifdef UNICODE
  532. #define HDM_SETITEM HDM_SETITEMW
  533. #else
  534. #define HDM_SETITEM HDM_SETITEMA
  535. #endif
  536. #define Header_SetItem(hwndHD, i, phdi) \
  537. (BOOL)SNDMSG((hwndHD), HDM_SETITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  538. typedef struct _HD_LAYOUT
  539. {
  540. RECT FAR* prc;
  541. WINDOWPOS FAR* pwpos;
  542. } HDLAYOUT, FAR *LPHDLAYOUT;
  543. #define HD_LAYOUT HDLAYOUT
  544. #define HDM_LAYOUT (HDM_FIRST + 5)
  545. #define Header_Layout(hwndHD, playout) \
  546. (BOOL)SNDMSG((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout))
  547. #define HHT_NOWHERE 0x0001
  548. #define HHT_ONHEADER 0x0002
  549. #define HHT_ONDIVIDER 0x0004
  550. #define HHT_ONDIVOPEN 0x0008
  551. #define HHT_ABOVE 0x0100
  552. #define HHT_BELOW 0x0200
  553. #define HHT_TORIGHT 0x0400
  554. #define HHT_TOLEFT 0x0800
  555. typedef struct _HD_HITTESTINFO
  556. {
  557. POINT pt;
  558. UINT flags;
  559. int iItem;
  560. } HDHITTESTINFO, FAR *LPHDHITTESTINFO;
  561. #define HD_HITTESTINFO HDHITTESTINFO
  562. #define HDM_HITTEST (HDM_FIRST + 6)
  563. #define HDM_GETITEMRECT (HDM_FIRST + 7)
  564. #define Header_GetItemRect(hwnd, iItem, lprc) \
  565. (BOOL)SNDMSG((hwnd), HDM_GETITEMRECT, (WPARAM)iItem, (LPARAM)lprc)
  566. #define HDM_SETIMAGELIST (HDM_FIRST + 8)
  567. #define Header_SetImageList(hwnd, himl) \
  568. (HIMAGELIST)SNDMSG((hwnd), HDM_SETIMAGELIST, 0, (LPARAM)himl)
  569. #define HDM_GETIMAGELIST (HDM_FIRST + 9)
  570. #define Header_GetImageList(hwnd) \
  571. (HIMAGELIST)SNDMSG((hwnd), HDM_GETIMAGELIST, 0, 0)
  572. #define HDM_ORDERTOINDEX (HDM_FIRST + 15)
  573. #define Header_OrderToIndex(hwnd, i) \
  574. (int)SNDMSG((hwnd), HDM_ORDERTOINDEX, (WPARAM)i, 0)
  575. #define HDM_CREATEDRAGIMAGE (HDM_FIRST + 16) // wparam = which item (by index)
  576. #define Header_CreateDragImage(hwnd, i) \
  577. (HIMAGELIST)SNDMSG((hwnd), HDM_CREATEDRAGIMAGE, (WPARAM)i, 0)
  578. #define HDM_GETORDERARRAY (HDM_FIRST + 17)
  579. #define Header_GetOrderArray(hwnd, iCount, lpi) \
  580. (BOOL)SNDMSG((hwnd), HDM_GETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
  581. #define HDM_SETORDERARRAY (HDM_FIRST + 18)
  582. #define Header_SetOrderArray(hwnd, iCount, lpi) \
  583. (BOOL)SNDMSG((hwnd), HDM_SETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
  584. // lparam = int array of size HDM_GETITEMCOUNT
  585. // the array specifies the order that all items should be displayed.
  586. // e.g. { 2, 0, 1}
  587. // says the index 2 item should be shown in the 0ths position
  588. // index 0 should be shown in the 1st position
  589. // index 1 should be shown in the 2nd position
  590. #define HDM_SETHOTDIVIDER (HDM_FIRST + 19)
  591. #define Header_SetHotDivider(hwnd, fPos, dw) \
  592. (int)SNDMSG((hwnd), HDM_SETHOTDIVIDER, (WPARAM)fPos, (LPARAM)dw)
  593. // convenience message for external dragdrop
  594. // wParam = BOOL specifying whether the lParam is a dwPos of the cursor
  595. // position or the index of which divider to hotlight
  596. // lParam = depends on wParam (-1 and wParm = FALSE turns off hotlight)
  597. #define HDN_ITEMCHANGINGA (HDN_FIRST-0)
  598. #define HDN_ITEMCHANGINGW (HDN_FIRST-20)
  599. #define HDN_ITEMCHANGEDA (HDN_FIRST-1)
  600. #define HDN_ITEMCHANGEDW (HDN_FIRST-21)
  601. #define HDN_ITEMCLICKA (HDN_FIRST-2)
  602. #define HDN_ITEMCLICKW (HDN_FIRST-22)
  603. #define HDN_ITEMDBLCLICKA (HDN_FIRST-3)
  604. #define HDN_ITEMDBLCLICKW (HDN_FIRST-23)
  605. #define HDN_DIVIDERDBLCLICKA (HDN_FIRST-5)
  606. #define HDN_DIVIDERDBLCLICKW (HDN_FIRST-25)
  607. #define HDN_BEGINTRACKA (HDN_FIRST-6)
  608. #define HDN_BEGINTRACKW (HDN_FIRST-26)
  609. #define HDN_ENDTRACKA (HDN_FIRST-7)
  610. #define HDN_ENDTRACKW (HDN_FIRST-27)
  611. #define HDN_TRACKA (HDN_FIRST-8)
  612. #define HDN_TRACKW (HDN_FIRST-28)
  613. #define HDN_GETDISPINFOA (HDN_FIRST-9)
  614. #define HDN_GETDISPINFOW (HDN_FIRST-29)
  615. #define HDN_BEGINDRAG (HDN_FIRST-10)
  616. #define HDN_ENDDRAG (HDN_FIRST-11)
  617. #ifdef UNICODE
  618. #define HDN_ITEMCHANGING HDN_ITEMCHANGINGW
  619. #define HDN_ITEMCHANGED HDN_ITEMCHANGEDW
  620. #define HDN_ITEMCLICK HDN_ITEMCLICKW
  621. #define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW
  622. #define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW
  623. #define HDN_BEGINTRACK HDN_BEGINTRACKW
  624. #define HDN_ENDTRACK HDN_ENDTRACKW
  625. #define HDN_TRACK HDN_TRACKW
  626. #define HDN_GETDISPINFO HDN_GETDISPINFOW
  627. #else
  628. #define HDN_ITEMCHANGING HDN_ITEMCHANGINGA
  629. #define HDN_ITEMCHANGED HDN_ITEMCHANGEDA
  630. #define HDN_ITEMCLICK HDN_ITEMCLICKA
  631. #define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA
  632. #define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA
  633. #define HDN_BEGINTRACK HDN_BEGINTRACKA
  634. #define HDN_ENDTRACK HDN_ENDTRACKA
  635. #define HDN_TRACK HDN_TRACKA
  636. #define HDN_GETDISPINFO HDN_GETDISPINFOA
  637. #endif
  638. typedef struct tagNMHEADERA
  639. {
  640. NMHDR hdr;
  641. int iItem;
  642. int iButton;
  643. HDITEMA FAR* pitem;
  644. } NMHEADERA, FAR* LPNMHEADERA;
  645. typedef struct tagNMHEADERW
  646. {
  647. NMHDR hdr;
  648. int iItem;
  649. int iButton;
  650. HDITEMW FAR* pitem;
  651. } NMHEADERW, FAR* LPNMHEADERW;
  652. #ifdef UNICODE
  653. #define NMHEADER NMHEADERW
  654. #define LPNMHEADER LPNMHEADERW
  655. #else
  656. #define NMHEADER NMHEADERA
  657. #define LPNMHEADER LPNMHEADERA
  658. #endif
  659. #define HD_NOTIFYA NMHEADERA
  660. #define HD_NOTIFYW NMHEADERW
  661. #define HD_NOTIFY NMHEADER
  662. typedef struct tagNMHDDISPINFOW
  663. {
  664. NMHDR hdr;
  665. int iItem;
  666. UINT mask;
  667. LPWSTR pszText;
  668. int cchTextMax;
  669. int iImage;
  670. LPARAM lParam;
  671. } NMHDDISPINFOW, FAR* LPNMHDDISPINFOW;
  672. typedef struct tagNMHDDISPINFOA
  673. {
  674. NMHDR hdr;
  675. int iItem;
  676. UINT mask;
  677. LPSTR pszText;
  678. int cchTextMax;
  679. int iImage;
  680. LPARAM lParam;
  681. } NMHDDISPINFOA, FAR* LPNMHDDISPINFOA;
  682. #ifdef UNICODE
  683. #define NMHDDISPINFO NMHDDISPINFOW
  684. #define LPNMHDDISPINFO LPNMHDDISPINFOW
  685. #else
  686. #define NMHDDISPINFO NMHDDISPINFOA
  687. #define LPNMHDDISPINFO LPNMHDDISPINFOA
  688. #endif
  689. #endif
  690. //====== TOOLBAR CONTROL ======================================================
  691. #ifndef NOTOOLBAR
  692. #ifdef _WIN32
  693. #define TOOLBARCLASSNAMEW L"ToolbarWindow32"
  694. #define TOOLBARCLASSNAMEA "ToolbarWindow32"
  695. #ifdef UNICODE
  696. #define TOOLBARCLASSNAME TOOLBARCLASSNAMEW
  697. #else
  698. #define TOOLBARCLASSNAME TOOLBARCLASSNAMEA
  699. #endif
  700. #else
  701. #define TOOLBARCLASSNAME "ToolbarWindow"
  702. #endif
  703. typedef struct _TBBUTTON {
  704. /* REVIEW: index, command, flag words, resource ids should be UINT */ ;Internal
  705. int iBitmap;
  706. int idCommand;
  707. BYTE fsState;
  708. BYTE fsStyle;
  709. #ifdef _WIN32
  710. BYTE bReserved[2];
  711. #endif
  712. DWORD dwData;
  713. int iString;
  714. } TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
  715. typedef const TBBUTTON FAR* LPCTBBUTTON;
  716. /* REVIEW: is this internal? if not, call it TBCOLORMAP, prefix tbc */ ;Internal
  717. typedef struct _COLORMAP {
  718. COLORREF from;
  719. COLORREF to;
  720. } COLORMAP, FAR* LPCOLORMAP;
  721. WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps,
  722. HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons,
  723. int iNumButtons, int dxButton, int dyButton,
  724. int dxBitmap, int dyBitmap, UINT uStructSize);
  725. WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, int idBitmap,
  726. UINT wFlags, LPCOLORMAP lpColorMap,
  727. int iNumMaps);
  728. #define CMB_DISCARDABLE 0x01 /* BUGBUG: remove this */ ;Internal
  729. #define CMB_MASKED 0x02
  730. /*REVIEW: TBSTATE_* should be TBF_* (for Flags) */ ;Internal
  731. #define TBSTATE_CHECKED 0x01
  732. #define TBSTATE_PRESSED 0x02
  733. #define TBSTATE_ENABLED 0x04
  734. #define TBSTATE_HIDDEN 0x08
  735. #define TBSTATE_INDETERMINATE 0x10
  736. #define TBSTATE_WRAP 0x20
  737. #define TBSTATE_ELLIPSES 0x40
  738. #define TBSTYLE_BUTTON 0x00
  739. #define TBSTYLE_SEP 0x01
  740. #define TBSTYLE_CHECK 0x02
  741. #define TBSTYLE_GROUP 0x04
  742. #define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK)
  743. #define TBSTYLE_DROPDOWN 0x08
  744. #define TBSTYLE_TOOLTIPS 0x0100
  745. #define TBSTYLE_WRAPABLE 0x0200
  746. #define TBSTYLE_ALTDRAG 0x0400
  747. #define TBSTYLE_FLAT 0x0800
  748. #define TBSTYLE_LIST 0x1000
  749. #define TBSTYLE_CUSTOMERASE 0x2000
  750. #define TB_ENABLEBUTTON (WM_USER + 1)
  751. #define TB_CHECKBUTTON (WM_USER + 2)
  752. #define TB_PRESSBUTTON (WM_USER + 3)
  753. #define TB_HIDEBUTTON (WM_USER + 4)
  754. #define TB_INDETERMINATE (WM_USER + 5)
  755. /* Messages up to WM_USER+8 are reserved until we define more state bits */ ;Internal
  756. #define TB_ISBUTTONENABLED (WM_USER + 9)
  757. #define TB_ISBUTTONCHECKED (WM_USER + 10)
  758. #define TB_ISBUTTONPRESSED (WM_USER + 11)
  759. #define TB_ISBUTTONHIDDEN (WM_USER + 12)
  760. #define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
  761. /* Messages up to WM_USER+16 are reserved until we define more state bits */ ;Internal
  762. #define TB_SETSTATE (WM_USER + 17)
  763. #define TB_GETSTATE (WM_USER + 18)
  764. #define TB_ADDBITMAP (WM_USER + 19)
  765. #ifdef _WIN32
  766. typedef struct tagTBADDBITMAP {
  767. HINSTANCE hInst;
  768. UINT nID;
  769. } TBADDBITMAP, *LPTBADDBITMAP;
  770. #define HINST_COMMCTRL ((HINSTANCE)-1)
  771. #define IDB_STD_SMALL_COLOR 0
  772. #define IDB_STD_LARGE_COLOR 1
  773. #define IDB_STD_SMALL_MONO 2 /* not supported yet */ ;Internal
  774. #define IDB_STD_LARGE_MONO 3 /* not supported yet */ ;Internal
  775. #define IDB_VIEW_SMALL_COLOR 4
  776. #define IDB_VIEW_LARGE_COLOR 5
  777. #define IDB_VIEW_SMALL_MONO 6 /* not supported yet */ ;Internal
  778. #define IDB_VIEW_LARGE_MONO 7 /* not supported yet */ ;Internal
  779. #define IDB_HIST_SMALL_COLOR 8
  780. #define IDB_HIST_LARGE_COLOR 9
  781. // icon indexes for standard bitmap
  782. #define STD_CUT 0
  783. #define STD_COPY 1
  784. #define STD_PASTE 2
  785. #define STD_UNDO 3
  786. #define STD_REDOW 4
  787. #define STD_DELETE 5
  788. #define STD_FILENEW 6
  789. #define STD_FILEOPEN 7
  790. #define STD_FILESAVE 8
  791. #define STD_PRINTPRE 9
  792. #define STD_PROPERTIES 10
  793. #define STD_HELP 11
  794. #define STD_FIND 12
  795. #define STD_REPLACE 13
  796. #define STD_PRINT 14
  797. // icon indexes for standard view bitmap
  798. #define VIEW_LARGEICONS 0
  799. #define VIEW_SMALLICONS 1
  800. #define VIEW_LIST 2
  801. #define VIEW_DETAILS 3
  802. #define VIEW_SORTNAME 4
  803. #define VIEW_SORTSIZE 5
  804. #define VIEW_SORTDATE 6
  805. #define VIEW_SORTTYPE 7
  806. #define VIEW_PARENTFOLDER 8
  807. #define VIEW_NETCONNECT 9
  808. #define VIEW_NETDISCONNECT 10
  809. #define VIEW_NEWFOLDER 11
  810. #define HIST_BACK 0
  811. #define HIST_FORWARD 1
  812. #define HIST_FAVORITES 2
  813. #define HIST_ADDTOFAVORITES 3
  814. #define HIST_VIEWTREE 4
  815. #define HIST_LAST 4 // ;Internal
  816. #endif
  817. #define TB_ADDBUTTONS (WM_USER + 20)
  818. #define TB_INSERTBUTTON (WM_USER + 21)
  819. #define TB_DELETEBUTTON (WM_USER + 22)
  820. #define TB_GETBUTTON (WM_USER + 23)
  821. #define TB_BUTTONCOUNT (WM_USER + 24)
  822. #define TB_COMMANDTOINDEX (WM_USER + 25)
  823. #ifdef _WIN32
  824. typedef struct tagTBSAVEPARAMSA {
  825. HKEY hkr;
  826. LPCSTR pszSubKey;
  827. LPCSTR pszValueName;
  828. } TBSAVEPARAMSA, FAR* LPTBSAVEPARAMSA;
  829. typedef struct tagTBSAVEPARAMSW {
  830. HKEY hkr;
  831. LPCWSTR pszSubKey;
  832. LPCWSTR pszValueName;
  833. } TBSAVEPARAMSW, FAR *LPTBSAVEPARAMW;
  834. #ifdef UNICODE
  835. #define TBSAVEPARAMS TBSAVEPARAMSW
  836. #define LPTBSAVEPARAMS LPTBSAVEPARAMSW
  837. #else
  838. #define TBSAVEPARAMS TBSAVEPARAMSA
  839. #define LPTBSAVEPARAMS LPTBSAVEPARAMSA
  840. #endif
  841. #endif
  842. #define TB_SAVERESTOREA (WM_USER + 26)
  843. #define TB_SAVERESTOREW (WM_USER + 76)
  844. #define TB_CUSTOMIZE (WM_USER + 27)
  845. #define TB_ADDSTRINGA (WM_USER + 28)
  846. #define TB_ADDSTRINGW (WM_USER + 77)
  847. #define TB_GETITEMRECT (WM_USER + 29)
  848. #define TB_BUTTONSTRUCTSIZE (WM_USER + 30)
  849. #define TB_SETBUTTONSIZE (WM_USER + 31)
  850. #define TB_SETBITMAPSIZE (WM_USER + 32)
  851. #define TB_AUTOSIZE (WM_USER + 33)
  852. #define TB_SETBUTTONTYPE (WM_USER + 34) ;Internal
  853. #define TB_GETTOOLTIPS (WM_USER + 35)
  854. #define TB_SETTOOLTIPS (WM_USER + 36)
  855. #define TB_SETPARENT (WM_USER + 37)
  856. #ifdef _WIN32 ;Internal
  857. #define TB_ADDBITMAP32 (WM_USER + 38) ;Internal
  858. #endif ;Internal
  859. #define TB_SETROWS (WM_USER + 39)
  860. #define TB_GETROWS (WM_USER + 40)
  861. #define TB_SETCMDID (WM_USER + 42)
  862. #define TB_CHANGEBITMAP (WM_USER + 43)
  863. #define TB_GETBITMAP (WM_USER + 44)
  864. #define TB_GETBUTTONTEXTA (WM_USER + 45)
  865. #define TB_GETBUTTONTEXTW (WM_USER + 75)
  866. #define TB_REPLACEBITMAP (WM_USER + 46)
  867. #define TB_SETINDENT (WM_USER + 47)
  868. #define TB_SETIMAGELIST (WM_USER + 48)
  869. #define TB_GETIMAGELIST (WM_USER + 49)
  870. #define TB_LOADIMAGES (WM_USER + 50)
  871. #define TB_GETRECT (WM_USER + 51) // wParam is the Cmd instead of index
  872. #define TB_SETHOTIMAGELIST (WM_USER + 52)
  873. #define TB_GETHOTIMAGELIST (WM_USER + 53)
  874. #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
  875. #define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
  876. #define TB_SETSTYLE (WM_USER + 56)
  877. #define TB_GETSTYLE (WM_USER + 57)
  878. #define TB_GETBUTTONSIZE (WM_USER + 58)
  879. #define TB_SETBUTTONWIDTH (WM_USER + 59)
  880. #define TB_SETMAXTEXTROWS (WM_USER + 60)
  881. #define TB_GETTEXTROWS (WM_USER + 61)
  882. #ifdef UNICODE
  883. #define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW
  884. #define TB_SAVERESTORE TB_SAVERESTOREW
  885. #define TB_ADDSTRING TB_ADDSTRINGW
  886. #else
  887. #define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA
  888. #define TB_SAVERESTORE TB_SAVERESTOREA
  889. #define TB_ADDSTRING TB_ADDSTRINGA
  890. #endif
  891. typedef struct {
  892. HINSTANCE hInstOld;
  893. UINT nIDOld;
  894. HINSTANCE hInstNew;
  895. UINT nIDNew;
  896. int nButtons;
  897. } TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
  898. #ifdef _WIN32
  899. #define TBBF_LARGE 0x0001
  900. #define TBBF_MONO 0x0002 /* not supported yet */ ;Internal
  901. #define TB_GETBITMAPFLAGS (WM_USER + 41)
  902. #define TBN_GETBUTTONINFOA (TBN_FIRST-0)
  903. #define TBN_GETBUTTONINFOW (TBN_FIRST-20)
  904. #define TBN_BEGINDRAG (TBN_FIRST-1)
  905. #define TBN_ENDDRAG (TBN_FIRST-2)
  906. #define TBN_BEGINADJUST (TBN_FIRST-3)
  907. #define TBN_ENDADJUST (TBN_FIRST-4)
  908. #define TBN_RESET (TBN_FIRST-5)
  909. #define TBN_QUERYINSERT (TBN_FIRST-6)
  910. #define TBN_QUERYDELETE (TBN_FIRST-7)
  911. #define TBN_TOOLBARCHANGE (TBN_FIRST-8)
  912. #define TBN_CUSTHELP (TBN_FIRST-9)
  913. #define TBN_DROPDOWN (TBN_FIRST - 10)
  914. #define TBN_CLOSEUP (TBN_FIRST - 11)
  915. #ifdef UNICODE
  916. #define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW
  917. #else
  918. #define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA
  919. #endif
  920. typedef struct tagNMTOOLBARA {
  921. NMHDR hdr;
  922. int iItem;
  923. TBBUTTON tbButton;
  924. int cchText;
  925. LPSTR pszText;
  926. } NMTOOLBARA, FAR* LPNMTOOLBARA;
  927. typedef struct tagNMTOOLBARW {
  928. NMHDR hdr;
  929. int iItem;
  930. TBBUTTON tbButton;
  931. int cchText;
  932. LPWSTR pszText;
  933. } NMTOOLBARW, FAR* LPNMTOOLBARW;
  934. #ifdef UNICODE
  935. #define NMTOOLBAR NMTOOLBARW
  936. #define LPNMTOOLBAR LPNMTOOLBARW
  937. #else
  938. #define NMTOOLBAR NMTOOLBARA
  939. #define LPNMTOOLBAR LPNMTOOLBARA
  940. #endif
  941. #define TBNOTIFYA NMTOOLBARA
  942. #define TBNOTIFYW NMTOOLBARW
  943. #define TBNOTIFY NMTOOLBAR
  944. #define LPTBNOTIFY LPNMTOOLBAR
  945. #define LPTBNOTIFYA LPNMTOOLBARA
  946. #define LPTBNOTIFYW LPNMTOOLBARW
  947. #endif
  948. #ifndef _WIN32 ;Internal
  949. // for compatibility with the old 16 bit WM_COMMAND hacks ;Internal
  950. typedef struct _ADJUSTINFO { ;Internal
  951. TBBUTTON tbButton; ;Internal
  952. char szDescription[1]; ;Internal
  953. } ADJUSTINFO, NEAR* PADJUSTINFO, FAR* LPADJUSTINFO; ;Internal
  954. #define TBN_BEGINDRAG 0x0201 ;Internal
  955. #define TBN_ENDDRAG 0x0203 ;Internal
  956. #define TBN_BEGINADJUST 0x0204 ;Internal
  957. #define TBN_ADJUSTINFO 0x0205 ;Internal
  958. #define TBN_ENDADJUST 0x0206 ;Internal
  959. #define TBN_RESET 0x0207 ;Internal
  960. #define TBN_QUERYINSERT 0x0208 ;Internal
  961. #define TBN_QUERYDELETE 0x0209 ;Internal
  962. #define TBN_TOOLBARCHANGE 0x020a ;Internal
  963. #define TBN_CUSTHELP 0x020b ;Internal
  964. #endif ;Internal
  965. ;Internal
  966. #endif
  967. //====== REBAR CONTROL ========================================================
  968. #ifndef NOREBAR
  969. #ifdef _WIN32
  970. #define REBARCLASSNAMEW L"ReBarWindow32"
  971. #define REBARCLASSNAMEA "ReBarWindow32"
  972. #ifdef UNICODE
  973. #define REBARCLASSNAME REBARCLASSNAMEW
  974. #else
  975. #define REBARCLASSNAME REBARCLASSNAMEA
  976. #endif
  977. #else
  978. #define REBARCLASSNAME "ReBarWindow"
  979. #endif
  980. #define RBIM_IMAGELIST 0x00000001
  981. #define RBS_TOOLTIPS 0x00000100
  982. #define RBS_VARHEIGHT 0x00000200
  983. #define RBS_BANDBORDERS 0x00000400
  984. #define RBS_FIXEDORDER 0x00000800
  985. #define RBS_VALID (RBS_TOOLTIPS | RBS_VARHEIGHT | RBS_BANDBORDERS) ;Internal
  986. typedef struct tagREBARINFO
  987. {
  988. UINT cbSize;
  989. UINT fMask;
  990. #ifndef NOIMAGEAPIS
  991. HIMAGELIST himl;
  992. #else
  993. HANDLE himl;
  994. #endif
  995. } REBARINFO, FAR *LPREBARINFO;
  996. #define RBBS_BREAK 0x00000001 // break to new line
  997. #define RBBS_FIXEDSIZE 0x00000002 // band can't be sized
  998. #define RBBS_CHILDEDGE 0x00000004 // edge around top & bottom of child window
  999. #define RBBS_HIDDEN 0x00000008 // don't show
  1000. #define RBBS_NOVERT 0x00000010 // don't show when vertical
  1001. #define RBBS_FIXEDBMP 0x00000020 // bitmap doesn't move during band resize
  1002. #define RBBS_DRAGBREAK 0x80000000 // ;Internal
  1003. #define RBBIM_STYLE 0x00000001
  1004. #define RBBIM_COLORS 0x00000002
  1005. #define RBBIM_TEXT 0x00000004
  1006. #define RBBIM_IMAGE 0x00000008
  1007. #define RBBIM_CHILD 0x00000010
  1008. #define RBBIM_CHILDSIZE 0x00000020
  1009. #define RBBIM_SIZE 0x00000040
  1010. #define RBBIM_BACKGROUND 0x00000080
  1011. #define RBBIM_ID 0x00000100
  1012. typedef struct tagREBARBANDINFOA
  1013. {
  1014. UINT cbSize;
  1015. UINT fMask;
  1016. UINT fStyle;
  1017. COLORREF clrFore;
  1018. COLORREF clrBack;
  1019. LPSTR lpText;
  1020. UINT cch;
  1021. int iImage;
  1022. HWND hwndChild;
  1023. UINT cxMinChild;
  1024. UINT cyMinChild;
  1025. UINT cx;
  1026. HBITMAP hbmBack;
  1027. UINT wID;
  1028. } REBARBANDINFOA, FAR *LPREBARBANDINFOA;
  1029. typedef REBARBANDINFOA CONST FAR *LPCREBARBANDINFOA;
  1030. typedef struct tagREBARBANDINFOW
  1031. {
  1032. UINT cbSize;
  1033. UINT fMask;
  1034. UINT fStyle;
  1035. COLORREF clrFore;
  1036. COLORREF clrBack;
  1037. LPWSTR lpText;
  1038. UINT cch;
  1039. int iImage;
  1040. HWND hwndChild;
  1041. UINT cxMinChild;
  1042. UINT cyMinChild;
  1043. UINT cx;
  1044. HBITMAP hbmBack;
  1045. UINT wID;
  1046. } REBARBANDINFOW, FAR *LPREBARBANDINFOW;
  1047. typedef REBARBANDINFOW CONST FAR *LPCREBARBANDINFOW;
  1048. #ifdef UNICODE
  1049. #define REBARBANDINFO REBARBANDINFOW
  1050. #define LPREBARBANDINFO LPREBARBANDINFOW
  1051. #define LPCREBARBANDINFO LPCREBARBANDINFOW
  1052. #else
  1053. #define REBARBANDINFO REBARBANDINFOA
  1054. #define LPREBARBANDINFO LPREBARBANDINFOA
  1055. #define LPCREBARBANDINFO LPCREBARBANDINFOA
  1056. #endif
  1057. #define RB_INSERTBANDA (WM_USER + 1)
  1058. #define RB_DELETEBAND (WM_USER + 2)
  1059. #define RB_GETBARINFO (WM_USER + 3)
  1060. #define RB_SETBARINFO (WM_USER + 4)
  1061. #define RB_GETBANDINFO (WM_USER + 5)
  1062. #define RB_SETBANDINFOA (WM_USER + 6)
  1063. #define RB_SETPARENT (WM_USER + 7)
  1064. #define RB_INSERTBANDW (WM_USER + 10)
  1065. #define RB_SETBANDINFOW (WM_USER + 11)
  1066. #define RB_GETBANDCOUNT (WM_USER + 12)
  1067. #define RB_GETROWCOUNT (WM_USER + 13)
  1068. #define RB_GETROWHEIGHT (WM_USER + 14)
  1069. #ifdef UNICODE
  1070. #define RB_INSERTBAND RB_INSERTBANDW
  1071. #define RB_SETBANDINFO RB_SETBANDINFOW
  1072. #else
  1073. #define RB_INSERTBAND RB_INSERTBANDA
  1074. #define RB_SETBANDINFO RB_SETBANDINFOA
  1075. #endif
  1076. #define RBN_HEIGHTCHANGE (RBN_FIRST - 0)
  1077. #endif
  1078. //====== TOOLTIPS CONTROL =====================================================
  1079. #ifndef NOTOOLTIPS
  1080. #ifdef _WIN32
  1081. #define TOOLTIPS_CLASSW L"tooltips_class32"
  1082. #define TOOLTIPS_CLASSA "tooltips_class32"
  1083. #ifdef UNICODE
  1084. #define TOOLTIPS_CLASS TOOLTIPS_CLASSW
  1085. #else
  1086. #define TOOLTIPS_CLASS TOOLTIPS_CLASSA
  1087. #endif
  1088. #else
  1089. #define TOOLTIPS_CLASS "tooltips_class"
  1090. #endif
  1091. typedef struct tagTOOLINFOA {
  1092. UINT cbSize;
  1093. UINT uFlags;
  1094. HWND hwnd;
  1095. UINT uId;
  1096. RECT rect;
  1097. HINSTANCE hinst;
  1098. LPSTR lpszText;
  1099. LPARAM lParam;
  1100. } TTTOOLINFOA, NEAR *PTOOLINFOA, FAR *LPTTTOOLINFOA;
  1101. typedef struct tagTOOLINFOW {
  1102. UINT cbSize;
  1103. UINT uFlags;
  1104. HWND hwnd;
  1105. UINT uId;
  1106. RECT rect;
  1107. HINSTANCE hinst;
  1108. LPWSTR lpszText;
  1109. LPARAM lParam;
  1110. } TTTOOLINFOW, NEAR *PTOOLINFOW, FAR* LPTTTOOLINFOW;
  1111. #ifdef UNICODE
  1112. #define TTTOOLINFO TTTOOLINFOW
  1113. #define PTOOLINFO PTOOLINFOW
  1114. #define LPTTTOOLINFO LPTTTOOLINFOW
  1115. #else
  1116. #define PTOOLINFO PTOOLINFOA
  1117. #define TTTOOLINFO TTTOOLINFOA
  1118. #define LPTTTOOLINFO LPTTTOOLINFOA
  1119. #endif
  1120. #define LPTOOLINFO LPTTTOOLINFO
  1121. #define LPTOOLINFOA LPTTTOOLINFOA
  1122. #define LPTOOLINFOW LPTTTOOLINFOW
  1123. #define TOOLINFO TTTOOLINFO
  1124. #define TOOLINFOA TTTOOLINFOA
  1125. #define TOOLINFOW TTTOOLINFOW
  1126. #define TTS_ALWAYSTIP 0x01
  1127. #define TTS_NOPREFIX 0x02
  1128. #define TTF_IDISHWND 0x0001
  1129. // Use this to center around trackpoint in trackmode
  1130. // -OR- to center around tool in normal mode.
  1131. // Use TTF_ABSOLUTE to place the tip exactly at the track coords when
  1132. // in tracking mode. TTF_ABSOLUTE can be used in conjunction with TTF_CENTERTIP
  1133. // to center the tip absolutely about the track point.
  1134. #define TTF_CENTERTIP 0x0002
  1135. #define TTF_RTLREADING 0x0004
  1136. #define TTF_STRIPACCELS 0x0008 // (this is implicit now) ;Internal
  1137. #define TTF_SUBCLASS 0x0010
  1138. #define TTF_TRACK 0x0020
  1139. #define TTF_UNICODE 0x0040 // Unicode Notify's ;Internal
  1140. #define TTF_ABSOLUTE 0x0080
  1141. #define TTF_TRANSPARENT 0x0100
  1142. #define TTF_MEMALLOCED 0x0200 ;Internal
  1143. #define TTF_DI_SETITEM 0x8000 // valid only on the TTN_NEEDTEXT callback
  1144. #define TTDT_AUTOMATIC 0
  1145. #define TTDT_RESHOW 1
  1146. #define TTDT_AUTOPOP 2
  1147. #define TTDT_INITIAL 3
  1148. #define TTM_ACTIVATE (WM_USER + 1)
  1149. #define TTM_SETDELAYTIME (WM_USER + 3)
  1150. #define TTM_ADDTOOLA (WM_USER + 4)
  1151. #define TTM_ADDTOOLW (WM_USER + 50)
  1152. #define TTM_DELTOOLA (WM_USER + 5)
  1153. #define TTM_DELTOOLW (WM_USER + 51)
  1154. #define TTM_NEWTOOLRECTA (WM_USER + 6)
  1155. #define TTM_NEWTOOLRECTW (WM_USER + 52)
  1156. #define TTM_RELAYEVENT (WM_USER + 7)
  1157. #define TTM_GETTOOLINFOA (WM_USER + 8)
  1158. #define TTM_GETTOOLINFOW (WM_USER + 53)
  1159. #define TTM_SETTOOLINFOA (WM_USER + 9)
  1160. #define TTM_SETTOOLINFOW (WM_USER + 54)
  1161. #define TTM_HITTESTA (WM_USER +10)
  1162. #define TTM_HITTESTW (WM_USER +55)
  1163. #define TTM_GETTEXTA (WM_USER +11)
  1164. #define TTM_GETTEXTW (WM_USER +56)
  1165. #define TTM_UPDATETIPTEXTA (WM_USER +12)
  1166. #define TTM_UPDATETIPTEXTW (WM_USER +57)
  1167. #define TTM_GETTOOLCOUNT (WM_USER +13)
  1168. #define TTM_ENUMTOOLSA (WM_USER +14)
  1169. #define TTM_ENUMTOOLSW (WM_USER +58)
  1170. #define TTM_GETCURRENTTOOLA (WM_USER + 15)
  1171. #define TTM_GETCURRENTTOOLW (WM_USER + 59)
  1172. #define TTM_WINDOWFROMPOINT (WM_USER + 16)
  1173. #define TTM_TRACKACTIVATE (WM_USER + 17) // wParam = TRUE/FALSE start end lparam = LPTOOLINFO
  1174. #define TTM_TRACKPOSITION (WM_USER + 18) // lParam = dwPos
  1175. #define TTM_SETTIPBKCOLOR (WM_USER + 19)
  1176. #define TTM_SETTIPTEXTCOLOR (WM_USER + 20)
  1177. #define TTM_GETDELAYTIME (WM_USER + 21)
  1178. #define TTM_GETTIPBKCOLOR (WM_USER + 22)
  1179. #define TTM_GETTIPTEXTCOLOR (WM_USER + 23)
  1180. #define TTM_SETMAXTIPWIDTH (WM_USER + 24)
  1181. #define TTM_GETMAXTIPWIDTH (WM_USER + 25)
  1182. #define TTM_SETMARGIN (WM_USER + 26) // lParam = lprc
  1183. #define TTM_GETMARGIN (WM_USER + 27) // lParam = lprc
  1184. #define TTM_POP (WM_USER + 28)
  1185. #ifdef UNICODE
  1186. #define TTM_ADDTOOL TTM_ADDTOOLW
  1187. #define TTM_DELTOOL TTM_DELTOOLW
  1188. #define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW
  1189. #define TTM_GETTOOLINFO TTM_GETTOOLINFOW
  1190. #define TTM_SETTOOLINFO TTM_SETTOOLINFOW
  1191. #define TTM_HITTEST TTM_HITTESTW
  1192. #define TTM_GETTEXT TTM_GETTEXTW
  1193. #define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW
  1194. #define TTM_ENUMTOOLS TTM_ENUMTOOLSW
  1195. #define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW
  1196. #else
  1197. #define TTM_ADDTOOL TTM_ADDTOOLA
  1198. #define TTM_DELTOOL TTM_DELTOOLA
  1199. #define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA
  1200. #define TTM_GETTOOLINFO TTM_GETTOOLINFOA
  1201. #define TTM_SETTOOLINFO TTM_SETTOOLINFOA
  1202. #define TTM_HITTEST TTM_HITTESTA
  1203. #define TTM_GETTEXT TTM_GETTEXTA
  1204. #define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA
  1205. #define TTM_ENUMTOOLS TTM_ENUMTOOLSA
  1206. #define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA
  1207. #endif
  1208. typedef struct _TT_HITTESTINFOA {
  1209. HWND hwnd;
  1210. POINT pt;
  1211. TTTOOLINFOA ti;
  1212. } TTHITTESTINFOA, FAR * LPTTHITTESTINFOA;
  1213. typedef struct _TT_HITTESTINFOW {
  1214. HWND hwnd;
  1215. POINT pt;
  1216. TTTOOLINFOW ti;
  1217. } TTHITTESTINFOW, FAR * LPTTHITTESTINFOW;
  1218. #define LPHITTESTINFOW LPTTHITTESTINFOW
  1219. #define LPHITTESTINFOA LPTTHITTESTINFOA
  1220. #define LPHITTESTINFO LPTTHITTESTINFO
  1221. #ifdef UNICODE
  1222. #define TTHITTESTINFO TTHITTESTINFOW
  1223. #define LPTTHITTESTINFO LPTTHITTESTINFOW
  1224. #else
  1225. #define TTHITTESTINFO TTHITTESTINFOA
  1226. #define LPTTHITTESTINFO LPTTHITTESTINFOA
  1227. #endif
  1228. #define TTN_GETDISPINFOA (TTN_FIRST - 0)
  1229. #define TTN_GETDISPINFOW (TTN_FIRST - 10)
  1230. #define TTN_SHOW (TTN_FIRST - 1)
  1231. #define TTN_POP (TTN_FIRST - 2)
  1232. #ifdef UNICODE
  1233. #define TTN_GETDISPINFO TTN_GETDISPINFOW
  1234. #else
  1235. #define TTN_GETDISPINFO TTN_GETDISPINFOA
  1236. #endif
  1237. #define TTN_NEEDTEXT TTN_GETDISPINFO
  1238. #define TTN_NEEDTEXTA TTN_GETDISPINFOA
  1239. #define TTN_NEEDTEXTW TTN_GETDISPINFOW
  1240. typedef struct tagNMTTDISPIFNOA {
  1241. NMHDR hdr;
  1242. LPSTR lpszText;
  1243. char szText[80];
  1244. HINSTANCE hinst;
  1245. UINT uFlags;
  1246. LPARAM lParam;
  1247. } NMTTDISPINFOA, FAR *LPNMTTDISPINFOA;
  1248. typedef struct tagNMTTDISPINFOW {
  1249. NMHDR hdr;
  1250. LPWSTR lpszText;
  1251. WCHAR szText[80];
  1252. HINSTANCE hinst;
  1253. UINT uFlags;
  1254. LPARAM lParam;
  1255. } NMTTDISPINFOW, FAR *LPNMTTDISPINFOW;
  1256. #define TOOLTIPTEXTW NMTTDISPINFOW
  1257. #define TOOLTIPTEXTA NMTTDISPINFOA
  1258. #define TOOLTIPTEXT NMTTDISPINFO
  1259. #define LPTOOLTIPTEXT LPNMTTDISPINFO
  1260. #define LPTOOLTIPTEXTA LPNMTTDISPINFOA
  1261. #define LPTOOLTIPTEXTW LPNMTTDISPINFOW
  1262. #ifdef UNICODE
  1263. #define NMTTDISPINFO NMTTDISPINFOW
  1264. #define LPNMTTDISPINFO LPNMTTDISPINFOW
  1265. #else
  1266. #define NMTTDISPINFO NMTTDISPINFOA
  1267. #define LPNMTTDISPINFO LPNMTTDISPINFOA
  1268. #endif
  1269. #endif
  1270. //====== STATUS BAR CONTROL ===================================================
  1271. #ifndef NOSTATUSBAR
  1272. // SBS_* styles need to not overlap with CCS_* values ;Internal
  1273. ;Internal
  1274. #define SBARS_SIZEGRIP 0x0100
  1275. WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR pszText, UINT uFlags);
  1276. WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR pszText, UINT uFlags);
  1277. WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID);
  1278. WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID);
  1279. #ifdef UNICODE
  1280. #define CreateStatusWindow CreateStatusWindowW
  1281. #define DrawStatusText DrawStatusTextW
  1282. #else
  1283. #define CreateStatusWindow CreateStatusWindowA
  1284. #define DrawStatusText DrawStatusTextA
  1285. #endif
  1286. #ifdef _WIN32
  1287. #define STATUSCLASSNAMEW L"msctls_statusbar32"
  1288. #define STATUSCLASSNAMEA "msctls_statusbar32"
  1289. #ifdef UNICODE
  1290. #define STATUSCLASSNAME STATUSCLASSNAMEW
  1291. #else
  1292. #define STATUSCLASSNAME STATUSCLASSNAMEA
  1293. #endif
  1294. #else
  1295. #define STATUSCLASSNAME "msctls_statusbar"
  1296. #endif
  1297. #define SB_SETTEXTA (WM_USER+1)
  1298. #define SB_SETTEXTW (WM_USER+11)
  1299. #define SB_GETTEXTA (WM_USER+2)
  1300. #define SB_GETTEXTW (WM_USER+13)
  1301. #define SB_GETTEXTLENGTHA (WM_USER+3)
  1302. #define SB_GETTEXTLENGTHW (WM_USER+12)
  1303. #ifdef UNICODE
  1304. #define SB_GETTEXT SB_GETTEXTW
  1305. #define SB_SETTEXT SB_SETTEXTW
  1306. #define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW
  1307. #else
  1308. #define SB_GETTEXT SB_GETTEXTA
  1309. #define SB_SETTEXT SB_SETTEXTA
  1310. #define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA
  1311. #endif
  1312. #define SB_SETPARTS (WM_USER+4)
  1313. #define SB_SETBORDERS (WM_USER+5) ;Internal
  1314. #define SB_GETPARTS (WM_USER+6)
  1315. #define SB_GETBORDERS (WM_USER+7)
  1316. #define SB_SETMINHEIGHT (WM_USER+8)
  1317. #define SB_SIMPLE (WM_USER+9)
  1318. #define SB_GETRECT (WM_USER+10)
  1319. // Warning +11-+13 are used in the unicode stuff above! ;Internal
  1320. #define SB_ISSIMPLE (WM_USER+14)
  1321. #define SBT_OWNERDRAW 0x1000
  1322. #define SBT_NOBORDERS 0x0100
  1323. #define SBT_POPOUT 0x0200
  1324. #define SBT_RTLREADING 0x0400
  1325. #endif
  1326. //====== MENU HELP ============================================================
  1327. #ifndef NOMENUHELP
  1328. WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT FAR *lpwIDs);
  1329. WINCOMMCTRLAPI BOOL WINAPI ShowHideMenuCtl(HWND hWnd, UINT uFlags, LPINT lpInfo);
  1330. WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo);
  1331. /*REVIEW: is this internal? */ ;Internal
  1332. #define MINSYSCOMMAND SC_SIZE
  1333. #endif
  1334. ;begin_internal
  1335. /*/////////////////////////////////////////////////////////////////////////*/
  1336. #ifndef NOBTNLIST
  1337. /*REVIEW: should be BUTTONLIST_CLASS */
  1338. #define BUTTONLISTBOX "ButtonListBox"
  1339. /* Button List Box Styles */
  1340. #define BLS_NUMBUTTONS 0x00FF
  1341. #define BLS_VERTICAL 0x0100
  1342. #define BLS_NOSCROLL 0x0200
  1343. /* Button List Box Messages */
  1344. #define BL_ADDBUTTON (WM_USER+1)
  1345. #define BL_DELETEBUTTON (WM_USER+2)
  1346. #define BL_GETCARETINDEX (WM_USER+3)
  1347. #define BL_GETCOUNT (WM_USER+4)
  1348. #define BL_GETCURSEL (WM_USER+5)
  1349. #define BL_GETITEMDATA (WM_USER+6)
  1350. #define BL_GETITEMRECT (WM_USER+7)
  1351. #define BL_GETTEXT (WM_USER+8)
  1352. #define BL_GETTEXTLEN (WM_USER+9)
  1353. #define BL_GETTOPINDEX (WM_USER+10)
  1354. #define BL_INSERTBUTTON (WM_USER+11)
  1355. #define BL_RESETCONTENT (WM_USER+12)
  1356. #define BL_SETCARETINDEX (WM_USER+13)
  1357. #define BL_SETCURSEL (WM_USER+14)
  1358. #define BL_SETITEMDATA (WM_USER+15)
  1359. #define BL_SETTOPINDEX (WM_USER+16)
  1360. #define BL_MSGMAX (WM_USER+17)
  1361. /* Button listbox notification codes send in WM_COMMAND */
  1362. #define BLN_ERRSPACE (-2)
  1363. #define BLN_SELCHANGE 1
  1364. #define BLN_CLICKED 2
  1365. #define BLN_SELCANCEL 3
  1366. #define BLN_SETFOCUS 4
  1367. #define BLN_KILLFOCUS 5
  1368. /* Message return values */
  1369. #define BL_OKAY 0
  1370. #define BL_ERR (-1)
  1371. #define BL_ERRSPACE (-2)
  1372. /* Create structure for */
  1373. /* BL_ADDBUTTON and */
  1374. /* BL_INSERTBUTTON */
  1375. /* lpCLB = (LPCREATELISTBUTTON)lParam */
  1376. typedef struct tagCREATELISTBUTTON {
  1377. UINT cbSize; /* size of structure */
  1378. DWORD dwItemData; /* user defined item data */
  1379. /* for LB_GETITEMDATA and LB_SETITEMDATA */
  1380. HBITMAP hBitmap; /* button bitmap */
  1381. LPCSTR lpszText; /* button text */
  1382. } CREATELISTBUTTON, FAR* LPCREATELISTBUTTON;
  1383. #endif /* NOBTNLIST */
  1384. //=============================================================================
  1385. ;end_internal
  1386. //====== TRACKBAR CONTROL =====================================================
  1387. #ifndef NOTRACKBAR
  1388. #ifdef _WIN32
  1389. #define TRACKBAR_CLASSA "msctls_trackbar32"
  1390. #define TRACKBAR_CLASSW L"msctls_trackbar32"
  1391. #ifdef UNICODE
  1392. #define TRACKBAR_CLASS TRACKBAR_CLASSW
  1393. #else
  1394. #define TRACKBAR_CLASS TRACKBAR_CLASSA
  1395. #endif
  1396. #else
  1397. #define TRACKBAR_CLASS "msctls_trackbar"
  1398. #endif
  1399. #define TBS_AUTOTICKS 0x0001
  1400. #define TBS_VERT 0x0002
  1401. #define TBS_HORZ 0x0000
  1402. #define TBS_TOP 0x0004
  1403. #define TBS_BOTTOM 0x0000
  1404. #define TBS_LEFT 0x0004
  1405. #define TBS_RIGHT 0x0000
  1406. #define TBS_BOTH 0x0008
  1407. #define TBS_NOTICKS 0x0010
  1408. #define TBS_ENABLESELRANGE 0x0020
  1409. #define TBS_FIXEDLENGTH 0x0040
  1410. #define TBS_NOTHUMB 0x0080
  1411. #define TBS_TOOLTIPS 0x0100
  1412. #define TBM_GETPOS (WM_USER)
  1413. #define TBM_GETRANGEMIN (WM_USER+1)
  1414. #define TBM_GETRANGEMAX (WM_USER+2)
  1415. #define TBM_GETTIC (WM_USER+3)
  1416. #define TBM_SETTIC (WM_USER+4)
  1417. #define TBM_SETPOS (WM_USER+5)
  1418. #define TBM_SETRANGE (WM_USER+6)
  1419. #define TBM_SETRANGEMIN (WM_USER+7)
  1420. #define TBM_SETRANGEMAX (WM_USER+8)
  1421. #define TBM_CLEARTICS (WM_USER+9)
  1422. #define TBM_SETSEL (WM_USER+10)
  1423. #define TBM_SETSELSTART (WM_USER+11)
  1424. #define TBM_SETSELEND (WM_USER+12)
  1425. #define TBM_GETPTICS (WM_USER+14)
  1426. #define TBM_GETTICPOS (WM_USER+15)
  1427. #define TBM_GETNUMTICS (WM_USER+16)
  1428. #define TBM_GETSELSTART (WM_USER+17)
  1429. #define TBM_GETSELEND (WM_USER+18)
  1430. #define TBM_CLEARSEL (WM_USER+19)
  1431. #define TBM_SETTICFREQ (WM_USER+20)
  1432. #define TBM_SETPAGESIZE (WM_USER+21)
  1433. #define TBM_GETPAGESIZE (WM_USER+22)
  1434. #define TBM_SETLINESIZE (WM_USER+23)
  1435. #define TBM_GETLINESIZE (WM_USER+24)
  1436. #define TBM_GETTHUMBRECT (WM_USER+25)
  1437. #define TBM_GETCHANNELRECT (WM_USER+26)
  1438. #define TBM_SETTHUMBLENGTH (WM_USER+27)
  1439. #define TBM_GETTHUMBLENGTH (WM_USER+28)
  1440. #define TBM_SETTOOLTIPS (WM_USER+29)
  1441. #define TBM_GETTOOLTIPS (WM_USER+30)
  1442. #define TBM_SETTIPSIDE (WM_USER+31)
  1443. // TrackBar Tip Side flags
  1444. #define TBTS_TOP 0
  1445. #define TBTS_LEFT 1
  1446. #define TBTS_BOTTOM 2
  1447. #define TBTS_RIGHT 3
  1448. #define TBM_SETBUDDY (WM_USER+32) // wparam = BOOL fLeft; (or right)
  1449. #define TBM_GETBUDDY (WM_USER+33) // wparam = BOOL fLeft; (or right)
  1450. /*REVIEW: these match the SB_ (scroll bar messages); define them that way? */ ;Internal
  1451. ;Internal
  1452. #define TB_LINEUP 0
  1453. #define TB_LINEDOWN 1
  1454. #define TB_PAGEUP 2
  1455. #define TB_PAGEDOWN 3
  1456. #define TB_THUMBPOSITION 4
  1457. #define TB_THUMBTRACK 5
  1458. #define TB_TOP 6
  1459. #define TB_BOTTOM 7
  1460. #define TB_ENDTRACK 8
  1461. // custom draw item specs
  1462. #define TBCD_TICS 0x0001
  1463. #define TBCD_THUMB 0x0002
  1464. #define TBCD_CHANNEL 0x0003
  1465. #endif // trackbar
  1466. //====== DRAG LIST CONTROL ====================================================
  1467. #ifndef NODRAGLIST
  1468. typedef struct tagDRAGLISTINFO {
  1469. UINT uNotification;
  1470. HWND hWnd;
  1471. POINT ptCursor;
  1472. } DRAGLISTINFO, FAR *LPDRAGLISTINFO;
  1473. #define DL_BEGINDRAG (WM_USER+133)
  1474. #define DL_DRAGGING (WM_USER+134)
  1475. #define DL_DROPPED (WM_USER+135)
  1476. #define DL_CANCELDRAG (WM_USER+136)
  1477. #define DL_CURSORSET 0
  1478. #define DL_STOPCURSOR 1
  1479. #define DL_COPYCURSOR 2
  1480. #define DL_MOVECURSOR 3
  1481. ;begin_internal
  1482. //
  1483. // Unnecessary to create a A and W version
  1484. // of this string since it is only passed
  1485. // to RegisterWindowMessage.
  1486. //
  1487. ;end_internal
  1488. #define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg")
  1489. WINCOMMCTRLAPI BOOL WINAPI MakeDragList(HWND hLB);
  1490. WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent, HWND hLB, int nItem);
  1491. // BUGBUG -- there's a message to do this now -- just macro-ize this one ;Internal
  1492. WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB, POINT pt, BOOL bAutoScroll);
  1493. #endif
  1494. //====== UPDOWN CONTROL =======================================================
  1495. #ifndef NOUPDOWN
  1496. #ifdef _WIN32
  1497. #define UPDOWN_CLASSA "msctls_updown32"
  1498. #define UPDOWN_CLASSW L"msctls_updown32"
  1499. #ifdef UNICODE
  1500. #define UPDOWN_CLASS UPDOWN_CLASSW
  1501. #else
  1502. #define UPDOWN_CLASS UPDOWN_CLASSA
  1503. #endif
  1504. #else
  1505. #define UPDOWN_CLASS "msctls_updown"
  1506. #endif
  1507. typedef struct _UDACCEL {
  1508. UINT nSec;
  1509. UINT nInc;
  1510. } UDACCEL, FAR *LPUDACCEL;
  1511. #define UD_MAXVAL 0x7fff
  1512. #define UD_MINVAL (-UD_MAXVAL)
  1513. #define UDS_WRAP 0x0001
  1514. #define UDS_SETBUDDYINT 0x0002
  1515. #define UDS_ALIGNRIGHT 0x0004
  1516. #define UDS_ALIGNLEFT 0x0008
  1517. #define UDS_AUTOBUDDY 0x0010
  1518. #define UDS_ARROWKEYS 0x0020
  1519. #define UDS_HORZ 0x0040
  1520. #define UDS_NOTHOUSANDS 0x0080
  1521. #define UDS_HOTTRACK 0x0100
  1522. #define UDM_SETRANGE (WM_USER+101)
  1523. #define UDM_GETRANGE (WM_USER+102)
  1524. #define UDM_SETPOS (WM_USER+103)
  1525. #define UDM_GETPOS (WM_USER+104)
  1526. #define UDM_SETBUDDY (WM_USER+105)
  1527. #define UDM_GETBUDDY (WM_USER+106)
  1528. #define UDM_SETACCEL (WM_USER+107)
  1529. #define UDM_GETACCEL (WM_USER+108)
  1530. #define UDM_SETBASE (WM_USER+109)
  1531. #define UDM_GETBASE (WM_USER+110)
  1532. WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy,
  1533. HWND hParent, int nID, HINSTANCE hInst,
  1534. HWND hBuddy,
  1535. int nUpper, int nLower, int nPos);
  1536. typedef struct _NM_UPDOWN
  1537. {
  1538. NMHDR hdr;
  1539. int iPos;
  1540. int iDelta;
  1541. } NMUPDOWN, FAR *LPNMUPDOWN;
  1542. #define NM_UPDOWN NMUPDOWN
  1543. #define LPNM_UPDOWN LPNMUPDOWN
  1544. #define UDN_DELTAPOS (UDN_FIRST - 1)
  1545. #endif
  1546. //====== PROGRESS CONTROL =====================================================
  1547. #ifndef NOPROGRESS
  1548. #ifdef _WIN32
  1549. #define PROGRESS_CLASSA "msctls_progress32"
  1550. #define PROGRESS_CLASSW L"msctls_progress32"
  1551. #ifdef UNICODE
  1552. #define PROGRESS_CLASS PROGRESS_CLASSW
  1553. #else
  1554. #define PROGRESS_CLASS PROGRESS_CLASSA
  1555. #endif
  1556. #else
  1557. #define PROGRESS_CLASS "msctls_progress"
  1558. #endif
  1559. #define PBS_SHOWPERCENT 0x01 ;Internal
  1560. #define PBS_SHOWPOS 0x02 ;Internal
  1561. ;Internal
  1562. ;Internal
  1563. #define PBS_SMOOTH 0x01
  1564. #define PBS_VERTICAL 0x04
  1565. #define PBM_SETRANGE (WM_USER+1)
  1566. #define PBM_SETPOS (WM_USER+2)
  1567. #define PBM_DELTAPOS (WM_USER+3)
  1568. #define PBM_SETSTEP (WM_USER+4)
  1569. #define PBM_STEPIT (WM_USER+5)
  1570. #define PBM_SETRANGE32 (WM_USER+6) // lParam = high, wParam = low
  1571. typedef struct
  1572. {
  1573. int iLow;
  1574. int iHigh;
  1575. } PBRANGE, *PPBRANGE;
  1576. #define PBM_GETRANGE (WM_USER+7) // wParam = return (TRUE ? low : high). lParam = PPBRANGE or NULL
  1577. #define PBM_GETPOS (WM_USER+8)
  1578. #endif
  1579. //====== HOTKEY CONTROL =======================================================
  1580. #ifndef NOHOTKEY
  1581. #define HOTKEYF_SHIFT 0x01
  1582. #define HOTKEYF_CONTROL 0x02
  1583. #define HOTKEYF_ALT 0x04
  1584. #define HOTKEYF_EXT 0x08
  1585. #define HKCOMB_NONE 0x0001
  1586. #define HKCOMB_S 0x0002
  1587. #define HKCOMB_C 0x0004
  1588. #define HKCOMB_A 0x0008
  1589. #define HKCOMB_SC 0x0010
  1590. #define HKCOMB_SA 0x0020
  1591. #define HKCOMB_CA 0x0040
  1592. #define HKCOMB_SCA 0x0080
  1593. #define HKM_SETHOTKEY (WM_USER+1)
  1594. #define HKM_GETHOTKEY (WM_USER+2)
  1595. #define HKM_SETRULES (WM_USER+3)
  1596. #ifdef _WIN32
  1597. #define HOTKEY_CLASSA "msctls_hotkey32"
  1598. #define HOTKEY_CLASSW L"msctls_hotkey32"
  1599. #ifdef UNICODE
  1600. #define HOTKEY_CLASS HOTKEY_CLASSW
  1601. #else
  1602. #define HOTKEY_CLASS HOTKEY_CLASSA
  1603. #endif
  1604. #else
  1605. #define HOTKEY_CLASS "msctls_hotkey"
  1606. #endif
  1607. #endif
  1608. //====== COMMON CONTROL STYLES ================================================
  1609. #define CCS_TOP 0x00000001L
  1610. #define CCS_NOMOVEY 0x00000002L
  1611. #define CCS_BOTTOM 0x00000003L
  1612. #define CCS_NORESIZE 0x00000004L
  1613. #define CCS_NOPARENTALIGN 0x00000008L
  1614. #define CCS_NOHILITE 0x00000010L ;Internal
  1615. #define CCS_ADJUSTABLE 0x00000020L
  1616. #define CCS_NODIVIDER 0x00000040L
  1617. #define CCS_VERT 0x00000080L
  1618. #define CCS_LEFT (CCS_VERT | CCS_TOP)
  1619. #define CCS_RIGHT (CCS_VERT | CCS_BOTTOM)
  1620. #define CCS_NOMOVEX (CCS_VERT | CCS_NOMOVEY)
  1621. //====== LISTVIEW CONTROL =====================================================
  1622. #ifndef NOLISTVIEW
  1623. #ifdef _WIN32
  1624. #define WC_LISTVIEWA "SysListView32"
  1625. #define WC_LISTVIEWW L"SysListView32"
  1626. #ifdef UNICODE
  1627. #define WC_LISTVIEW WC_LISTVIEWW
  1628. #else
  1629. #define WC_LISTVIEW WC_LISTVIEWA
  1630. #endif
  1631. #else
  1632. #define WC_LISTVIEW "SysListView"
  1633. #endif
  1634. #define LVS_PRIVATEIMAGELISTS 0x0000 ;internal
  1635. #define LVS_ICON 0x0000
  1636. #define LVS_REPORT 0x0001
  1637. #define LVS_SMALLICON 0x0002
  1638. #define LVS_LIST 0x0003
  1639. #define LVS_TYPEMASK 0x0003
  1640. #define LVS_SINGLESEL 0x0004
  1641. #define LVS_SHOWSELALWAYS 0x0008
  1642. #define LVS_SORTASCENDING 0x0010
  1643. #define LVS_SORTDESCENDING 0x0020
  1644. #define LVS_SHAREIMAGELISTS 0x0040
  1645. #define LVS_NOLABELWRAP 0x0080
  1646. #define LVS_AUTOARRANGE 0x0100
  1647. #define LVS_EDITLABELS 0x0200
  1648. #define LVS_OWNERDATA 0x1000
  1649. #define LVS_NOSCROLL 0x2000
  1650. #define LVS_TYPESTYLEMASK 0xfc00
  1651. #define LVS_ALIGNTOP 0x0000
  1652. #define LVS_ALIGNBOTTOM 0x0400 ;Internal
  1653. #define LVS_ALIGNLEFT 0x0800
  1654. #define LVS_ALIGNRIGHT 0x0c00 ;Internal
  1655. #define LVS_ALIGNMASK 0x0c00
  1656. #define LVS_OWNERDRAWFIXED 0x0400
  1657. #define LVS_NOCOLUMNHEADER 0x4000
  1658. #define LVS_NOSORTHEADER 0x8000
  1659. #define LVM_GETBKCOLOR (LVM_FIRST + 0)
  1660. #define ListView_GetBkColor(hwnd) \
  1661. (COLORREF)SNDMSG((hwnd), LVM_GETBKCOLOR, 0, 0L)
  1662. #define LVM_SETBKCOLOR (LVM_FIRST + 1)
  1663. #define ListView_SetBkColor(hwnd, clrBk) \
  1664. (BOOL)SNDMSG((hwnd), LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk))
  1665. #define LVM_GETIMAGELIST (LVM_FIRST + 2)
  1666. #define ListView_GetImageList(hwnd, iImageList) \
  1667. (HIMAGELIST)SNDMSG((hwnd), LVM_GETIMAGELIST, (WPARAM)(INT)(iImageList), 0L)
  1668. #define LVSIL_NORMAL 0
  1669. #define LVSIL_SMALL 1
  1670. #define LVSIL_STATE 2
  1671. #define LVM_SETIMAGELIST (LVM_FIRST + 3)
  1672. #define ListView_SetImageList(hwnd, himl, iImageList) \
  1673. (HIMAGELIST)(UINT)SNDMSG((hwnd), LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(UINT)(HIMAGELIST)(himl))
  1674. #define LVM_GETITEMCOUNT (LVM_FIRST + 4)
  1675. #define ListView_GetItemCount(hwnd) \
  1676. (int)SNDMSG((hwnd), LVM_GETITEMCOUNT, 0, 0L)
  1677. #define LVIF_TEXT 0x0001
  1678. #define LVIF_IMAGE 0x0002
  1679. #define LVIF_PARAM 0x0004
  1680. #define LVIF_STATE 0x0008
  1681. #define LVIF_INDENT 0x0010
  1682. #define LVIF_ALL 0x001f ;Internal
  1683. #define LVIF_NORECOMPUTE 0x0800
  1684. #define LVIF_VALID 0x081f ;Internal
  1685. #define LVIF_RESERVED 0xf000 // all bits in high nibble is for notify specific stuff ;Internal
  1686. #define LVIS_FOCUSED 0x0001
  1687. #define LVIS_SELECTED 0x0002
  1688. #define LVIS_CUT 0x0004
  1689. #define LVIS_DROPHILITED 0x0008
  1690. #define LVIS_DISABLED 0x0010 // GOING AWAY ;Internal
  1691. #define LVIS_LINK 0x0040 ;Internal
  1692. #define LVIS_OVERLAYMASK 0x0F00
  1693. #define LVIS_STATEIMAGEMASK 0xF000
  1694. #define LVIS_USERMASK LVIS_STATEIMAGEMASK // BUGBUG: remove me. ;Internal
  1695. #define LVIS_ALL 0xFFFF ;Internal
  1696. #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12)
  1697. #define STATEIMAGEMASKTOINDEX(i) ((i & LVIS_STATEIMAGEMASK) >> 12) ;Internal
  1698. #define I_INDENTCALLBACK (-1)
  1699. typedef struct tagLVITEMA
  1700. {
  1701. UINT mask;
  1702. int iItem;
  1703. int iSubItem;
  1704. UINT state;
  1705. UINT stateMask;
  1706. LPSTR pszText;
  1707. int cchTextMax;
  1708. int iImage;
  1709. LPARAM lParam;
  1710. // all items above this line were for win95. don't touch them. ;Internal
  1711. int iIndent;
  1712. } LVITEMA, FAR* LPLVITEMA;
  1713. #define LV_ITEMA LVITEMA
  1714. typedef struct tagLVITEMW
  1715. {
  1716. UINT mask;
  1717. int iItem;
  1718. int iSubItem;
  1719. UINT state;
  1720. UINT stateMask;
  1721. LPWSTR pszText;
  1722. int cchTextMax;
  1723. int iImage;
  1724. LPARAM lParam;
  1725. // all items above this line were for win95. don't touch them. ;Internal
  1726. int iIndent;
  1727. } LVITEMW, FAR* LPLVITEMW;
  1728. #define LV_ITEMW LVITEMW
  1729. #define LV_ITEM LVITEM
  1730. #ifdef UNICODE
  1731. #define LVITEM LVITEMW
  1732. #define LPLVITEM LPLVITEMW
  1733. #else
  1734. #define LVITEM LVITEMA
  1735. #define LPLVITEM LPLVITEMA
  1736. #endif
  1737. #define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L)
  1738. #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)
  1739. #ifdef UNICODE
  1740. #define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW
  1741. #else
  1742. #define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA
  1743. #endif
  1744. #define I_IMAGECALLBACK (-1)
  1745. #define LVM_GETITEMA (LVM_FIRST + 5)
  1746. #define LVM_GETITEMW (LVM_FIRST + 75)
  1747. #ifdef UNICODE
  1748. #define LVM_GETITEM LVM_GETITEMW
  1749. #else
  1750. #define LVM_GETITEM LVM_GETITEMA
  1751. #endif
  1752. #define ListView_GetItem(hwnd, pitem) \
  1753. (BOOL)SNDMSG((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM FAR*)(pitem))
  1754. #define LVM_SETITEMA (LVM_FIRST + 6)
  1755. #define LVM_SETITEMW (LVM_FIRST + 76)
  1756. #ifdef UNICODE
  1757. #define LVM_SETITEM LVM_SETITEMW
  1758. #else
  1759. #define LVM_SETITEM LVM_SETITEMA
  1760. #endif
  1761. #define ListView_SetItem(hwnd, pitem) \
  1762. (BOOL)SNDMSG((hwnd), LVM_SETITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  1763. #define LVM_INSERTITEMA (LVM_FIRST + 7)
  1764. #define LVM_INSERTITEMW (LVM_FIRST + 77)
  1765. #ifdef UNICODE
  1766. #define LVM_INSERTITEM LVM_INSERTITEMW
  1767. #else
  1768. #define LVM_INSERTITEM LVM_INSERTITEMA
  1769. #endif
  1770. #define ListView_InsertItem(hwnd, pitem) \
  1771. (int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  1772. #define LVM_DELETEITEM (LVM_FIRST + 8)
  1773. #define ListView_DeleteItem(hwnd, i) \
  1774. (BOOL)SNDMSG((hwnd), LVM_DELETEITEM, (WPARAM)(int)(i), 0L)
  1775. #define LVM_DELETEALLITEMS (LVM_FIRST + 9)
  1776. #define ListView_DeleteAllItems(hwnd) \
  1777. (BOOL)SNDMSG((hwnd), LVM_DELETEALLITEMS, 0, 0L)
  1778. #define LVM_GETCALLBACKMASK (LVM_FIRST + 10)
  1779. #define ListView_GetCallbackMask(hwnd) \
  1780. (BOOL)SNDMSG((hwnd), LVM_GETCALLBACKMASK, 0, 0)
  1781. #define LVM_SETCALLBACKMASK (LVM_FIRST + 11)
  1782. #define ListView_SetCallbackMask(hwnd, mask) \
  1783. (BOOL)SNDMSG((hwnd), LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0)
  1784. #define LVNI_ALL 0x0000
  1785. #define LVNI_FOCUSED 0x0001
  1786. #define LVNI_SELECTED 0x0002
  1787. #define LVNI_CUT 0x0004
  1788. #define LVNI_DROPHILITED 0x0008
  1789. #define LVNI_PREVIOUS 0x0020 ;Internal
  1790. #define LVNI_ABOVE 0x0100
  1791. #define LVNI_BELOW 0x0200
  1792. #define LVNI_TOLEFT 0x0400
  1793. #define LVNI_TORIGHT 0x0800
  1794. #define LVM_GETNEXTITEM (LVM_FIRST + 12)
  1795. #define ListView_GetNextItem(hwnd, i, flags) \
  1796. (int)SNDMSG((hwnd), LVM_GETNEXTITEM, (WPARAM)(int)(i), MAKELPARAM((flags), 0))
  1797. #define LVFI_PARAM 0x0001
  1798. #define LVFI_STRING 0x0002
  1799. #define LVFI_SUBSTRING 0x0004 ;Internal
  1800. #define LVFI_PARTIAL 0x0008
  1801. #define LVFI_NOCASE 0x0010 ;Internal
  1802. #define LVFI_WRAP 0x0020
  1803. #define LVFI_NEARESTXY 0x0040
  1804. typedef struct tagLVFINDINFOA
  1805. {
  1806. UINT flags;
  1807. LPCSTR psz;
  1808. LPARAM lParam;
  1809. POINT pt;
  1810. UINT vkDirection;
  1811. } LVFINDINFOA, FAR* LPFINDINFOA;
  1812. #define LV_FINDINFOA LVFINDINFOA
  1813. typedef struct tagLVFINDINFOW
  1814. {
  1815. UINT flags;
  1816. LPCWSTR psz;
  1817. LPARAM lParam;
  1818. POINT pt;
  1819. UINT vkDirection;
  1820. } LVFINDINFOW, FAR* LPFINDINFOW;
  1821. #define LV_FINDINFOW LVFINDINFOW
  1822. #define LV_FINDINFO LVFINDINFO
  1823. #ifdef UNICODE
  1824. #define LVFINDINFO LVFINDINFOW
  1825. #else
  1826. #define LVFINDINFO LVFINDINFOA
  1827. #endif
  1828. #define LVM_FINDITEMA (LVM_FIRST + 13)
  1829. #define LVM_FINDITEMW (LVM_FIRST + 83)
  1830. #ifdef UNICODE
  1831. #define LVM_FINDITEM LVM_FINDITEMW
  1832. #else
  1833. #define LVM_FINDITEM LVM_FINDITEMA
  1834. #endif
  1835. #define ListView_FindItem(hwnd, iStart, plvfi) \
  1836. (int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
  1837. // the following #define's must be packed sequentially. ;Internal
  1838. #define LVIR_BOUNDS 0
  1839. #define LVIR_ICON 1
  1840. #define LVIR_LABEL 2
  1841. #define LVIR_SELECTBOUNDS 3
  1842. #define LVIR_MAX 4 ;Internal
  1843. #define LVM_GETITEMRECT (LVM_FIRST + 14)
  1844. #define ListView_GetItemRect(hwnd, i, prc, code) \
  1845. (BOOL)SNDMSG((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \
  1846. ((prc) ? (((RECT FAR *)(prc))->left = (code),(LPARAM)(RECT FAR*)(prc)) : (LPARAM)(RECT FAR*)NULL))
  1847. #define LVM_SETITEMPOSITION (LVM_FIRST + 15)
  1848. #define ListView_SetItemPosition(hwndLV, i, x, y) \
  1849. (BOOL)SNDMSG((hwndLV), LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y)))
  1850. #define LVM_GETITEMPOSITION (LVM_FIRST + 16)
  1851. #define ListView_GetItemPosition(hwndLV, i, ppt) \
  1852. (BOOL)SNDMSG((hwndLV), LVM_GETITEMPOSITION, (WPARAM)(int)(i), (LPARAM)(POINT FAR*)(ppt))
  1853. #define LVM_GETSTRINGWIDTHA (LVM_FIRST + 17)
  1854. #define LVM_GETSTRINGWIDTHW (LVM_FIRST + 87)
  1855. #ifdef UNICODE
  1856. #define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW
  1857. #else
  1858. #define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA
  1859. #endif
  1860. #define ListView_GetStringWidth(hwndLV, psz) \
  1861. (int)SNDMSG((hwndLV), LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)(psz))
  1862. #define LVHT_NOWHERE 0x0001
  1863. #define LVHT_ONITEMICON 0x0002
  1864. #define LVHT_ONITEMLABEL 0x0004
  1865. #define LVHT_ONITEMSTATEICON 0x0008
  1866. #define LVHT_ONITEM (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
  1867. #define LVHT_ABOVE 0x0008
  1868. #define LVHT_BELOW 0x0010
  1869. #define LVHT_TORIGHT 0x0020
  1870. #define LVHT_TOLEFT 0x0040
  1871. typedef struct tagLVHITTESTINFO
  1872. {
  1873. POINT pt;
  1874. UINT flags;
  1875. int iItem;
  1876. int iSubItem; // this is was NOT in win95. valid only for LVM_SUBITEMHITTEST
  1877. } LVHITTESTINFO, FAR* LPLVHITTESTINFO;
  1878. #define LV_HITTESTINFO LVHITTESTINFO
  1879. #define LVM_HITTEST (LVM_FIRST + 18)
  1880. #define ListView_HitTest(hwndLV, pinfo) \
  1881. (int)SNDMSG((hwndLV), LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO FAR*)(pinfo))
  1882. #define LVM_ENSUREVISIBLE (LVM_FIRST + 19)
  1883. #define ListView_EnsureVisible(hwndLV, i, fPartialOK) \
  1884. (BOOL)SNDMSG((hwndLV), LVM_ENSUREVISIBLE, (WPARAM)(int)(i), MAKELPARAM((fPartialOK), 0))
  1885. #define LVM_SCROLL (LVM_FIRST + 20)
  1886. #define ListView_Scroll(hwndLV, dx, dy) \
  1887. (BOOL)SNDMSG((hwndLV), LVM_SCROLL, (WPARAM)(int)dx, (LPARAM)(int)dy)
  1888. #define LVM_REDRAWITEMS (LVM_FIRST + 21)
  1889. #define ListView_RedrawItems(hwndLV, iFirst, iLast) \
  1890. (BOOL)SNDMSG((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)iFirst, (LPARAM)(int)iLast)
  1891. #define LVA_DEFAULT 0x0000
  1892. #define LVA_ALIGNLEFT 0x0001
  1893. #define LVA_ALIGNTOP 0x0002
  1894. #define LVA_ALIGNRIGHT 0x0003 ;Internal
  1895. #define LVA_ALIGNBOTTOM 0x0004 ;Internal
  1896. #define LVA_SNAPTOGRID 0x0005
  1897. #define LVA_ALIGNMASK 0x0007 ;Internal
  1898. #define LVA_SORTASCENDING 0x0100 ;Internal
  1899. #define LVA_SORTDESCENDING 0x0200 ;Internal
  1900. #define LVM_ARRANGE (LVM_FIRST + 22)
  1901. #define ListView_Arrange(hwndLV, code) \
  1902. (BOOL)SNDMSG((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0L)
  1903. #define LVM_EDITLABELA (LVM_FIRST + 23)
  1904. #define LVM_EDITLABELW (LVM_FIRST + 118)
  1905. #ifdef UNICODE
  1906. #define LVM_EDITLABEL LVM_EDITLABELW
  1907. #else
  1908. #define LVM_EDITLABEL LVM_EDITLABELA
  1909. #endif
  1910. #define ListView_EditLabel(hwndLV, i) \
  1911. (HWND)SNDMSG((hwndLV), LVM_EDITLABEL, (WPARAM)(int)(i), 0L)
  1912. #define LVM_GETEDITCONTROL (LVM_FIRST + 24)
  1913. #define ListView_GetEditControl(hwndLV) \
  1914. (HWND)SNDMSG((hwndLV), LVM_GETEDITCONTROL, 0, 0L)
  1915. typedef struct tagLVCOLUMNA
  1916. {
  1917. UINT mask;
  1918. int fmt;
  1919. int cx;
  1920. LPSTR pszText;
  1921. int cchTextMax;
  1922. int iSubItem;
  1923. // all items above this line were for win95. don't touch them. ;Internal
  1924. int iImage;
  1925. int iOrder;
  1926. } LVCOLUMNA, FAR* LPLVCOLUMNA;
  1927. typedef struct tagLVCOLUMNW
  1928. {
  1929. UINT mask;
  1930. int fmt;
  1931. int cx;
  1932. LPWSTR pszText;
  1933. int cchTextMax;
  1934. int iSubItem;
  1935. // all items above this line were for win95. don't touch them. ;Internal
  1936. int iImage;
  1937. int iOrder;
  1938. } LVCOLUMNW, FAR* LPLVCOLUMNW;
  1939. #ifdef UNICODE
  1940. #define LVCOLUMN LVCOLUMNW
  1941. #define LPLVCOLUMN LPLVCOLUMNW
  1942. #else
  1943. #define LVCOLUMN LVCOLUMNA
  1944. #define LPLVCOLUMN LPLVCOLUMNA
  1945. #endif
  1946. #define LV_COLUMN LVCOLUMN
  1947. #define LV_COLUMNA LVCOLUMNA
  1948. #define LV_COLUMNW LVCOLUMNW
  1949. #define LVCF_FMT 0x0001
  1950. #define LVCF_WIDTH 0x0002
  1951. #define LVCF_TEXT 0x0004
  1952. #define LVCF_SUBITEM 0x0008
  1953. #define LVCF_IMAGE 0x0010
  1954. #define LVCF_ORDER 0x0020
  1955. #define LVCF_ALL 0x003f ;Internal
  1956. #define LVCFMT_LEFT 0x0000
  1957. #define LVCFMT_RIGHT 0x0001
  1958. #define LVCFMT_CENTER 0x0002
  1959. #define LVCFMT_JUSTIFYMASK 0x0003
  1960. #define LVCFMT_IMAGE 0x0800
  1961. #define LVCFMT_BITMAP_ON_RIGHT 0x1000
  1962. #define LVCFMT_COL_HAS_IMAGES 0x8000
  1963. #define LVM_GETCOLUMNA (LVM_FIRST + 25)
  1964. #define LVM_GETCOLUMNW (LVM_FIRST + 95)
  1965. #ifdef UNICODE
  1966. #define LVM_GETCOLUMN LVM_GETCOLUMNW
  1967. #else
  1968. #define LVM_GETCOLUMN LVM_GETCOLUMNA
  1969. #endif
  1970. #define ListView_GetColumn(hwnd, iCol, pcol) \
  1971. (BOOL)SNDMSG((hwnd), LVM_GETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(LV_COLUMN FAR*)(pcol))
  1972. #define LVM_SETCOLUMNA (LVM_FIRST + 26)
  1973. #define LVM_SETCOLUMNW (LVM_FIRST + 96)
  1974. #ifdef UNICODE
  1975. #define LVM_SETCOLUMN LVM_SETCOLUMNW
  1976. #else
  1977. #define LVM_SETCOLUMN LVM_SETCOLUMNA
  1978. #endif
  1979. #define ListView_SetColumn(hwnd, iCol, pcol) \
  1980. (BOOL)SNDMSG((hwnd), LVM_SETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  1981. #define LVM_INSERTCOLUMNA (LVM_FIRST + 27)
  1982. #define LVM_INSERTCOLUMNW (LVM_FIRST + 97)
  1983. #ifdef UNICODE
  1984. # define LVM_INSERTCOLUMN LVM_INSERTCOLUMNW
  1985. #else
  1986. # define LVM_INSERTCOLUMN LVM_INSERTCOLUMNA
  1987. #endif
  1988. #define ListView_InsertColumn(hwnd, iCol, pcol) \
  1989. (int)SNDMSG((hwnd), LVM_INSERTCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  1990. #define LVM_DELETECOLUMN (LVM_FIRST + 28)
  1991. #define ListView_DeleteColumn(hwnd, iCol) \
  1992. (BOOL)SNDMSG((hwnd), LVM_DELETECOLUMN, (WPARAM)(int)(iCol), 0)
  1993. #define LVM_GETCOLUMNWIDTH (LVM_FIRST + 29)
  1994. #define ListView_GetColumnWidth(hwnd, iCol) \
  1995. (int)SNDMSG((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0)
  1996. #define LVSCW_AUTOSIZE -1
  1997. #define LVSCW_AUTOSIZE_USEHEADER -2
  1998. #define LVM_SETCOLUMNWIDTH (LVM_FIRST + 30)
  1999. #define ListView_SetColumnWidth(hwnd, iCol, cx) \
  2000. (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0))
  2001. #define LVM_GETHEADER (LVM_FIRST + 31)
  2002. #define ListView_GetHeader(hwnd)\
  2003. (HWND)SNDMSG((hwnd), LVM_GETHEADER, 0, 0L)
  2004. #define LVM_CREATEDRAGIMAGE (LVM_FIRST + 33)
  2005. #define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \
  2006. (HIMAGELIST)SNDMSG((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft))
  2007. #define LVM_GETVIEWRECT (LVM_FIRST + 34)
  2008. #define ListView_GetViewRect(hwnd, prc) \
  2009. (BOOL)SNDMSG((hwnd), LVM_GETVIEWRECT, 0, (LPARAM)(RECT FAR*)(prc))
  2010. #define LVM_GETTEXTCOLOR (LVM_FIRST + 35)
  2011. #define ListView_GetTextColor(hwnd) \
  2012. (COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0L)
  2013. #define LVM_SETTEXTCOLOR (LVM_FIRST + 36)
  2014. #define ListView_SetTextColor(hwnd, clrText) \
  2015. (BOOL)SNDMSG((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText))
  2016. #define LVM_GETTEXTBKCOLOR (LVM_FIRST + 37)
  2017. #define ListView_GetTextBkColor(hwnd) \
  2018. (COLORREF)SNDMSG((hwnd), LVM_GETTEXTBKCOLOR, 0, 0L)
  2019. #define LVM_SETTEXTBKCOLOR (LVM_FIRST + 38)
  2020. #define ListView_SetTextBkColor(hwnd, clrTextBk) \
  2021. (BOOL)SNDMSG((hwnd), LVM_SETTEXTBKCOLOR, 0, (LPARAM)(COLORREF)(clrTextBk))
  2022. #define LVM_GETTOPINDEX (LVM_FIRST + 39)
  2023. #define ListView_GetTopIndex(hwndLV) \
  2024. (int)SNDMSG((hwndLV), LVM_GETTOPINDEX, 0, 0)
  2025. #define LVM_GETCOUNTPERPAGE (LVM_FIRST + 40)
  2026. #define ListView_GetCountPerPage(hwndLV) \
  2027. (int)SNDMSG((hwndLV), LVM_GETCOUNTPERPAGE, 0, 0)
  2028. #define LVM_GETORIGIN (LVM_FIRST + 41)
  2029. #define ListView_GetOrigin(hwndLV, ppt) \
  2030. (BOOL)SNDMSG((hwndLV), LVM_GETORIGIN, (WPARAM)0, (LPARAM)(POINT FAR*)(ppt))
  2031. #define LVM_UPDATE (LVM_FIRST + 42)
  2032. #define ListView_Update(hwndLV, i) \
  2033. (BOOL)SNDMSG((hwndLV), LVM_UPDATE, (WPARAM)i, 0L)
  2034. #define LVM_SETITEMSTATE (LVM_FIRST + 43)
  2035. #define ListView_SetItemState(hwndLV, i, data, mask) \
  2036. { LV_ITEM _ms_lvi;\
  2037. _ms_lvi.stateMask = mask;\
  2038. _ms_lvi.state = data;\
  2039. SNDMSG((hwndLV), LVM_SETITEMSTATE, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  2040. }
  2041. #define LVM_GETITEMSTATE (LVM_FIRST + 44)
  2042. #define ListView_GetItemState(hwndLV, i, mask) \
  2043. (UINT)SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, (LPARAM)mask)
  2044. #define ListView_GetCheckState(hwndLV, i) \
  2045. ((((UINT)(SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, LVIS_STATEIMAGEMASK))) >> 12) -1)
  2046. #define LVM_GETITEMTEXTA (LVM_FIRST + 45)
  2047. #define LVM_GETITEMTEXTW (LVM_FIRST + 115)
  2048. #ifdef UNICODE
  2049. #define LVM_GETITEMTEXT LVM_GETITEMTEXTW
  2050. #else
  2051. #define LVM_GETITEMTEXT LVM_GETITEMTEXTA
  2052. #endif
  2053. #define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
  2054. { LV_ITEM _ms_lvi;\
  2055. _ms_lvi.iSubItem = iSubItem_;\
  2056. _ms_lvi.cchTextMax = cchTextMax_;\
  2057. _ms_lvi.pszText = pszText_;\
  2058. SNDMSG((hwndLV), LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  2059. }
  2060. #define LVM_SETITEMTEXTA (LVM_FIRST + 46)
  2061. #define LVM_SETITEMTEXTW (LVM_FIRST + 116)
  2062. #ifdef UNICODE
  2063. #define LVM_SETITEMTEXT LVM_SETITEMTEXTW
  2064. #else
  2065. #define LVM_SETITEMTEXT LVM_SETITEMTEXTA
  2066. #endif
  2067. #define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) \
  2068. { LV_ITEM _ms_lvi;\
  2069. _ms_lvi.iSubItem = iSubItem_;\
  2070. _ms_lvi.pszText = pszText_;\
  2071. SNDMSG((hwndLV), LVM_SETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\
  2072. }
  2073. // these flags only apply to LVS_OWNERDATA listviews in report or list mode
  2074. #define LVSICF_NOINVALIDATEALL 0x00000001
  2075. #define LVSICF_NOSCROLL 0x00000002
  2076. #define LVM_SETITEMCOUNT (LVM_FIRST + 47)
  2077. #define ListView_SetItemCount(hwndLV, cItems) \
  2078. SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, 0)
  2079. #define ListView_SetItemCountEx(hwndLV, cItems, dwFlags) \
  2080. SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, (LPARAM)dwFlags)
  2081. typedef int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
  2082. #define LVM_SORTITEMS (LVM_FIRST + 48)
  2083. #define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) \
  2084. (BOOL)SNDMSG((hwndLV), LVM_SORTITEMS, (WPARAM)(LPARAM)_lPrm, \
  2085. (LPARAM)(PFNLVCOMPARE)_pfnCompare)
  2086. #define LVM_SETITEMPOSITION32 (LVM_FIRST + 49)
  2087. #define ListView_SetItemPosition32(hwndLV, i, x, y) \
  2088. { POINT ptNewPos = {x,y}; \
  2089. SNDMSG((hwndLV), LVM_SETITEMPOSITION32, (WPARAM)(int)(i), (LPARAM)&ptNewPos); \
  2090. }
  2091. #define LVM_GETSELECTEDCOUNT (LVM_FIRST + 50)
  2092. #define ListView_GetSelectedCount(hwndLV) \
  2093. (UINT)SNDMSG((hwndLV), LVM_GETSELECTEDCOUNT, 0, 0L)
  2094. #define LVM_GETITEMSPACING (LVM_FIRST + 51)
  2095. #define ListView_GetItemSpacing(hwndLV, fSmall) \
  2096. (DWORD)SNDMSG((hwndLV), LVM_GETITEMSPACING, fSmall, 0L)
  2097. #define LVM_GETISEARCHSTRINGA (LVM_FIRST + 52)
  2098. #define LVM_GETISEARCHSTRINGW (LVM_FIRST + 117)
  2099. #ifdef UNICODE
  2100. #define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGW
  2101. #else
  2102. #define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGA
  2103. #endif
  2104. #define ListView_GetISearchString(hwndLV, lpsz) \
  2105. (BOOL)SNDMSG((hwndLV), LVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
  2106. #define LVM_SETICONSPACING (LVM_FIRST + 53)
  2107. // -1 for cx and cy means we'll use the default (system settings)
  2108. // 0 for cx or cy means use the current setting (allows you to change just one param)
  2109. #define ListView_SetIconSpacing(hwndLV, cx, cy) \
  2110. (DWORD)SNDMSG((hwndLV), LVM_SETICONSPACING, 0, MAKELONG(cx,cy))
  2111. #define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 54)
  2112. #define ListView_SetExtendedListViewStyle(hwndLV, dw)\
  2113. (DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw)
  2114. #define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 55)
  2115. #define ListView_GetExtendedListViewStyle(hwndLV)\
  2116. (DWORD)SNDMSG((hwndLV), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
  2117. #define LVS_EX_GRIDLINES 0x00000001
  2118. #define LVS_EX_SUBITEMIMAGES 0x00000002
  2119. #define LVS_EX_CHECKBOXES 0x00000004
  2120. #define LVS_EX_TRACKSELECT 0x00000008
  2121. #define LVS_EX_HEADERDRAGDROP 0x00000010
  2122. #define LVS_EX_FULLROWSELECT 0x00000020 // applies to report mode only
  2123. #define LVS_EX_ONECLICKACTIVATE 0x00000040
  2124. #define LVS_EX_TWOCLICKACTIVATE 0x00000080
  2125. #define LVM_GETSUBITEMRECT (LVM_FIRST + 56)
  2126. #define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
  2127. (BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
  2128. ((prc) ? ((((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))
  2129. #define LVM_SUBITEMHITTEST (LVM_FIRST + 57)
  2130. #define ListView_SubItemHitTest(hwnd, plvhti) \
  2131. (int)SNDMSG((hwnd), LVM_SUBITEMHITTEST, 0, (LPARAM)(LPLVHITTESTINFO)(plvhti))
  2132. #define LVM_SETCOLUMNORDERARRAY (LVM_FIRST + 58)
  2133. #define ListView_SetColumnOrderArray(hwnd, iCount, pi) \
  2134. (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
  2135. #define LVM_GETCOLUMNORDERARRAY (LVM_FIRST + 59)
  2136. #define ListView_GetColumnOrderArray(hwnd, iCount, pi) \
  2137. (BOOL)SNDMSG((hwnd), LVM_GETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
  2138. #define LVM_SETHOTITEM (LVM_FIRST + 60)
  2139. #define ListView_SetHotItem(hwnd, i) \
  2140. (int)SNDMSG((hwnd), LVM_SETHOTITEM, (WPARAM)i, 0)
  2141. #define LVM_GETHOTITEM (LVM_FIRST + 61)
  2142. #define ListView_GetHotItem(hwnd) \
  2143. (int)SNDMSG((hwnd), LVM_GETHOTITEM, 0, 0)
  2144. #define LVM_SETHOTCURSOR (LVM_FIRST + 62)
  2145. #define ListView_SetHotCursor(hwnd, hcur) \
  2146. (HCURSOR)SNDMSG((hwnd), LVM_SETHOTCURSOR, 0, (LPARAM)hcur)
  2147. #define LVM_GETHOTCURSOR (LVM_FIRST + 63)
  2148. #define ListView_GetHotCursor(hwnd) \
  2149. (HCURSOR)SNDMSG((hwnd), LVM_GETHOTCURSOR, 0, 0)
  2150. #define LVM_APPROXIMATEVIEWRECT (LVM_FIRST + 64)
  2151. #define ListView_ApproximateViewRect(hwnd, iWidth, iHeight, iCount) \
  2152. (DWORD)SNDMSG((hwnd), LVM_APPROXIMATEVIEWRECT, iCount, MAKELPARAM(iWidth, iHeight))
  2153. #define LVM_SETWORKAREA (LVM_FIRST + 65)
  2154. #define ListView_SetWorkArea(hwnd, prc) \
  2155. (BOOL)SNDMSG((hwnd), LVM_SETWORKAREA, 0, (LPARAM)(RECT FAR*)(prc))
  2156. typedef struct tagNMLISTVIEW
  2157. {
  2158. NMHDR hdr;
  2159. int iItem;
  2160. int iSubItem;
  2161. UINT uNewState;
  2162. UINT uOldState;
  2163. UINT uChanged;
  2164. POINT ptAction;
  2165. LPARAM lParam;
  2166. } NMLISTVIEW, FAR *LPNMLISTVIEW;
  2167. #define LPNM_LISTVIEW LPNMLISTVIEW
  2168. #define NM_LISTVIEW NMLISTVIEW
  2169. typedef struct tagNMLVCUSTOMDRAW
  2170. {
  2171. NMCUSTOMDRAW nmcd;
  2172. COLORREF clrText;
  2173. COLORREF clrTextBk;
  2174. } NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
  2175. typedef struct tagNMLVCACHEHINT
  2176. {
  2177. NMHDR hdr;
  2178. int iFrom;
  2179. int iTo;
  2180. } NMLVCACHEHINT, FAR *LPNMLVCACHEHINT;
  2181. #define LPNM_CACHEHINT LPNMLVCACHEHINT
  2182. #define PNM_CACHEHINT LPNMLVCACHEHINT
  2183. #define NM_CACHEHINT NMLVCACHEHINT
  2184. typedef struct tagNMLVFINDITEM
  2185. {
  2186. NMHDR hdr;
  2187. int iStart;
  2188. LVFINDINFO lvfi;
  2189. } NMLVFINDITEM, FAR *LPNMLVFINDITEM;
  2190. #define PNM_FINDITEM LPNMLVFINDITEM
  2191. #define LPNM_FINDITEM LPNMLVFINDITEM
  2192. #define NM_FINDITEM NMLVFINDITEM
  2193. typedef struct tagNMLVODSTATECHANGE
  2194. {
  2195. NMHDR hdr;
  2196. int iFrom;
  2197. int iTo;
  2198. UINT uNewState;
  2199. UINT uOldState;
  2200. } NMLVODSTATECHANGE, FAR *LPNMLVODSTATECHANGE;
  2201. #define PNM_ODSTATECHANGE LPNMLVODSTATECHANGE
  2202. #define LPNM_ODSTATECHANGE LPNMLVODSTATECHANGE
  2203. #define NM_ODSTATECHANGE NMLVODSTATECHANGE
  2204. #define LVN_ITEMCHANGING (LVN_FIRST-0)
  2205. #define LVN_ITEMCHANGED (LVN_FIRST-1)
  2206. #define LVN_INSERTITEM (LVN_FIRST-2)
  2207. #define LVN_DELETEITEM (LVN_FIRST-3)
  2208. #define LVN_DELETEALLITEMS (LVN_FIRST-4)
  2209. #define LVN_BEGINLABELEDITA (LVN_FIRST-5)
  2210. #define LVN_BEGINLABELEDITW (LVN_FIRST-75)
  2211. #define LVN_ENDLABELEDITA (LVN_FIRST-6)
  2212. #define LVN_ENDLABELEDITW (LVN_FIRST-76)
  2213. #define LVN_COLUMNCLICK (LVN_FIRST-8)
  2214. #define LVN_BEGINDRAG (LVN_FIRST-9)
  2215. #define LVN_ENDDRAG (LVN_FIRST-10) ;Internal
  2216. #define LVN_BEGINRDRAG (LVN_FIRST-11)
  2217. #define LVN_ENDRDRAG (LVN_FIRST-12) ;Internal
  2218. #define LVN_ODCACHEHINT (LVN_FIRST-13)
  2219. #define LVN_ODFINDITEMA (LVN_FIRST-52)
  2220. #define LVN_ODFINDITEMW (LVN_FIRST-79)
  2221. #define LVN_ITEMACTIVATE (LVN_FIRST-14)
  2222. #define LVN_ODSTATECHANGED (LVN_FIRST-15)
  2223. #ifdef UNICODE
  2224. #define LVN_ODFINDITEM LVN_ODFINDITEMW
  2225. #else
  2226. #define LVN_ODFINDITEM LVN_ODFINDITEMA
  2227. #endif
  2228. #ifdef PW2 ;Internal
  2229. #define LVN_PEN (LVN_FIRST-20) ;Internal
  2230. #endif ;Internal
  2231. #define LVN_GETDISPINFOA (LVN_FIRST-50)
  2232. #define LVN_GETDISPINFOW (LVN_FIRST-77)
  2233. #define LVN_SETDISPINFOA (LVN_FIRST-51)
  2234. #define LVN_SETDISPINFOW (LVN_FIRST-78)
  2235. #ifdef UNICODE
  2236. #define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW
  2237. #define LVN_ENDLABELEDIT LVN_ENDLABELEDITW
  2238. #define LVN_GETDISPINFO LVN_GETDISPINFOW
  2239. #define LVN_SETDISPINFO LVN_SETDISPINFOW
  2240. #else
  2241. #define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITA
  2242. #define LVN_ENDLABELEDIT LVN_ENDLABELEDITA
  2243. #define LVN_GETDISPINFO LVN_GETDISPINFOA
  2244. #define LVN_SETDISPINFO LVN_SETDISPINFOA
  2245. #endif
  2246. #define LVIF_DI_SETITEM 0x1000
  2247. typedef struct tagLVDISPINFO {
  2248. NMHDR hdr;
  2249. LVITEMA item;
  2250. } NMLVDISPINFOA, FAR *LPNMLVDISPINFOA;
  2251. typedef struct tagLVDISPINFOW {
  2252. NMHDR hdr;
  2253. LVITEMW item;
  2254. } NMLVDISPINFOW, FAR * LPNMLVDISPINFOW;
  2255. #define LV_DISPINFOA NMLVDISPINFOA
  2256. #define LV_DISPINFOW NMLVDISPINFOW
  2257. #define LV_DISPINFO NMLVDISPINFO
  2258. #ifdef UNICODE
  2259. #define NMLVDISPINFO NMLVDISPINFOW
  2260. #else
  2261. #define NMLVDISPINFO NMLVDISPINFOA
  2262. #endif
  2263. #define LVN_KEYDOWN (LVN_FIRST-55)
  2264. typedef struct tagLVKEYDOWN
  2265. {
  2266. NMHDR hdr;
  2267. WORD wVKey;
  2268. UINT flags;
  2269. } NMLVKEYDOWN, FAR *LPNMLVKEYDOWN;
  2270. #define LV_KEYDOWN NMLVKEYDOWN
  2271. #define LVN_MARQUEEBEGIN (LVN_FIRST-56)
  2272. #endif
  2273. //====== TREEVIEW CONTROL =====================================================
  2274. #ifndef NOTREEVIEW
  2275. #ifdef _WIN32
  2276. #define WC_TREEVIEWA "SysTreeView32"
  2277. #define WC_TREEVIEWW L"SysTreeView32"
  2278. #ifdef UNICODE
  2279. #define WC_TREEVIEW WC_TREEVIEWW
  2280. #else
  2281. #define WC_TREEVIEW WC_TREEVIEWA
  2282. #endif
  2283. #else
  2284. #define WC_TREEVIEW "SysTreeView"
  2285. #endif
  2286. #define TVS_HASBUTTONS 0x0001
  2287. #define TVS_HASLINES 0x0002
  2288. #define TVS_LINESATROOT 0x0004
  2289. #define TVS_EDITLABELS 0x0008
  2290. #define TVS_DISABLEDRAGDROP 0x0010
  2291. #define TVS_SHOWSELALWAYS 0x0020
  2292. #define TVS_RTLREADING 0x0040
  2293. #define TVS_NOTOOLTIPS 0x0080
  2294. #define TVS_CHECKBOXES 0x0100
  2295. #define TVS_TRACKSELECT 0x0200
  2296. #define TVS_SHAREDIMAGELISTS 0x0000
  2297. #define TVS_PRIVATEIMAGELISTS 0x0400
  2298. typedef struct _TREEITEM FAR* HTREEITEM;
  2299. #define TVIF_TEXT 0x0001
  2300. #define TVIF_IMAGE 0x0002
  2301. #define TVIF_PARAM 0x0004
  2302. #define TVIF_STATE 0x0008
  2303. #define TVIF_HANDLE 0x0010
  2304. #define TVIF_SELECTEDIMAGE 0x0020
  2305. #define TVIF_CHILDREN 0x0040
  2306. #define TVIF_ALL 0x007F ;Internal
  2307. #define TVIF_RESERVED 0xf000 // all bits in high nibble is for notify specific stuff ;Internal
  2308. #define TVIS_FOCUSED 0x0001 // Never implemented ;Internal
  2309. #define TVIS_SELECTED 0x0002
  2310. #define TVIS_CUT 0x0004
  2311. #define TVIS_DROPHILITED 0x0008
  2312. #define TVIS_BOLD 0x0010
  2313. #define TVIS_EXPANDED 0x0020
  2314. #define TVIS_EXPANDEDONCE 0x0040
  2315. #define TVIS_EXPANDPARTIAL 0x0080
  2316. #define TVIS_DISABLED 0 // GOING AWAY ;Internal
  2317. #define TVIS_OVERLAYMASK 0x0F00
  2318. #define TVIS_STATEIMAGEMASK 0xF000
  2319. #define TVIS_USERMASK 0xF000
  2320. #define TVIS_ALL 0xFF7E ;Internal
  2321. #define I_CHILDRENCALLBACK (-1)
  2322. typedef struct tagTVITEMA {
  2323. UINT mask;
  2324. HTREEITEM hItem;
  2325. UINT state;
  2326. UINT stateMask;
  2327. LPSTR pszText;
  2328. int cchTextMax;
  2329. int iImage;
  2330. int iSelectedImage;
  2331. int cChildren;
  2332. LPARAM lParam;
  2333. // all items above this line were for win95. don't touch them. ;Internal
  2334. } TVITEMA, FAR *LPTVITEMA;
  2335. typedef struct tagTVITEMW {
  2336. UINT mask;
  2337. HTREEITEM hItem;
  2338. UINT state;
  2339. UINT stateMask;
  2340. LPWSTR pszText;
  2341. int cchTextMax;
  2342. int iImage;
  2343. int iSelectedImage;
  2344. int cChildren;
  2345. LPARAM lParam;
  2346. // all items above this line were for win95. don't touch them. ;Internal
  2347. } TVITEMW, FAR *LPTVITEMW;
  2348. #define LPTV_ITEMW LPTVITEMW
  2349. #define LPTV_ITEMA LPTVITEMA
  2350. #define LPTV_ITEM LPTVITEM
  2351. #define TV_ITEMW TVITEMW
  2352. #define TV_ITEMA TVITEMA
  2353. #define TV_ITEM TVITEM
  2354. #ifdef UNICODE
  2355. #define TVITEM TVITEMW
  2356. #define LPTVITEM LPTVITEMW
  2357. #else
  2358. #define TVITEM TVITEMA
  2359. #define LPTVITEM LPTVITEMA
  2360. #endif
  2361. #define TVI_ROOT ((HTREEITEM)0xFFFF0000)
  2362. #define TVI_FIRST ((HTREEITEM)0xFFFF0001)
  2363. #define TVI_LAST ((HTREEITEM)0xFFFF0002)
  2364. #define TVI_SORT ((HTREEITEM)0xFFFF0003)
  2365. typedef struct tagTVINSERTSTRUCTA {
  2366. HTREEITEM hParent;
  2367. HTREEITEM hInsertAfter;
  2368. TV_ITEMA item;
  2369. } TVINSERTSTRUCTA, FAR *LPTVINSERTSTRUCTA;
  2370. typedef struct tagTVINSERTSTRUCTW {
  2371. HTREEITEM hParent;
  2372. HTREEITEM hInsertAfter;
  2373. TV_ITEMW item;
  2374. } TVINSERTSTRUCTW, FAR *LPTVINSERTSTRUCTW;
  2375. #define LPTV_INSERTSTRUCTA LPTVINSERTSTRUCTA
  2376. #define LPTV_INSERTSTRUCTW LPTVINSERTSTRUCTW
  2377. #define LPTV_INSERTSTRUCT LPTVINSERTSTRUCT
  2378. #define TV_INSERTSTRUCTA TVINSERTSTRUCTA
  2379. #define TV_INSERTSTRUCTW TVINSERTSTRUCTW
  2380. #define TV_INSERTSTRUCT TVINSERTSTRUCT
  2381. #ifdef UNICODE
  2382. #define TVINSERTSTRUCT TVINSERTSTRUCTW
  2383. #define LPTVINSERTSTRUCT LPTVINSERTSTRUCTW
  2384. #else
  2385. #define TVINSERTSTRUCT TVINSERTSTRUCTA
  2386. #define LPTVINSERTSTRUCT LPTVINSERTSTRUCTA
  2387. #endif
  2388. #define TVM_INSERTITEMA (TV_FIRST + 0)
  2389. #define TVM_INSERTITEMW (TV_FIRST + 50)
  2390. #ifdef UNICODE
  2391. #define TVM_INSERTITEM TVM_INSERTITEMW
  2392. #else
  2393. #define TVM_INSERTITEM TVM_INSERTITEMA
  2394. #endif
  2395. #define TreeView_InsertItem(hwnd, lpis) \
  2396. (HTREEITEM)SNDMSG((hwnd), TVM_INSERTITEM, 0, (LPARAM)(LPTV_INSERTSTRUCT)(lpis))
  2397. #define TVM_DELETEITEM (TV_FIRST + 1)
  2398. #define TreeView_DeleteItem(hwnd, hitem) \
  2399. (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hitem))
  2400. #define TreeView_DeleteAllItems(hwnd) \
  2401. (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT)
  2402. #define TVM_EXPAND (TV_FIRST + 2)
  2403. #define TreeView_Expand(hwnd, hitem, code) \
  2404. (BOOL)SNDMSG((hwnd), TVM_EXPAND, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2405. #define TVE_COLLAPSE 0x0001
  2406. #define TVE_EXPAND 0x0002
  2407. #define TVE_TOGGLE 0x0003
  2408. #define TVE_ACTIONMASK 0x0003 // (TVE_COLLAPSE | TVE_EXPAND | TVE_TOGGLE) ;Internal
  2409. #define TVE_EXPANDPARTIAL 0x4000
  2410. #define TVE_COLLAPSERESET 0x8000
  2411. #define TV_FINDITEM (TV_FIRST + 3) // BUGBUG: Not implemented ;Internal
  2412. #define TVM_GETITEMRECT (TV_FIRST + 4)
  2413. #define TreeView_GetItemRect(hwnd, hitem, prc, code) \
  2414. (*(HTREEITEM FAR *)prc = (hitem), (BOOL)SNDMSG((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT FAR*)(prc)))
  2415. #define TVM_GETCOUNT (TV_FIRST + 5)
  2416. #define TreeView_GetCount(hwnd) \
  2417. (UINT)SNDMSG((hwnd), TVM_GETCOUNT, 0, 0)
  2418. #define TVM_GETINDENT (TV_FIRST + 6)
  2419. #define TreeView_GetIndent(hwnd) \
  2420. (UINT)SNDMSG((hwnd), TVM_GETINDENT, 0, 0)
  2421. #define TVM_SETINDENT (TV_FIRST + 7)
  2422. #define TreeView_SetIndent(hwnd, indent) \
  2423. (BOOL)SNDMSG((hwnd), TVM_SETINDENT, (WPARAM)indent, 0)
  2424. #define TVM_GETIMAGELIST (TV_FIRST + 8)
  2425. #define TreeView_GetImageList(hwnd, iImage) \
  2426. (HIMAGELIST)SNDMSG((hwnd), TVM_GETIMAGELIST, iImage, 0)
  2427. #define TVSIL_NORMAL 0
  2428. #define TVSIL_STATE 2
  2429. #define TVM_SETIMAGELIST (TV_FIRST + 9)
  2430. #define TreeView_SetImageList(hwnd, himl, iImage) \
  2431. (HIMAGELIST)SNDMSG((hwnd), TVM_SETIMAGELIST, iImage, (LPARAM)(UINT)(HIMAGELIST)(himl))
  2432. #define TVM_GETNEXTITEM (TV_FIRST + 10)
  2433. #define TreeView_GetNextItem(hwnd, hitem, code) \
  2434. (HTREEITEM)SNDMSG((hwnd), TVM_GETNEXTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2435. #define TVGN_ROOT 0x0000
  2436. #define TVGN_NEXT 0x0001
  2437. #define TVGN_PREVIOUS 0x0002
  2438. #define TVGN_PARENT 0x0003
  2439. #define TVGN_CHILD 0x0004
  2440. #define TVGN_FIRSTVISIBLE 0x0005
  2441. #define TVGN_NEXTVISIBLE 0x0006
  2442. #define TVGN_PREVIOUSVISIBLE 0x0007
  2443. #define TVGN_DROPHILITE 0x0008
  2444. #define TVGN_CARET 0x0009
  2445. #define TreeView_GetChild(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD)
  2446. #define TreeView_GetNextSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT)
  2447. #define TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS)
  2448. #define TreeView_GetParent(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT)
  2449. #define TreeView_GetFirstVisible(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_FIRSTVISIBLE)
  2450. #define TreeView_GetNextVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE)
  2451. #define TreeView_GetPrevVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE)
  2452. #define TreeView_GetSelection(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_CARET)
  2453. #define TreeView_GetDropHilight(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_DROPHILITE)
  2454. #define TreeView_GetRoot(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_ROOT)
  2455. #define TVM_SELECTITEM (TV_FIRST + 11)
  2456. #define TreeView_Select(hwnd, hitem, code) \
  2457. (HTREEITEM)SNDMSG((hwnd), TVM_SELECTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2458. #define TreeView_SelectItem(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_CARET)
  2459. #define TreeView_SelectDropTarget(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
  2460. #define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
  2461. #define TVM_GETITEMA (TV_FIRST + 12)
  2462. #define TVM_GETITEMW (TV_FIRST + 62)
  2463. #ifdef UNICODE
  2464. #define TVM_GETITEM TVM_GETITEMW
  2465. #else
  2466. #define TVM_GETITEM TVM_GETITEMA
  2467. #endif
  2468. #define TreeView_GetItem(hwnd, pitem) \
  2469. (BOOL)SNDMSG((hwnd), TVM_GETITEM, 0, (LPARAM)(TV_ITEM FAR*)(pitem))
  2470. #define TVM_SETITEMA (TV_FIRST + 13)
  2471. #define TVM_SETITEMW (TV_FIRST + 63)
  2472. #ifdef UNICODE
  2473. #define TVM_SETITEM TVM_SETITEMW
  2474. #else
  2475. #define TVM_SETITEM TVM_SETITEMA
  2476. #endif
  2477. #define TreeView_SetItem(hwnd, pitem) \
  2478. (BOOL)SNDMSG((hwnd), TVM_SETITEM, 0, (LPARAM)(const TV_ITEM FAR*)(pitem))
  2479. #define TVM_EDITLABELA (TV_FIRST + 14)
  2480. #define TVM_EDITLABELW (TV_FIRST + 65)
  2481. #ifdef UNICODE
  2482. #define TVM_EDITLABEL TVM_EDITLABELW
  2483. #else
  2484. #define TVM_EDITLABEL TVM_EDITLABELA
  2485. #endif
  2486. #define TreeView_EditLabel(hwnd, hitem) \
  2487. (HWND)SNDMSG((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
  2488. #define TVM_GETEDITCONTROL (TV_FIRST + 15)
  2489. #define TreeView_GetEditControl(hwnd) \
  2490. (HWND)SNDMSG((hwnd), TVM_GETEDITCONTROL, 0, 0)
  2491. #define TVM_GETVISIBLECOUNT (TV_FIRST + 16)
  2492. #define TreeView_GetVisibleCount(hwnd) \
  2493. (UINT)SNDMSG((hwnd), TVM_GETVISIBLECOUNT, 0, 0)
  2494. #define TVM_HITTEST (TV_FIRST + 17)
  2495. #define TreeView_HitTest(hwnd, lpht) \
  2496. (HTREEITEM)SNDMSG((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht))
  2497. typedef struct tagTVHITTESTINFO {
  2498. POINT pt;
  2499. UINT flags;
  2500. HTREEITEM hItem;
  2501. } TVHITTESTINFO, FAR *LPTVHITTESTINFO;
  2502. #define LPTV_HITTESTINFO LPTVHITTESTINFO
  2503. #define TV_HITTESTINFO TVHITTESTINFO
  2504. #define TVHT_NOWHERE 0x0001
  2505. #define TVHT_ONITEMICON 0x0002
  2506. #define TVHT_ONITEMLABEL 0x0004
  2507. #define TVHT_ONITEM (TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON)
  2508. #define TVHT_ONITEMINDENT 0x0008
  2509. #define TVHT_ONITEMBUTTON 0x0010
  2510. #define TVHT_ONITEMRIGHT 0x0020
  2511. #define TVHT_ONITEMSTATEICON 0x0040
  2512. #define TVHT_ABOVE 0x0100
  2513. #define TVHT_BELOW 0x0200
  2514. #define TVHT_TORIGHT 0x0400
  2515. #define TVHT_TOLEFT 0x0800
  2516. #define TVM_CREATEDRAGIMAGE (TV_FIRST + 18)
  2517. #define TreeView_CreateDragImage(hwnd, hitem) \
  2518. (HIMAGELIST)SNDMSG((hwnd), TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(hitem))
  2519. #define TVM_SORTCHILDREN (TV_FIRST + 19)
  2520. #define TreeView_SortChildren(hwnd, hitem, recurse) \
  2521. (BOOL)SNDMSG((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse, (LPARAM)(HTREEITEM)(hitem))
  2522. #define TVM_ENSUREVISIBLE (TV_FIRST + 20)
  2523. #define TreeView_EnsureVisible(hwnd, hitem) \
  2524. (BOOL)SNDMSG((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem))
  2525. #define TVM_SORTCHILDRENCB (TV_FIRST + 21)
  2526. #define TreeView_SortChildrenCB(hwnd, psort, recurse) \
  2527. (BOOL)SNDMSG((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \
  2528. (LPARAM)(LPTV_SORTCB)(psort))
  2529. #define TVM_ENDEDITLABELNOW (TV_FIRST + 22)
  2530. #define TreeView_EndEditLabelNow(hwnd, fCancel) \
  2531. (BOOL)SNDMSG((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0)
  2532. #define TVM_GETISEARCHSTRINGA (TV_FIRST + 23)
  2533. #define TVM_GETISEARCHSTRINGW (TV_FIRST + 64)
  2534. #ifdef UNICODE
  2535. #define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW
  2536. #else
  2537. #define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGA
  2538. #endif
  2539. #define TVM_SETTOOLTIPS (TV_FIRST + 24)
  2540. #define TVM_GETTOOLTIPS (TV_FIRST + 25)
  2541. #define TreeView_GetISearchString(hwndTV, lpsz) \
  2542. (BOOL)SNDMSG((hwndTV), TVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
  2543. typedef int (CALLBACK *PFNTVCOMPARE)(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  2544. typedef struct tagTVSORTCB
  2545. {
  2546. HTREEITEM hParent;
  2547. PFNTVCOMPARE lpfnCompare;
  2548. LPARAM lParam;
  2549. } TVSORTCB, FAR *LPTVSORTCB;
  2550. #define LPTV_SORTCB LPTVSORTCB
  2551. #define TV_SORTCB TVSORTCB
  2552. typedef struct tagNMTREEVIEWA {
  2553. NMHDR hdr;
  2554. UINT action;
  2555. TVITEMA itemOld;
  2556. TVITEMA itemNew;
  2557. POINT ptDrag;
  2558. } NMTREEVIEWA, FAR *LPNMTREEVIEWA;
  2559. typedef struct tagNMTREEVIEWW {
  2560. NMHDR hdr;
  2561. UINT action;
  2562. TVITEMW itemOld;
  2563. TVITEMW itemNew;
  2564. POINT ptDrag;
  2565. } NMTREEVIEWW, FAR *LPNMTREEVIEWW;
  2566. #define LPNM_TREEVIEWA LPNMTREEVIEWA
  2567. #define LPNM_TREEVIEWW LPNMTREEVIEWW
  2568. #define LPNM_TREEVIEW LPNMTREEVIEW
  2569. #define NM_TREEVIEWW NMTREEVIEWW
  2570. #define NM_TREEVIEWA NMTREEVIEWA
  2571. #define NM_TREEVIEW NMTREEVIEW
  2572. #ifdef UNICODE
  2573. #define NMTREEVIEW NMTREEVIEWW
  2574. #define LPNMTREEVIEW LPNMTREEVIEWW
  2575. #else
  2576. #define NMTREEVIEW NMTREEVIEWA
  2577. #define LPNMTREEVIEW LPNMTREEVIEWA
  2578. #endif
  2579. #define TVN_SELCHANGINGA (TVN_FIRST-1)
  2580. #define TVN_SELCHANGINGW (TVN_FIRST-50)
  2581. #define TVN_SELCHANGEDA (TVN_FIRST-2)
  2582. #define TVN_SELCHANGEDW (TVN_FIRST-51)
  2583. #define TVC_UNKNOWN 0x0000
  2584. #define TVC_BYMOUSE 0x0001
  2585. #define TVC_BYKEYBOARD 0x0002
  2586. #define TVN_GETDISPINFOA (TVN_FIRST-3)
  2587. #define TVN_GETDISPINFOW (TVN_FIRST-52)
  2588. #define TVN_SETDISPINFOA (TVN_FIRST-4)
  2589. #define TVN_SETDISPINFOW (TVN_FIRST-53)
  2590. #define TVIF_DI_SETITEM 0x1000
  2591. typedef struct tagTVDISPINFOA {
  2592. NMHDR hdr;
  2593. TVITEMA item;
  2594. } NMTVDISPINFOA, FAR *LPNMTVDISPINFOA;
  2595. typedef struct tagTVDISPINFOW {
  2596. NMHDR hdr;
  2597. TVITEMW item;
  2598. } NMTVDISPINFOW, FAR *LPNMTVDISPINFOW;
  2599. #define TV_DISPINFOA NMTVDISPINFOA
  2600. #define TV_DISPINFOW NMTVDISPINFOW
  2601. #define TV_DISPINFO NMTVDISPINFO
  2602. #ifdef UNICODE
  2603. #define NMTVDISPINFO NMTVDISPINFOW
  2604. #define LPNMTVDISPINFO LPNMTVDISPINFOW
  2605. #else
  2606. #define NMTVDISPINFO NMTVDISPINFOA
  2607. #define LPNMTVDISPINFO LPNMTVDISPINFOA
  2608. #endif
  2609. #define TVN_ITEMEXPANDINGA (TVN_FIRST-5)
  2610. #define TVN_ITEMEXPANDINGW (TVN_FIRST-54)
  2611. #define TVN_ITEMEXPANDEDA (TVN_FIRST-6)
  2612. #define TVN_ITEMEXPANDEDW (TVN_FIRST-55)
  2613. #define TVN_BEGINDRAGA (TVN_FIRST-7)
  2614. #define TVN_BEGINDRAGW (TVN_FIRST-56)
  2615. #define TVN_BEGINRDRAGA (TVN_FIRST-8)
  2616. #define TVN_BEGINRDRAGW (TVN_FIRST-57)
  2617. #define TVN_DELETEITEMA (TVN_FIRST-9)
  2618. #define TVN_DELETEITEMW (TVN_FIRST-58)
  2619. #define TVN_BEGINLABELEDITA (TVN_FIRST-10)
  2620. #define TVN_BEGINLABELEDITW (TVN_FIRST-59)
  2621. #define TVN_ENDLABELEDITA (TVN_FIRST-11)
  2622. #define TVN_ENDLABELEDITW (TVN_FIRST-60)
  2623. #define TVN_KEYDOWN (TVN_FIRST-12)
  2624. typedef struct tagTVKEYDOWN {
  2625. NMHDR hdr;
  2626. WORD wVKey;
  2627. UINT flags;
  2628. } NMTVKEYDOWN, FAR *LPNMTVKEYDOWN;
  2629. #define TV_KEYDOWN NMTVKEYDOWN
  2630. #ifdef UNICODE
  2631. #define TVN_SELCHANGING TVN_SELCHANGINGW
  2632. #define TVN_SELCHANGED TVN_SELCHANGEDW
  2633. #define TVN_GETDISPINFO TVN_GETDISPINFOW
  2634. #define TVN_SETDISPINFO TVN_SETDISPINFOW
  2635. #define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGW
  2636. #define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDW
  2637. #define TVN_BEGINDRAG TVN_BEGINDRAGW
  2638. #define TVN_BEGINRDRAG TVN_BEGINRDRAGW
  2639. #define TVN_DELETEITEM TVN_DELETEITEMW
  2640. #define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW
  2641. #define TVN_ENDLABELEDIT TVN_ENDLABELEDITW
  2642. #else
  2643. #define TVN_SELCHANGING TVN_SELCHANGINGA
  2644. #define TVN_SELCHANGED TVN_SELCHANGEDA
  2645. #define TVN_GETDISPINFO TVN_GETDISPINFOA
  2646. #define TVN_SETDISPINFO TVN_SETDISPINFOA
  2647. #define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGA
  2648. #define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDA
  2649. #define TVN_BEGINDRAG TVN_BEGINDRAGA
  2650. #define TVN_BEGINRDRAG TVN_BEGINRDRAGA
  2651. #define TVN_DELETEITEM TVN_DELETEITEMA
  2652. #define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITA
  2653. #define TVN_ENDLABELEDIT TVN_ENDLABELEDITA
  2654. #endif
  2655. typedef struct tagNMTVCUSTOMDRAW
  2656. {
  2657. NMCUSTOMDRAW nmcd;
  2658. COLORREF clrText;
  2659. COLORREF clrTextBk;
  2660. } NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
  2661. #endif
  2662. #ifndef NOUSEREXCONTROLS
  2663. //////////////////// ComboBoxEx ////////////////////////////////
  2664. #define WC_COMBOBOXEXW L"ComboBoxEx32"
  2665. #define WC_COMBOBOXEXA "ComboBoxEx32"
  2666. #ifdef UNICODE
  2667. #define WC_COMBOBOXEX WC_COMBOBOXEXW
  2668. #else
  2669. #define WC_COMBOBOXEX WC_COMBOBOXEXA
  2670. #endif
  2671. #define CBEIF_TEXT 0x00000001
  2672. #define CBEIF_IMAGE 0x00000002
  2673. #define CBEIF_SELECTEDIMAGE 0x00000004
  2674. #define CBEIF_OVERLAY 0x00000008
  2675. #define CBEIF_INDENT 0x00000010
  2676. #define CBEIF_LPARAM 0x00000020
  2677. #define CBEIF_DI_SETITEM 0x10000000
  2678. typedef struct tagCOMBOBOXEXITEMA
  2679. {
  2680. UINT mask;
  2681. int iItem;
  2682. LPSTR pszText;
  2683. int cchTextMax;
  2684. int iImage;
  2685. int iSelectedImage;
  2686. int iOverlay;
  2687. int iIndent;
  2688. LPARAM lParam;
  2689. } COMBOBOXEXITEMA, *PCOMBOBOXEXITEMA;
  2690. typedef COMBOBOXEXITEMA CONST *PCCOMBOEXITEMA;
  2691. typedef struct tagCOMBOBOXEXITEMW
  2692. {
  2693. UINT mask;
  2694. int iItem;
  2695. LPWSTR pszText;
  2696. int cchTextMax;
  2697. int iImage;
  2698. int iSelectedImage;
  2699. int iOverlay;
  2700. int iIndent;
  2701. LPARAM lParam;
  2702. } COMBOBOXEXITEMW, *PCOMBOBOXEXITEMW;
  2703. typedef COMBOBOXEXITEMW CONST *PCCOMBOEXITEMW;
  2704. #ifdef UNICODE
  2705. #define COMBOBOXEXITEM COMBOBOXEXITEMW
  2706. #define PCOMBOBOXEXITEM PCOMBOBOXEXITEMW
  2707. #define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMW
  2708. #else
  2709. #define COMBOBOXEXITEM COMBOBOXEXITEMA
  2710. #define PCOMBOBOXEXITEM PCOMBOBOXEXITEMA
  2711. #define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMA
  2712. #endif
  2713. #define CBEM_INSERTITEMA (WM_USER + 1)
  2714. #define CBEM_SETIMAGELIST (WM_USER + 2)
  2715. #define CBEM_GETIMAGELIST (WM_USER + 3)
  2716. #define CBEM_GETITEMA (WM_USER + 4)
  2717. #define CBEM_SETITEMA (WM_USER + 5)
  2718. #define CBEM_DELETEITEM CB_DELETESTRING
  2719. #define CBEM_GETCOMBOCONTROL (WM_USER + 6)
  2720. #define CBEM_GETEDITCONTROL (WM_USER + 7)
  2721. #define CBEM_SETEXSTYLE (WM_USER + 8)
  2722. #define CBEM_GETEXSTYLE (WM_USER + 9)
  2723. #define CBEM_HASEDITCHANGED (WM_USER + 10)
  2724. #define CBEM_INSERTITEMW (WM_USER + 11)
  2725. #define CBEM_SETITEMW (WM_USER + 12)
  2726. #define CBEM_GETITEMW (WM_USER + 13)
  2727. #ifdef UNICODE
  2728. #define CBEM_INSERTITEM CBEM_INSERTITEMW
  2729. #define CBEM_SETITEM CBEM_SETITEMW
  2730. #define CBEM_GETITEM CBEM_GETITEMW
  2731. #else
  2732. #define CBEM_INSERTITEM CBEM_INSERTITEMA
  2733. #define CBEM_SETITEM CBEM_SETITEMA
  2734. #define CBEM_GETITEM CBEM_GETITEMA
  2735. #endif
  2736. #define CBES_EX_NOEDITIMAGE 0x00000001
  2737. #define CBES_EX_NOEDITIMAGEINDENT 0x00000002
  2738. #define CBES_EX_PATHWORDBREAKPROC 0x00000004
  2739. typedef struct {
  2740. NMHDR hdr;
  2741. COMBOBOXEXITEM ceItem;
  2742. } NMCOMBOBOXEX, *PNMCOMBOBOXEX;
  2743. #define CBEN_GETDISPINFO (CBEN_FIRST - 0)
  2744. #define CBEN_INSERTITEM (CBEN_FIRST - 1)
  2745. #define CBEN_DELETEITEM (CBEN_FIRST - 2)
  2746. #define CBEN_ITEMCHANGED (CBEN_FIRST - 3) // ;Internal
  2747. #define CBEN_BEGINEDIT (CBEN_FIRST - 4)
  2748. #define CBEN_ENDEDITA (CBEN_FIRST - 5)
  2749. #define CBEN_ENDEDITW (CBEN_FIRST - 6)
  2750. // lParam specifies why the endedit is happening
  2751. #ifdef UNICODE
  2752. #define CBEN_ENDEDIT CBEN_ENDEDITW
  2753. #else
  2754. #define CBEN_ENDEDIT CBEN_ENDEDITA
  2755. #endif
  2756. #define CBENF_KILLFOCUS 1
  2757. #define CBENF_RETURN 2
  2758. #define CBENF_ESCAPE 3
  2759. #define CBENF_DROPDOWN 4
  2760. #define CBEMAXSTRLEN 260
  2761. // CBEN_ENDEDIT sends this information...
  2762. // fChanged if the user actually did anything
  2763. // iNewSelection gives what would be the new selection unless the notify is failed
  2764. // iNewSelection may be CB_ERR if there's no match
  2765. typedef struct {
  2766. NMHDR hdr;
  2767. BOOL fChanged;
  2768. int iNewSelection;
  2769. WCHAR szText[CBEMAXSTRLEN];
  2770. int iWhy;
  2771. } NMCBEENDEDITW, *PNMCBEENDEDITW;
  2772. typedef struct {
  2773. NMHDR hdr;
  2774. BOOL fChanged;
  2775. int iNewSelection;
  2776. char szText[CBEMAXSTRLEN];
  2777. int iWhy;
  2778. } NMCBEENDEDITA, *PNMCBEENDEDITA;
  2779. #ifdef UNICODE
  2780. #define NMCBEENDEDIT NMCBEENDEDITW
  2781. #define PNMCBEENDEDIT PNMCBEENDEDITW
  2782. #else
  2783. #define NMCBEENDEDIT NMCBEENDEDITA
  2784. #define PNMCBEENDEDIT PNMCBEENDEDITA
  2785. #endif
  2786. #endif
  2787. //====== TAB CONTROL ==========================================================
  2788. #ifndef NOTABCONTROL
  2789. #ifdef _WIN32
  2790. #define WC_TABCONTROLA "SysTabControl32"
  2791. #define WC_TABCONTROLW L"SysTabControl32"
  2792. #ifdef UNICODE
  2793. #define WC_TABCONTROL WC_TABCONTROLW
  2794. #else
  2795. #define WC_TABCONTROL WC_TABCONTROLA
  2796. #endif
  2797. #else
  2798. #define WC_TABCONTROL "SysTabControl"
  2799. #endif
  2800. #define TCS_SCROLLOPPOSITE 0x0001 // assumes multiline tab
  2801. #define TCS_BOTTOM 0x0002
  2802. #define TCS_RIGHT 0x0002
  2803. #define TCS_MULTISELECT 0x0004 // allow multi-select in button mode
  2804. #define TCS_FORCEICONLEFT 0x0010
  2805. #define TCS_FORCELABELLEFT 0x0020
  2806. #define TCS_SHAREIMAGELISTS 0x0000 ;internal
  2807. #define TCS_PRIVATEIMAGELISTS 0x0000 ;internal
  2808. #define TCS_HOTTRACK 0x0040
  2809. #define TCS_VERTICAL 0x0080
  2810. #define TCS_TABS 0x0000
  2811. #define TCS_BUTTONS 0x0100
  2812. #define TCS_SINGLELINE 0x0000
  2813. #define TCS_MULTILINE 0x0200
  2814. #define TCS_RIGHTJUSTIFY 0x0000
  2815. #define TCS_FIXEDWIDTH 0x0400
  2816. #define TCS_RAGGEDRIGHT 0x0800
  2817. #define TCS_FOCUSONBUTTONDOWN 0x1000
  2818. #define TCS_OWNERDRAWFIXED 0x2000
  2819. #define TCS_TOOLTIPS 0x4000
  2820. #define TCS_FOCUSNEVER 0x8000
  2821. #define TCM_FIRST 0x1300
  2822. #define TCM_GETBKCOLOR (TCM_FIRST + 0) ;Internal
  2823. #define TabCtrl_GetBkColor(hwnd) (COLORREF)SNDMSG((hwnd), TCM_GETBKCOLOR, 0, 0L) ;Internal
  2824. #define TCM_SETBKCOLOR (TCM_FIRST + 1) ;Internal
  2825. #define TabCtrl_SetBkColor(hwnd, clrBk) (BOOL)SNDMSG((hwnd), TCM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk)) ;Internal
  2826. #define TCM_GETIMAGELIST (TCM_FIRST + 2)
  2827. #define TabCtrl_GetImageList(hwnd) \
  2828. (HIMAGELIST)SNDMSG((hwnd), TCM_GETIMAGELIST, 0, 0L)
  2829. #define TCM_SETIMAGELIST (TCM_FIRST + 3)
  2830. #define TabCtrl_SetImageList(hwnd, himl) \
  2831. (HIMAGELIST)SNDMSG((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl))
  2832. #define TCM_GETITEMCOUNT (TCM_FIRST + 4)
  2833. #define TabCtrl_GetItemCount(hwnd) \
  2834. (int)SNDMSG((hwnd), TCM_GETITEMCOUNT, 0, 0L)
  2835. #define TCIF_TEXT 0x0001
  2836. #define TCIF_IMAGE 0x0002
  2837. #define TCIF_RTLREADING 0x0004
  2838. #define TCIF_PARAM 0x0008
  2839. #define TCIF_STATE 0x0010
  2840. #define TCIF_ALL 0x001f ;Internal
  2841. #define TCIS_BUTTONPRESSED 0x0001
  2842. typedef struct tagTCITEMHEADERA
  2843. {
  2844. UINT mask;
  2845. UINT lpReserved1;
  2846. UINT lpReserved2;
  2847. LPSTR pszText;
  2848. int cchTextMax;
  2849. int iImage;
  2850. } TCITEMHEADERA, FAR *LPTCITEMHEADERA;
  2851. typedef struct tagTCITEMHEADERW
  2852. {
  2853. UINT mask;
  2854. UINT lpReserved1;
  2855. UINT lpReserved2;
  2856. LPWSTR pszText;
  2857. int cchTextMax;
  2858. int iImage;
  2859. } TCITEMHEADERW, FAR *LPTCITEMHEADERW;
  2860. #define TC_ITEMHEADERA TCITEMHEADERA
  2861. #define TC_ITEMHEADERW TCITEMHEADERW
  2862. #define TC_ITEMHEADER TCITEMHEADER
  2863. #ifdef UNICODE
  2864. #define TCITEMHEADER TCITEMHEADERW
  2865. #define LPTCITEMHEADER LPTCITEMHEADERW
  2866. #else
  2867. #define TCITEMHEADER TCITEMHEADERA
  2868. #define LPTCITEMHEADER LPTCITEMHEADERA
  2869. #endif
  2870. // BUGBUG: we need to pull the state code stuff out ;Internal
  2871. typedef struct tagTCITEMA
  2872. {
  2873. // This block must be identical to TC_TEIMHEADER ;Internal
  2874. UINT mask;
  2875. DWORD dwState;
  2876. DWORD dwStateMask;
  2877. LPSTR pszText;
  2878. int cchTextMax;
  2879. int iImage;
  2880. LPARAM lParam;
  2881. } TCITEMA, FAR *LPTCITEMA;
  2882. typedef struct tagTCITEMW
  2883. {
  2884. // This block must be identical to TC_TEIMHEADER ;Internal
  2885. UINT mask;
  2886. DWORD dwState;
  2887. DWORD dwStateMask;
  2888. LPWSTR pszText;
  2889. int cchTextMax;
  2890. int iImage;
  2891. LPARAM lParam;
  2892. } TCITEMW, FAR *LPTCITEMW;
  2893. #define TC_ITEMA TCITEMA
  2894. #define TC_ITEMW TCITEMW
  2895. #define TC_ITEM TCITEM
  2896. #ifdef UNICODE
  2897. #define TCITEM TCITEMW
  2898. #define LPTCITEM LPTCITEMW
  2899. #else
  2900. #define TCITEM TCITEMA
  2901. #define LPTCITEM LPTCITEMA
  2902. #endif
  2903. #define TCM_GETITEMA (TCM_FIRST + 5)
  2904. #define TCM_GETITEMW (TCM_FIRST + 60)
  2905. #ifdef UNICODE
  2906. #define TCM_GETITEM TCM_GETITEMW
  2907. #else
  2908. #define TCM_GETITEM TCM_GETITEMA
  2909. #endif
  2910. #define TabCtrl_GetItem(hwnd, iItem, pitem) \
  2911. (BOOL)SNDMSG((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
  2912. #define TCM_SETITEMA (TCM_FIRST + 6)
  2913. #define TCM_SETITEMW (TCM_FIRST + 61)
  2914. #ifdef UNICODE
  2915. #define TCM_SETITEM TCM_SETITEMW
  2916. #else
  2917. #define TCM_SETITEM TCM_SETITEMA
  2918. #endif
  2919. #define TabCtrl_SetItem(hwnd, iItem, pitem) \
  2920. (BOOL)SNDMSG((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
  2921. #define TCM_INSERTITEMA (TCM_FIRST + 7)
  2922. #define TCM_INSERTITEMW (TCM_FIRST + 62)
  2923. #ifdef UNICODE
  2924. #define TCM_INSERTITEM TCM_INSERTITEMW
  2925. #else
  2926. #define TCM_INSERTITEM TCM_INSERTITEMA
  2927. #endif
  2928. #define TabCtrl_InsertItem(hwnd, iItem, pitem) \
  2929. (int)SNDMSG((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM FAR*)(pitem))
  2930. #define TCM_DELETEITEM (TCM_FIRST + 8)
  2931. #define TabCtrl_DeleteItem(hwnd, i) \
  2932. (BOOL)SNDMSG((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L)
  2933. #define TCM_DELETEALLITEMS (TCM_FIRST + 9)
  2934. #define TabCtrl_DeleteAllItems(hwnd) \
  2935. (BOOL)SNDMSG((hwnd), TCM_DELETEALLITEMS, 0, 0L)
  2936. #define TCM_GETITEMRECT (TCM_FIRST + 10)
  2937. #define TabCtrl_GetItemRect(hwnd, i, prc) \
  2938. (BOOL)SNDMSG((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT FAR*)(prc))
  2939. #define TCM_GETCURSEL (TCM_FIRST + 11)
  2940. #define TabCtrl_GetCurSel(hwnd) \
  2941. (int)SNDMSG((hwnd), TCM_GETCURSEL, 0, 0)
  2942. #define TCM_SETCURSEL (TCM_FIRST + 12)
  2943. #define TabCtrl_SetCurSel(hwnd, i) \
  2944. (int)SNDMSG((hwnd), TCM_SETCURSEL, (WPARAM)i, 0)
  2945. #define TCHT_NOWHERE 0x0001
  2946. #define TCHT_ONITEMICON 0x0002
  2947. #define TCHT_ONITEMLABEL 0x0004
  2948. #define TCHT_ONITEM (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
  2949. typedef struct tagTCHITTESTINFO
  2950. {
  2951. POINT pt;
  2952. UINT flags;
  2953. } TCHITTESTINFO, FAR * LPTCHITTESTINFO;
  2954. #define LPTC_HITTESTINFO LPTCHITTESTINFO
  2955. #define TC_HITTESTINFO TCHITTESTINFO
  2956. #define TCM_HITTEST (TCM_FIRST + 13)
  2957. #define TabCtrl_HitTest(hwndTC, pinfo) \
  2958. (int)SNDMSG((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO FAR*)(pinfo))
  2959. #define TCM_SETITEMEXTRA (TCM_FIRST + 14)
  2960. #define TabCtrl_SetItemExtra(hwndTC, cb) \
  2961. (BOOL)SNDMSG((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L)
  2962. #define TCM_ADJUSTRECT (TCM_FIRST + 40)
  2963. #define TabCtrl_AdjustRect(hwnd, bLarger, prc) \
  2964. (int)SNDMSG(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT FAR *)prc)
  2965. #define TCM_SETITEMSIZE (TCM_FIRST + 41)
  2966. #define TabCtrl_SetItemSize(hwnd, x, y) \
  2967. (DWORD)SNDMSG((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y))
  2968. #define TCM_REMOVEIMAGE (TCM_FIRST + 42)
  2969. #define TabCtrl_RemoveImage(hwnd, i) \
  2970. (void)SNDMSG((hwnd), TCM_REMOVEIMAGE, i, 0L)
  2971. #define TCM_SETPADDING (TCM_FIRST + 43)
  2972. #define TabCtrl_SetPadding(hwnd, cx, cy) \
  2973. (void)SNDMSG((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
  2974. #define TCM_GETROWCOUNT (TCM_FIRST + 44)
  2975. #define TabCtrl_GetRowCount(hwnd) \
  2976. (int)SNDMSG((hwnd), TCM_GETROWCOUNT, 0, 0L)
  2977. #define TCM_GETTOOLTIPS (TCM_FIRST + 45)
  2978. #define TabCtrl_GetToolTips(hwnd) \
  2979. (HWND)SNDMSG((hwnd), TCM_GETTOOLTIPS, 0, 0L)
  2980. #define TCM_SETTOOLTIPS (TCM_FIRST + 46)
  2981. #define TabCtrl_SetToolTips(hwnd, hwndTT) \
  2982. (void)SNDMSG((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L)
  2983. #define TCM_GETCURFOCUS (TCM_FIRST + 47)
  2984. #define TabCtrl_GetCurFocus(hwnd) \
  2985. (int)SNDMSG((hwnd), TCM_GETCURFOCUS, 0, 0)
  2986. #define TCM_SETCURFOCUS (TCM_FIRST + 48)
  2987. #define TabCtrl_SetCurFocus(hwnd, i) \
  2988. SNDMSG((hwnd),TCM_SETCURFOCUS, i, 0)
  2989. #define TCM_SETMINTABWIDTH (TCM_FIRST + 49)
  2990. #define TabCtrl_SetMinTabWidth(hwnd, x) \
  2991. (int)SNDMSG((hwnd), TCM_SETMINTABWIDTH, 0, x)
  2992. #define TCM_DESELECTALL (TCM_FIRST + 50)
  2993. #define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\
  2994. (void)SNDMSG((hwnd), TCM_DESELECTALL, fExcludeFocus, 0)
  2995. #define TCN_KEYDOWN (TCN_FIRST - 0)
  2996. typedef struct tagTCKEYDOWN
  2997. {
  2998. NMHDR hdr;
  2999. WORD wVKey;
  3000. UINT flags;
  3001. } NMTCKEYDOWN;
  3002. #define TC_KEYDOWN NMTCKEYDOWN
  3003. #define TCN_SELCHANGE (TCN_FIRST - 1)
  3004. #define TCN_SELCHANGING (TCN_FIRST - 2)
  3005. #endif
  3006. //====== ANIMATE CONTROL ======================================================
  3007. #ifndef NOANIMATE
  3008. #ifdef _WIN32
  3009. #define ANIMATE_CLASSW L"SysAnimate32"
  3010. #define ANIMATE_CLASSA "SysAnimate32"
  3011. #ifdef UNICODE
  3012. #define ANIMATE_CLASS ANIMATE_CLASSW
  3013. #else
  3014. #define ANIMATE_CLASS ANIMATE_CLASSA
  3015. #endif
  3016. #define ACS_CENTER 0x0001
  3017. #define ACS_TRANSPARENT 0x0002
  3018. #define ACS_AUTOPLAY 0x0004
  3019. #define ACS_TIMER 0x0008 // don't use threads... use timers
  3020. #define ACM_OPENA (WM_USER+100)
  3021. #define ACM_OPENW (WM_USER+103)
  3022. #ifdef UNICODE
  3023. #define ACM_OPEN ACM_OPENW
  3024. #else
  3025. #define ACM_OPEN ACM_OPENA
  3026. #endif
  3027. #define ACM_PLAY (WM_USER+101)
  3028. #define ACM_STOP (WM_USER+102)
  3029. #define ACN_START 1
  3030. #define ACN_STOP 2
  3031. #define Animate_Create(hwndP, id, dwStyle, hInstance) \
  3032. CreateWindow(ANIMATE_CLASS, NULL, \
  3033. dwStyle, 0, 0, 0, 0, hwndP, (HMENU)(id), hInstance, NULL)
  3034. #define Animate_Open(hwnd, szName) (BOOL)SNDMSG(hwnd, ACM_OPEN, 0, (LPARAM)(LPTSTR)(szName))
  3035. #define Animate_Play(hwnd, from, to, rep) (BOOL)SNDMSG(hwnd, ACM_PLAY, (WPARAM)(UINT)(rep), (LPARAM)MAKELONG(from, to))
  3036. #define Animate_Stop(hwnd) (BOOL)SNDMSG(hwnd, ACM_STOP, 0, 0)
  3037. #define Animate_Close(hwnd) Animate_Open(hwnd, NULL)
  3038. #define Animate_Seek(hwnd, frame) Animate_Play(hwnd, frame, frame, 1)
  3039. #endif
  3040. #endif
  3041. //====== MONTHCAL CONTROL ======================================================
  3042. #ifndef NOMONTHCAL
  3043. #ifdef _WIN32
  3044. #define MONTHCAL_CLASSW L"SysMonthCal32"
  3045. #define MONTHCAL_CLASSA "SysMonthCal32"
  3046. #ifdef UNICODE
  3047. #define MONTHCAL_CLASS MONTHCAL_CLASSW
  3048. #else
  3049. #define MONTHCAL_CLASS MONTHCAL_CLASSA
  3050. #endif
  3051. // bit-packed array of "bold" info for a month
  3052. // if a bit is on, that day is drawn bold
  3053. typedef DWORD MONTHDAYSTATE, FAR * LPMONTHDAYSTATE;
  3054. #define MCM_FIRST 0x1000
  3055. // BOOL MonthCal_GetCurSel(HWND hmc, LPSYSTEMTIME pst)
  3056. // returns FALSE if MCS_MULTISELECT
  3057. // returns TRUE and sets *pst to the currently selected date otherwise
  3058. #define MCM_GETCURSEL (MCM_FIRST + 1)
  3059. #define MonthCal_GetCurSel(hmc, pst) (BOOL)SNDMSG(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst))
  3060. // BOOL MonthCal_SetCurSel(HWND hmc, LPSYSTEMTIME pst)
  3061. // returns FALSE if MCS_MULTISELECT
  3062. // returns TURE and sets the currently selected date to *pst otherwise
  3063. #define MCM_SETCURSEL (MCM_FIRST + 2)
  3064. #define MonthCal_SetCurSel(hmc, pst) (BOOL)SNDMSG(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst))
  3065. // DWORD MonthCal_GetMaxSelCount(HWND hmc)
  3066. // returns the maximum number of selectable days allowed
  3067. #define MCM_GETMAXSELCOUNT (MCM_FIRST + 3)
  3068. #define MonthCal_GetMaxSelCount(hmc) (DWORD)SNDMSG(hmc, MCM_GETMAXSELCOUNT, 0, 0L)
  3069. // BOOL MonthCal_SetMaxSelCount(HWND hmc, UINT n)
  3070. // sets the max number days that can be selected iff MCS_MULTISELECT
  3071. #define MCM_SETMAXSELCOUNT (MCM_FIRST + 4)
  3072. #define MonthCal_SetMaxSelCount(hmc, n) (BOOL)SNDMSG(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L)
  3073. // BOOL MonthCal_GetSelRange(HWND hmc, LPSYSTEMTIME rgst)
  3074. // sets rgst[0] to the first day of the selection range
  3075. // sets rgst[1] to the last day of the selection range
  3076. #define MCM_GETSELRANGE (MCM_FIRST + 5)
  3077. #define MonthCal_GetSelRange(hmc, rgst) SNDMSG(hmc, MCM_GETSELRANGE, 0, (LPRARAM)(rgst))
  3078. // BOOL MonthCal_SetSelRange(HWND hmc, LPSYSTEMTIME rgst)
  3079. // selects the range of days from rgst[0] to rgst[1]
  3080. #define MCM_SETSELRANGE (MCM_FIRST + 6)
  3081. #define MonthCal_SetSelRange(hmc, rgst) SNDMSG(hmc, MCM_SETSELRANGE, 0, (LPARAM)(rgst))
  3082. // DWORD MonthCal_GetMonthRange(HWND hmc, DWORD gmr, LPSYSTEMTIME rgst)
  3083. // if rgst specified, sets rgst[0] to the starting date and
  3084. // and rgst[1] to the ending date of the the selectable (non-grayed)
  3085. // days if GMR_VISIBLE or all the displayed days (including grayed)
  3086. // if GMR_DAYSTATE.
  3087. // returns the number of months spanned by the above range.
  3088. #define MCM_GETMONTHRANGE (MCM_FIRST + 7)
  3089. #define MonthCal_GetMonthRange(hmc, gmr, rgst) (DWORD)SNDMSG(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst))
  3090. // BOOL MonthCal_SetDayState(HWND hmc, int cbds, DAYSTATE *rgds)
  3091. // cbds is the count of DAYSTATE items in rgds and it must be equal
  3092. // to the value returned from MonthCal_GetMonthRange(hmc, GMR_DAYSTATE, NULL)
  3093. // This sets the DAYSTATE bits for each month (grayed and non-grayed
  3094. // days) displayed in the calendar. The first bit in a month's DAYSTATE
  3095. // corresponts to bolding day 1, the second bit affects day 2, etc.
  3096. #define MCM_SETDAYSTATE (MCM_FIRST + 8)
  3097. #define MonthCal_SetDayState(hmc, cbds, rgds) SNDMSG(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds))
  3098. // BOOL MonthCal_GetMinReqRect(HWND hmc, LPRECT prc)
  3099. // sets *prc the minimal size needed to display one month
  3100. #define MCM_GETMINREQRECT (MCM_FIRST + 9)
  3101. #define MonthCal_GetMinReqRect(hmc, prc) SNDMSG(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc))
  3102. // set what day is "today" send NULL to revert back to real date
  3103. #define MCM_SETTODAY (MCM_FIRST + 12)
  3104. #define MonthCal_SetToday(hmc, pst) SNDMSG(hmc, MCM_SETTODAY, 0, (LPARAM)pst)
  3105. // get what day is "today"
  3106. // returns BOOL for success/failure
  3107. #define MCM_GETTODAY (MCM_FIRST + 13)
  3108. #define MonthCal_GetToday(hmc, pst) (BOOL)SNDMSG(hmc, MCM_GETTODAY, 0, (LPARAM)pst)
  3109. // determine what pinfo->pt is over
  3110. #define MCM_HITTEST (MCM_FIRST + 14)
  3111. #define MonthCal_HitTest(hmc, pinfo) \
  3112. SNDMSG(hmc, MCM_HITTEST, 0, (LPARAM)(PMCHITTESTINFO)pinfo)
  3113. typedef struct {
  3114. UINT cbSize;
  3115. POINT pt;
  3116. UINT uHit; // out param
  3117. SYSTEMTIME st;
  3118. } MCHITTESTINFO, *PMCHITTESTINFO;
  3119. #define MCHT_TITLE 0x00010000
  3120. #define MCHT_CALENDAR 0x00020000
  3121. #define MCHT_TODAYLINK 0x00030000
  3122. #define MCHT_NEXT 0x01000000 // these indicate that hitting
  3123. #define MCHT_PREV 0x02000000 // here will go to the next/prev month
  3124. #define MCHT_NOWHERE 0x00000000
  3125. #define MCHT_TITLEBK (MCHT_TITLE)
  3126. #define MCHT_TITLEMONTH (MCHT_TITLE | 0x0001)
  3127. #define MCHT_TITLEYEAR (MCHT_TITLE | 0x0002)
  3128. #define MCHT_TITLEBTNNEXT (MCHT_TITLE | MCHT_NEXT | 0x0003)
  3129. #define MCHT_TITLEBTNPREV (MCHT_TITLE | MCHT_PREV | 0x0003)
  3130. #define MCHT_CALENDARBK (MCHT_CALENDAR)
  3131. #define MCHT_CALENDARDATE (MCHT_CALENDAR | 0x0001)
  3132. #define MCHT_CALENDARDATENEXT (MCHT_CALENDARDATE | MCHT_NEXT)
  3133. #define MCHT_CALENDARDATEPREV (MCHT_CALENDARDATE | MCHT_PREV)
  3134. #define MCHT_CALENDARDAY (MCHT_CALENDAR | 0x0002)
  3135. #define MCHT_CALENDARWEEKNUM (MCHT_CALENDAR | 0x0003)
  3136. // set colors to draw control with -- see MCSC_ bits below
  3137. #define MCM_SETCOLOR (MCM_FIRST + 10)
  3138. #define MonthCal_SetColor(hmc, iColor, clr) SNDMSG(hmc, MCM_SETCOLOR, iColor, clr)
  3139. #define MCM_GETCOLOR (MCM_FIRST + 11)
  3140. #define MonthCal_GetColor(hmc, iColor) SNDMSG(hmc, MCM_SETCOLOR, iColor, 0)
  3141. #define MCSC_BACKGROUND 0 // the background color (between months)
  3142. #define MCSC_TEXT 1 // the dates
  3143. #define MCSC_TITLEBK 2 // background of the title
  3144. #define MCSC_TITLETEXT 3
  3145. #define MCSC_MONTHBK 4 // background within the month cal
  3146. #define MCSC_TRAILINGTEXT 5 // the text color of header & trailing days
  3147. #define MCSC_COLORCOUNT 6 // ;Internal
  3148. // set first day of week to iDay:
  3149. // 0 for Monday, 1 for Tuesday, ..., 6 for Sunday
  3150. // -1 for means use locale info
  3151. #define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15)
  3152. #define MonthCal_SetFirstDayOfWeek(hmc, iDay) \
  3153. SNDMSG(hmc, MCM_SETFIRSTDAYOFWEEK, 0, iDay)
  3154. // DWORD result... low word has the day. high word is bool if this is app set
  3155. // or not (FALSE == using locale info)
  3156. #define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16)
  3157. #define MonthCal_GetFirstDayOfWeek(hmc) \
  3158. (DWORD)SNDMSG(hmc, MCM_GETFIRSTDAYOFWEEK, 0, 0)
  3159. // DWORD MonthCal_GetRange(HWND hmc, LPSYSTEMTIME rgst)
  3160. // modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
  3161. // modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
  3162. // returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
  3163. #define MCM_GETRANGE (MCM_FIRST + 17)
  3164. #define MonthCal_GetRange(hmc, rgst) \
  3165. (DWORD)SNDMSG(hmc, MCM_GETRANGE, 0, (LPARAM)(rgst))
  3166. // BOOL MonthCal_SetRange(HWND hmc, DWORD gdtr, LPSYSTEMTIME rgst)
  3167. // if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
  3168. // if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
  3169. // returns TRUE on success, FALSE on error (such as invalid parameters)
  3170. #define MCM_SETRANGE (MCM_FIRST + 18)
  3171. #define MonthCal_SetRange(hmc, gd, rgst) \
  3172. (BOOL)SNDMSG(hmc, MCM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
  3173. // int MonthCal_GetMonthDelta(HWND hmc)
  3174. // returns the number of months one click on a next/prev button moves by
  3175. #define MCM_GETMONTHDELTA (MCM_FIRST + 19)
  3176. #define MonthCal_GetMonthDelta(hmc) \
  3177. (int)SNDMSG(hmc, MCM_GETMONTHDELTA, 0, 0)
  3178. // int MonthCal_SetMonthDelta(HWND hmc, int n)
  3179. // sets the month delta to n. n==0 reverts to moving by a page of months
  3180. // returns the previous value of n.
  3181. #define MCM_SETMONTHDELTA (MCM_FIRST + 20)
  3182. #define MonthCal_SetMonthDelta(hmc, n) \
  3183. (int)SNDMSG(hmc, MCM_SETMONTHDELTA, n, 0)
  3184. // MCN_SELCHANGE is sent whenever the currently displayed date changes
  3185. // via month change, year change, keyboard navigation, prev/next button
  3186. //
  3187. typedef struct tagNMSELCHANGE
  3188. {
  3189. NMHDR nmhdr; // this must be first, so we don't break WM_NOTIFY
  3190. SYSTEMTIME stSelStart;
  3191. SYSTEMTIME stSelEnd;
  3192. } NMSELCHANGE, FAR * LPNMSELCHANGE;
  3193. #define MCN_SELCHANGE (MCN_FIRST + 1)
  3194. // MCN_GETDAYSTATE is sent for MCS_DAYSTATE controls whenever new daystate
  3195. // information is needed (month or year scroll) to draw bolding information.
  3196. // The app must fill in cDayState months worth of information starting from
  3197. // stStart date. The app may fill in the array at prgDayState or change
  3198. // prgDayState to point to a different array out of which the information
  3199. // will be copied. (similar to tooltips)
  3200. //
  3201. typedef struct tagNMDAYSTATE
  3202. {
  3203. NMHDR nmhdr; // this must be first, so we don't break WM_NOTIFY
  3204. SYSTEMTIME stStart;
  3205. int cDayState;
  3206. LPMONTHDAYSTATE prgDayState; // points to cDayState MONTHDAYSTATEs
  3207. } NMDAYSTATE, FAR * LPNMDAYSTATE;
  3208. // NOTE: this was MCN_FIRST + 2 but I changed it when I changed the structre // ;Internal
  3209. #define MCN_GETDAYSTATE (MCN_FIRST + 3)
  3210. // MCN_SELECT is sent whenever a selection has occured (via mouse or keyboard)
  3211. //
  3212. typedef NMSELCHANGE NMSELECT, FAR * LPNMSELECT;
  3213. #define MCN_SELECT (MCN_FIRST + 4)
  3214. #define MCS_DAYSTATE 0x0001
  3215. #define MCS_MULTISELECT 0x0002
  3216. #define MCS_WEEKNUMBERS 0x0004
  3217. #define MCS_NOTODAY 0x0008
  3218. #define MCS_VALIDBITS 0x000F // ;Internal
  3219. #define MCS_INVALIDBITS ((~MCS_VALIDBITS) & 0x0000FFFF) // ;Internal
  3220. #define GMR_VISIBLE 0 // visible portion of display
  3221. #define GMR_DAYSTATE 1 // above plus the grayed out parts of
  3222. // partially displayed months
  3223. #endif // _WIN32
  3224. #endif // NOMONTHCAL
  3225. //====== DATETIMEPICK CONTROL ==================================================
  3226. #ifndef NODATETIMEPICK
  3227. #ifdef _WIN32
  3228. #define DATETIMEPICK_CLASSW L"SysDateTimePick32"
  3229. #define DATETIMEPICK_CLASSA "SysDateTimePick32"
  3230. #ifdef UNICODE
  3231. #define DATETIMEPICK_CLASS DATETIMEPICK_CLASSW
  3232. #else
  3233. #define DATETIMEPICK_CLASS DATETIMEPICK_CLASSA
  3234. #endif
  3235. #define DTM_FIRST 0x1000
  3236. // DWORD DateTimePick_GetSystemtime(HWND hdp, LPSYSTEMTIME pst)
  3237. // returns GDT_NONE if "none" is selected (DTS_SHOWNONE only)
  3238. // returns GDT_VALID and modifies *pst to be the currently selected value
  3239. #define DTM_GETSYSTEMTIME (DTM_FIRST + 1)
  3240. #define DateTime_GetSystemtime(hdp, pst) (DWORD)SNDMSG(hdp, DTM_GETSYSTEMTIME, 0, (LPARAM)(pst))
  3241. // BOOL DateTime_SetSystemtime(HWND hdp, DWORD gd, LPSYSTEMTIME pst)
  3242. // if gd==GDT_NONE, sets datetimepick to None (DTS_SHOWNONE only)
  3243. // if gd==GDT_VALID, sets datetimepick to *pst
  3244. // returns TRUE on success, FALSE on error (such as bad params)
  3245. #define DTM_SETSYSTEMTIME (DTM_FIRST + 2)
  3246. #define DateTime_SetSystemtime(hdp, gd, pst) (BOOL)SNDMSG(hdp, DTM_SETSYSTEMTIME, (LPARAM)(gd), (LPARAM)(pst))
  3247. // DWORD DateTime_GetRange(HWND hdp, LPSYSTEMTIME rgst)
  3248. // modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
  3249. // modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
  3250. // returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
  3251. #define DTM_GETRANGE (DTM_FIRST + 3)
  3252. #define DateTime_GetRange(hdp, rgst) (DWORD)SNDMSG(hdp, DTM_GETRANGE, 0, (LPARAM)(rgst))
  3253. // BOOL DateTime_SetRange(HWND hdp, DWORD gdtr, LPSYSTEMTIME rgst)
  3254. // if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
  3255. // if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
  3256. // returns TRUE on success, FALSE on error (such as invalid parameters)
  3257. #define DTM_SETRANGE (DTM_FIRST + 4)
  3258. #define DateTime_SetRange(hdp, gd, rgst) (BOOL)SNDMSG(hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
  3259. // BOOL DateTime_SetFormat(HWND hdp, LPCTSTR sz)
  3260. // sets the display formatting string to sz (see GetDateFormat and GetTimeFormat for valid formatting chars)
  3261. // NOTE: 'X' is a valid formatting character which indicates that the application
  3262. // will determine how to display information. Such apps must support DTN_WMKEYDOWN,
  3263. // DTN_FORMAT, and DTN_FORMATQUERY.
  3264. #define DTM_SETFORMATA (DTM_FIRST + 5)
  3265. #define DTM_SETFORMATW (DTM_FIRST + 50)
  3266. #ifdef UNICODE
  3267. #define DTM_SETFORMAT DTM_SETFORMATW
  3268. #else
  3269. #define DTM_SETFORMAT DTM_SETFORMATA
  3270. #endif
  3271. #define DateTime_SetFormat(hdp, sz) (BOOL)SNDMSG(hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
  3272. #define DTM_SETMCCOLOR (DTM_FIRST + 6)
  3273. #define DateTime_SetMonthCalColor(hdp, iColor, clr) SNDMSG(hdp, DTM_SETMCCOLOR, iColor, clr)
  3274. #define DTM_GETMCCOLOR (DTM_FIRST + 7)
  3275. #define DateTime_GetMonthCalColor(hdp, iColor) SNDMSG(hdp, DTM_GETMCCOLOR, iColor, 0)
  3276. // HWND DateTime_GetMonthCal(HWND hdp)
  3277. // returns the HWND of the MonthCal popup window. Only valid
  3278. // between DTN_DROPDOWN and DTN_CLOSEUP notifications.
  3279. #define DTM_GETMONTHCAL (DTM_FIRST + 8)
  3280. #define DateTime_GetMonthCal(hdp) (HWND)SNDMSG(hdp, DTM_GETMONTHCAL, 0, 0)
  3281. #define DTS_UPDOWN 0x0001 // use UPDOWN instead of MONTHCAL
  3282. #define DTS_SHOWNONE 0x0002 // allow a NONE selection
  3283. #define DTS_SHORTDATEFORMAT 0x0000 // use the short date format (app must forward WM_WININICHANGE messages)
  3284. #define DTS_LONGDATEFORMAT 0x0004 // use the long date format (app must forward WM_WININICHANGE messages)
  3285. #define DTS_TIMEFORMAT 0x0009 // use the time format (app must forward WM_WININICHANGE messages)
  3286. #define DTS_APPCANPARSE 0x0010 // allow user entered strings (app MUST respond to DTN_USERSTRING)
  3287. #define DTS_RIGHTALIGN 0x0020 // right-align popup instead of left-align it
  3288. #define DTS_VALIDBITS 0x003F // ;Internal
  3289. #define DTS_INVALIDBITS ((~DTS_VALIDBITS) & 0x0000FFFF) // ;Internal
  3290. #define DTN_DATETIMECHANGE (DTN_FIRST + 1) // the systemtime has changed
  3291. typedef struct tagNMDATETIMECHANGE
  3292. {
  3293. NMHDR nmhdr;
  3294. DWORD dwFlags; // GDT_VALID or GDT_NONE
  3295. SYSTEMTIME st; // valid iff dwFlags==GDT_VALID
  3296. } NMDATETIMECHANGE, FAR * LPNMDATETIMECHANGE;
  3297. #define DTN_USERSTRINGA (DTN_FIRST + 2) // the user has entered a string
  3298. #define DTN_USERSTRINGW (DTN_FIRST + 15)
  3299. typedef struct tagNMDATETIMESTRINGA
  3300. {
  3301. NMHDR nmhdr;
  3302. LPCSTR pszUserString; // string user entered
  3303. SYSTEMTIME st; // app fills this in
  3304. DWORD dwFlags; // GDT_VALID or GDT_NONE
  3305. } NMDATETIMESTRINGA, FAR * LPNMDATETIMESTRINGA;
  3306. typedef struct tagNMDATETIMESTRINGW
  3307. {
  3308. NMHDR nmhdr;
  3309. LPCWSTR pszUserString; // string user entered
  3310. SYSTEMTIME st; // app fills this in
  3311. DWORD dwFlags; // GDT_VALID or GDT_NONE
  3312. } NMDATETIMESTRINGW, FAR * LPNMDATETIMESTRINGW;
  3313. #ifdef UNICODE
  3314. #define DTN_USERSTRING DTN_USERSTRINGW
  3315. #define NMDATETIMESTRING NMDATETIMESTRINGW
  3316. #define LPNMDATETIMESTRING LPNMDATETIMESTRINGW
  3317. #else
  3318. #define DTN_USERSTRING DTN_USERSTRINGA
  3319. #define NMDATETIMESTRING NMDATETIMESTRINGA
  3320. #define LPNMDATETIMESTRING LPNMDATETIMESTRINGA
  3321. #endif
  3322. #define DTN_WMKEYDOWNA (DTN_FIRST + 3) // modify keydown on app format field (X)
  3323. #define DTN_WMKEYDOWNW (DTN_FIRST + 16)
  3324. typedef struct tagNMDATETIMEWMKEYDOWNA
  3325. {
  3326. NMHDR nmhdr;
  3327. int nVirtKey; // virtual key code of WM_KEYDOWN which MODIFIES an X field
  3328. LPCSTR pszFormat; // format substring
  3329. SYSTEMTIME st; // current systemtime, app should modify based on key
  3330. } NMDATETIMEWMKEYDOWNA, FAR * LPNMDATETIMEWMKEYDOWNA;
  3331. typedef struct tagNMDATETIMEWMKEYDOWNW
  3332. {
  3333. NMHDR nmhdr;
  3334. int nVirtKey; // virtual key code of WM_KEYDOWN which MODIFIES an X field
  3335. LPCWSTR pszFormat; // format substring
  3336. SYSTEMTIME st; // current systemtime, app should modify based on key
  3337. } NMDATETIMEWMKEYDOWNW, FAR * LPNMDATETIMEWMKEYDOWNW;
  3338. #ifdef UNICODE
  3339. #define DTN_WMKEYDOWN DTN_WMKEYDOWNW
  3340. #define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNW
  3341. #define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNW
  3342. #else
  3343. #define DTN_WMKEYDOWN DTN_WMKEYDOWNA
  3344. #define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNA
  3345. #define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNA
  3346. #endif
  3347. #define DTN_FORMATA (DTN_FIRST + 4) // query display for app format field (X)
  3348. #define DTN_FORMATW (DTN_FIRST + 17)
  3349. typedef struct tagNMDATETIMEFORMATA
  3350. {
  3351. NMHDR nmhdr;
  3352. LPCSTR pszFormat; // format substring
  3353. SYSTEMTIME st; // current systemtime
  3354. LPCSTR pszDisplay; // string to display
  3355. CHAR szDisplay[64]; // buffer pszDisplay originally points at
  3356. } NMDATETIMEFORMATA, FAR * LPNMDATETIMEFORMATA;
  3357. typedef struct tagNMDATETIMEFORMATW
  3358. {
  3359. NMHDR nmhdr;
  3360. LPCWSTR pszFormat; // format substring
  3361. SYSTEMTIME st; // current systemtime
  3362. LPCWSTR pszDisplay; // string to display
  3363. WCHAR szDisplay[64]; // buffer pszDisplay originally points at
  3364. } NMDATETIMEFORMATW, FAR * LPNMDATETIMEFORMATW;
  3365. #ifdef UNICODE
  3366. #define DTN_FORMAT DTN_FORMATW
  3367. #define NMDATETIMEFORMAT NMDATETIMEFORMATW
  3368. #define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATW
  3369. #else
  3370. #define DTN_FORMAT DTN_FORMATA
  3371. #define NMDATETIMEFORMAT NMDATETIMEFORMATA
  3372. #define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATA
  3373. #endif
  3374. #define DTN_FORMATQUERYA (DTN_FIRST + 5) // query formatting info for app format field (X)
  3375. #define DTN_FORMATQUERYW (DTN_FIRST + 18)
  3376. typedef struct tagNMDATETIMEFORMATQUERYA
  3377. {
  3378. NMHDR nmhdr;
  3379. LPCSTR pszFormat; // format substring
  3380. SIZE szMax; // max bounding rectangle app will use for this format string
  3381. } NMDATETIMEFORMATQUERYA, FAR * LPNMDATETIMEFORMATQUERYA;
  3382. typedef struct tagNMDATETIMEFORMATQUERYW
  3383. {
  3384. NMHDR nmhdr;
  3385. LPCWSTR pszFormat; // format substring
  3386. SIZE szMax; // max bounding rectangle app will use for this format string
  3387. } NMDATETIMEFORMATQUERYW, FAR * LPNMDATETIMEFORMATQUERYW;
  3388. #ifdef UNICODE
  3389. #define DTN_FORMATQUERY DTN_FORMATQUERYW
  3390. #define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYW
  3391. #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYW
  3392. #else
  3393. #define DTN_FORMATQUERY DTN_FORMATQUERYA
  3394. #define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYA
  3395. #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYA
  3396. #endif
  3397. #define DTN_DROPDOWN (DTN_FIRST + 6) // MonthCal has dropped down
  3398. #define DTN_CLOSEUP (DTN_FIRST + 7) // MonthCal is popping up
  3399. #define GDTR_MIN 0x0001
  3400. #define GDTR_MAX 0x0002
  3401. #define GDT_ERROR -1
  3402. #define GDT_VALID 0
  3403. #define GDT_NONE 1
  3404. #endif // _WIN32
  3405. #endif // NODATETIMEPICK
  3406. ;begin_internal
  3407. #ifndef NO_COMMCTRL_SHLWAPI
  3408. #ifdef NO_COMMCTRL_STRFCNS
  3409. #define NO_SHLWAPI_STRFCNS
  3410. #endif
  3411. #define NO_SHLWAPI_PATH
  3412. // For backward compatibility, we include shlwapi.h implicitly
  3413. // because some components don't know we've moved some things
  3414. // to that header.
  3415. #include <shlwapi.h>
  3416. #if defined(WINNT) || defined(WINNT_ENV)
  3417. #include <shlwapip.h>
  3418. #endif
  3419. #endif
  3420. #ifndef NO_COMMCTRL_DA
  3421. //====== Dynamic Array routines ==========================================
  3422. // Dynamic structure array
  3423. typedef struct _DSA FAR* HDSA;
  3424. WINCOMMCTRLAPI HDSA WINAPI DSA_Create(int cbItem, int cItemGrow);
  3425. WINCOMMCTRLAPI BOOL WINAPI DSA_Destroy(HDSA hdsa);
  3426. WINCOMMCTRLAPI BOOL WINAPI DSA_GetItem(HDSA hdsa, int i, void FAR* pitem);
  3427. WINCOMMCTRLAPI LPVOID WINAPI DSA_GetItemPtr(HDSA hdsa, int i);
  3428. WINCOMMCTRLAPI BOOL WINAPI DSA_SetItem(HDSA hdsa, int i, void FAR* pitem);
  3429. WINCOMMCTRLAPI int WINAPI DSA_InsertItem(HDSA hdsa, int i, void FAR* pitem);
  3430. WINCOMMCTRLAPI BOOL WINAPI DSA_DeleteItem(HDSA hdsa, int i);
  3431. WINCOMMCTRLAPI BOOL WINAPI DSA_DeleteAllItems(HDSA hdsa);
  3432. #define DSA_GetItemCount(hdsa) (*(int FAR*)(hdsa))
  3433. // Dynamic pointer array
  3434. typedef struct _DPA FAR* HDPA;
  3435. WINCOMMCTRLAPI HDPA WINAPI DPA_Create(int cItemGrow);
  3436. WINCOMMCTRLAPI HDPA WINAPI DPA_CreateEx(int cpGrow, HANDLE hheap);
  3437. WINCOMMCTRLAPI BOOL WINAPI DPA_Destroy(HDPA hdpa);
  3438. WINCOMMCTRLAPI HDPA WINAPI DPA_Clone(HDPA hdpa, HDPA hdpaNew);
  3439. WINCOMMCTRLAPI LPVOID WINAPI DPA_GetPtr(HDPA hdpa, int i);
  3440. WINCOMMCTRLAPI int WINAPI DPA_GetPtrIndex(HDPA hdpa, LPVOID p);
  3441. WINCOMMCTRLAPI BOOL WINAPI DPA_Grow(HDPA pdpa, int cp);
  3442. WINCOMMCTRLAPI BOOL WINAPI DPA_SetPtr(HDPA hdpa, int i, LPVOID p);
  3443. WINCOMMCTRLAPI int WINAPI DPA_InsertPtr(HDPA hdpa, int i, LPVOID p);
  3444. WINCOMMCTRLAPI LPVOID WINAPI DPA_DeletePtr(HDPA hdpa, int i);
  3445. WINCOMMCTRLAPI BOOL WINAPI DPA_DeleteAllPtrs(HDPA hdpa);
  3446. #define DPA_GetPtrCount(hdpa) (*(int FAR*)(hdpa))
  3447. #define DPA_GetPtrPtr(hdpa) (*((LPVOID FAR* FAR*)((BYTE FAR*)(hdpa) + sizeof(int))))
  3448. #define DPA_FastGetPtr(hdpa, i) (DPA_GetPtrPtr(hdpa)[i])
  3449. typedef int (CALLBACK *PFNDPACOMPARE)(LPVOID p1, LPVOID p2, LPARAM lParam);
  3450. WINCOMMCTRLAPI BOOL WINAPI DPA_Sort(HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam);
  3451. // Search array. If DPAS_SORTED, then array is assumed to be sorted
  3452. // according to pfnCompare, and binary search algorithm is used.
  3453. // Otherwise, linear search is used.
  3454. //
  3455. // Searching starts at iStart (-1 to start search at beginning).
  3456. //
  3457. // DPAS_INSERTBEFORE/AFTER govern what happens if an exact match is not
  3458. // found. If neither are specified, this function returns -1 if no exact
  3459. // match is found. Otherwise, the index of the item before or after the
  3460. // closest (including exact) match is returned.
  3461. //
  3462. // Search option flags
  3463. //
  3464. #define DPAS_SORTED 0x0001
  3465. #define DPAS_INSERTBEFORE 0x0002
  3466. #define DPAS_INSERTAFTER 0x0004
  3467. WINCOMMCTRLAPI int WINAPI DPA_Search(HDPA hdpa, LPVOID pFind, int iStart,
  3468. PFNDPACOMPARE pfnCompare,
  3469. LPARAM lParam, UINT options);
  3470. //======================================================================
  3471. // String management helper routines
  3472. WINCOMMCTRLAPI int WINAPI Str_GetPtrA(LPCSTR psz, LPSTR pszBuf, int cchBuf);
  3473. WINCOMMCTRLAPI int WINAPI Str_GetPtrW(LPCWSTR psz, LPWSTR pszBuf, int cchBuf);
  3474. WINCOMMCTRLAPI BOOL WINAPI Str_SetPtrA(CHAR FAR* UNALIGNED * ppsz, LPCSTR psz);
  3475. WINCOMMCTRLAPI BOOL WINAPI Str_SetPtrW(WCHAR FAR* UNALIGNED * ppsz, LPCWSTR psz);
  3476. #ifdef UNICODE
  3477. #define Str_GetPtr Str_GetPtrW
  3478. #define Str_SetPtr Str_SetPtrW
  3479. #else
  3480. #define Str_GetPtr Str_GetPtrA
  3481. #define Str_SetPtr Str_SetPtrA
  3482. #endif
  3483. #endif // NO_COMMCTRL_DA
  3484. #ifndef NO_COMMCTRL_ALLOCFCNS
  3485. //====== Memory allocation functions ===================
  3486. #ifdef _WIN32
  3487. #define _huge
  3488. #endif
  3489. WINCOMMCTRLAPI void _huge* WINAPI Alloc(long cb);
  3490. WINCOMMCTRLAPI void _huge* WINAPI ReAlloc(void _huge* pb, long cb);
  3491. WINCOMMCTRLAPI BOOL WINAPI Free(void _huge* pb);
  3492. WINCOMMCTRLAPI DWORD WINAPI GetSize(void _huge* pb);
  3493. #endif
  3494. #ifndef _SIZE_T_DEFINED
  3495. #define _SIZE_T_DEFINED
  3496. typedef unsigned int size_t;
  3497. #endif
  3498. #ifdef _WIN32
  3499. // BUGBUG: move some place else
  3500. //===================================================================
  3501. typedef int (CALLBACK *MRUCMPPROCA)(LPCSTR, LPCSTR);
  3502. typedef int (CALLBACK *MRUCMPPROCW)(LPCWSTR, LPCWSTR);
  3503. #ifdef UNICODE
  3504. #define MRUCMPPROC MRUCMPPROCW
  3505. #else
  3506. #define MRUCMPPROC MRUCMPPROCA
  3507. #endif
  3508. // NB This is cdecl - to be compatible with the crts.
  3509. typedef int (cdecl FAR *MRUCMPDATAPROC)(const void FAR *, const void FAR *,
  3510. size_t);
  3511. typedef struct _MRUINFOA {
  3512. DWORD cbSize;
  3513. UINT uMax;
  3514. UINT fFlags;
  3515. HKEY hKey;
  3516. LPCSTR lpszSubKey;
  3517. MRUCMPPROCA lpfnCompare;
  3518. } MRUINFOA, FAR *LPMRUINFOA;
  3519. typedef struct _MRUINFOW {
  3520. DWORD cbSize;
  3521. UINT uMax;
  3522. UINT fFlags;
  3523. HKEY hKey;
  3524. LPCWSTR lpszSubKey;
  3525. MRUCMPPROCW lpfnCompare;
  3526. } MRUINFOW, FAR *LPMRUINFOW;
  3527. typedef struct _MRUDATAINFOA {
  3528. DWORD cbSize;
  3529. UINT uMax;
  3530. UINT fFlags;
  3531. HKEY hKey;
  3532. LPCSTR lpszSubKey;
  3533. MRUCMPDATAPROC lpfnCompare;
  3534. } MRUDATAINFOA, FAR *LPMRUDATAINFOA;
  3535. typedef struct _MRUDATAINFOW {
  3536. DWORD cbSize;
  3537. UINT uMax;
  3538. UINT fFlags;
  3539. HKEY hKey;
  3540. LPCWSTR lpszSubKey;
  3541. MRUCMPDATAPROC lpfnCompare;
  3542. } MRUDATAINFOW, FAR *LPMRUDATAINFOW;
  3543. #ifdef UNICODE
  3544. #define MRUINFO MRUINFOW
  3545. #define LPMRUINFO LPMRUINFOW
  3546. #define MRUDATAINFO MRUDATAINFOW
  3547. #define LPMRUDATAINFO LPMRUDATAINFOW
  3548. #else
  3549. #define MRUINFO MRUINFOA
  3550. #define LPMRUINFO LPMRUINFOA
  3551. #define MRUDATAINFO MRUDATAINFOA
  3552. #define LPMRUDATAINFO LPMRUDATAINFOA
  3553. #endif
  3554. #define MRU_BINARY 0x0001
  3555. #define MRU_CACHEWRITE 0x0002
  3556. #define MRU_ANSI 0x0004 ;Internal
  3557. WINCOMMCTRLAPI HANDLE WINAPI CreateMRUListA(LPMRUINFOA lpmi);
  3558. WINCOMMCTRLAPI HANDLE WINAPI CreateMRUListW(LPMRUINFOW lpmi);
  3559. WINCOMMCTRLAPI void WINAPI FreeMRUList(HANDLE hMRU);
  3560. WINCOMMCTRLAPI int WINAPI AddMRUStringA(HANDLE hMRU, LPCSTR szString);
  3561. WINCOMMCTRLAPI int WINAPI AddMRUStringW(HANDLE hMRU, LPCWSTR szString);
  3562. WINCOMMCTRLAPI int WINAPI DelMRUString(HANDLE hMRU, int nItem);
  3563. WINCOMMCTRLAPI int WINAPI FindMRUStringA(HANDLE hMRU, LPCSTR szString, LPINT lpiSlot);
  3564. WINCOMMCTRLAPI int WINAPI FindMRUStringW(HANDLE hMRU, LPCWSTR szString, LPINT lpiSlot);
  3565. WINCOMMCTRLAPI int WINAPI EnumMRUListA(HANDLE hMRU, int nItem, LPVOID lpData, UINT uLen);
  3566. WINCOMMCTRLAPI int WINAPI EnumMRUListW(HANDLE hMRU, int nItem, LPVOID lpData, UINT uLen);
  3567. WINCOMMCTRLAPI int WINAPI AddMRUData(HANDLE hMRU, const void FAR *lpData, UINT cbData);
  3568. WINCOMMCTRLAPI int WINAPI FindMRUData(HANDLE hMRU, const void FAR *lpData, UINT cbData,
  3569. LPINT lpiSlot);
  3570. #ifdef UNICODE
  3571. #define CreateMRUList CreateMRUListW
  3572. #define AddMRUString AddMRUStringW
  3573. #define FindMRUString FindMRUStringW
  3574. #define EnumMRUList EnumMRUListW
  3575. #else
  3576. #define CreateMRUList CreateMRUListA
  3577. #define AddMRUString AddMRUStringA
  3578. #define FindMRUString FindMRUStringA
  3579. #define EnumMRUList EnumMRUListA
  3580. #endif
  3581. #endif
  3582. //=========================================================================
  3583. // for people that just gotta use GetProcAddress()
  3584. #ifdef _WIN32
  3585. #define DPA_CreateORD 328
  3586. #define DPA_DestroyORD 329
  3587. #define DPA_GrowORD 330
  3588. #define DPA_CloneORD 331
  3589. #define DPA_GetPtrORD 332
  3590. #define DPA_GetPtrIndexORD 333
  3591. #define DPA_InsertPtrORD 334
  3592. #define DPA_SetPtrORD 335
  3593. #define DPA_DeletePtrORD 336
  3594. #define DPA_DeleteAllPtrsORD 337
  3595. #define DPA_SortORD 338
  3596. #define DPA_SearchORD 339
  3597. #define DPA_CreateExORD 340
  3598. #define SendNotifyORD 341
  3599. #define CreatePageORD 163 ;Internal
  3600. #define CreateProxyPageORD 164 ;Internal
  3601. #endif
  3602. ;end_internal
  3603. #ifdef _WIN32
  3604. //====== TrackMouseEvent =====================================================
  3605. #ifndef NOTRACKMOUSEEVENT
  3606. //
  3607. // If the messages for TrackMouseEvent have not been defined then define them
  3608. // now.
  3609. //
  3610. #ifndef WM_MOUSEHOVER
  3611. #define WM_TRACKMOUSEEVENT_FIRST 0x02A0 ;Internal
  3612. #define WM_MOUSEHOVER 0x02A1
  3613. #define WM_MOUSELEAVE 0x02A3
  3614. #define WM_TRACKMOUSEEVENT_LAST 0x02AF ;Internal
  3615. #endif
  3616. //
  3617. // If the TRACKMOUSEEVENT structure and associated flags havent been declared
  3618. // then declare them now.
  3619. //
  3620. #ifndef TME_HOVER
  3621. #define TME_HOVER 0x00000001
  3622. #define TME_LEAVE 0x00000002
  3623. #define TME_QUERY 0x40000000
  3624. #define TME_CANCEL 0x80000000
  3625. #define TME_VALID (TME_HOVER | TME_LEAVE | TME_QUERY | TME_CANCEL) // ;Internal
  3626. #define HOVER_DEFAULT 0xFFFFFFFF
  3627. typedef struct tagTRACKMOUSEEVENT {
  3628. DWORD cbSize;
  3629. DWORD dwFlags;
  3630. HWND hwndTrack;
  3631. DWORD dwHoverTime;
  3632. } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
  3633. #endif // !TME_HOVER
  3634. //
  3635. // Declare _TrackMouseEvent. This API tries to use the window manager's
  3636. // implementation of TrackMouseEvent if it is present, otherwise it emulates.
  3637. //
  3638. WINCOMMCTRLAPI
  3639. BOOL
  3640. WINAPI
  3641. _TrackMouseEvent(
  3642. LPTRACKMOUSEEVENT lpEventTrack);
  3643. #endif // !NOTRACKMOUSEEVENT
  3644. //====== SetPathWordBreakProc ====================================== ;Internal
  3645. void WINAPI SetPathWordBreakProc(HWND hwndEdit, BOOL fSet); ;Internal
  3646. #endif /* _WIN32 */
  3647. ;begin_both
  3648. #ifdef __cplusplus
  3649. }
  3650. #endif
  3651. #ifdef _WIN32
  3652. #include <poppack.h>
  3653. #endif
  3654. #endif
  3655. ;end_both
  3656. #endif // _INC_COMMCTRLP ;internal
  3657. #endif // _INC_COMMCTRL