Source code of Windows XP (NT5)
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.

8519 lines
271 KiB

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