Leaked source code of windows server 2003
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.

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