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

1153 lines
43 KiB

  1. /*****************************************************************************\
  2. * *
  3. * commctrl.h - - Interface for the Windows Common Controls *
  4. * *
  5. * Version 1.2 *
  6. * *
  7. * Copyright (c) Microsoft Corporation. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. #ifndef _INC_COMCTRLP
  11. #define _INC_COMCTRLP
  12. #ifndef NOUSER
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. //
  17. // Users of this header may define any number of these constants to avoid
  18. // the definitions of each functional group.
  19. //
  20. // NOBTNLIST A control which is a list of bitmap buttons.
  21. //
  22. //=============================================================================
  23. #ifdef WINNT
  24. #include <prshtp.h>
  25. #endif
  26. #if (_WIN32_IE >= 0x0501)
  27. #define ICC_WINLOGON_REINIT 0x80000000
  28. #endif
  29. #if (_WIN32_WINNT >= 0x501)
  30. #define ICC_ALL_CLASSES 0x0000FFFF
  31. #define ICC_ALL_VALID 0x8000FFFF
  32. #else
  33. #define ICC_ALL_CLASSES 0x00003FFF
  34. #define ICC_ALL_VALID 0x80003FFF
  35. #endif
  36. #define CCM_TRANSLATEACCELERATOR (CCM_FIRST + 0xa) // lParam == lpMsg
  37. WINCOMMCTRLAPI LRESULT WINAPI SendNotify(HWND hwndTo, HWND hwndFrom, int code, NMHDR *pnmhdr);
  38. WINCOMMCTRLAPI LRESULT WINAPI SendNotifyEx(HWND hwndTo, HWND hwndFrom, int code, NMHDR *pnmhdr, BOOL bUnicode);
  39. #define NM_STARTWAIT (NM_FIRST-9)
  40. #define NM_ENDWAIT (NM_FIRST-10)
  41. #define NM_BTNCLK (NM_FIRST-11)
  42. // Rundll reserved (0U-500U) - (0U-509U)
  43. // Run file dialog reserved (0U-510U) - (0U-519U)
  44. // Message Filter Proc codes - These are defined above MSGF_USER
  45. ///// 0x00000001 // don't use because some apps return 1 for all notifies
  46. #define CDRF_NOTIFYITEMERASE 0x00000080 //
  47. #define CDRF_VALIDFLAGS 0xFFFF00F6 //
  48. #define SSI_DEFAULT ((UINT)-1)
  49. #define SSIF_SCROLLPROC 0x0001
  50. #define SSIF_MAXSCROLLTIME 0x0002
  51. #define SSIF_MINSCROLL 0x0004
  52. typedef int (CALLBACK *PFNSMOOTHSCROLLPROC)( HWND hWnd,
  53. int dx,
  54. int dy,
  55. CONST RECT *prcScroll,
  56. CONST RECT *prcClip ,
  57. HRGN hrgnUpdate,
  58. LPRECT prcUpdate,
  59. UINT flags);
  60. typedef struct tagSSWInfo
  61. {
  62. UINT cbSize;
  63. DWORD fMask;
  64. HWND hwnd;
  65. int dx;
  66. int dy;
  67. LPCRECT lprcSrc;
  68. LPCRECT lprcClip;
  69. HRGN hrgnUpdate;
  70. LPRECT lprcUpdate;
  71. UINT fuScroll;
  72. UINT uMaxScrollTime;
  73. UINT cxMinScroll;
  74. UINT cyMinScroll;
  75. PFNSMOOTHSCROLLPROC pfnScrollProc; // we'll call this back instead
  76. } SMOOTHSCROLLINFO, *PSMOOTHSCROLLINFO;
  77. WINCOMMCTRLAPI INT WINAPI SmoothScrollWindow(PSMOOTHSCROLLINFO pssi);
  78. #define SSW_EX_NOTIMELIMIT 0x00010000
  79. #define SSW_EX_IMMEDIATE 0x00020000
  80. #define SSW_EX_IGNORESETTINGS 0x00040000 // ignore system settings to turn on/off smooth scroll
  81. #define SSW_EX_UPDATEATEACHSTEP 0x00080000
  82. // ================ READER MODE ================
  83. struct tagReaderModeInfo;
  84. typedef BOOL (CALLBACK *PFNREADERSCROLL)(struct tagReaderModeInfo*, int, int);
  85. typedef BOOL (CALLBACK *PFNREADERTRANSLATEDISPATCH)(LPMSG);
  86. typedef struct tagReaderModeInfo
  87. {
  88. UINT cbSize;
  89. HWND hwnd;
  90. DWORD fFlags;
  91. LPRECT prc;
  92. PFNREADERSCROLL pfnScroll;
  93. PFNREADERTRANSLATEDISPATCH pfnTranslateDispatch;
  94. LPARAM lParam;
  95. } READERMODEINFO, *PREADERMODEINFO;
  96. #define RMF_ZEROCURSOR 0x00000001
  97. #define RMF_VERTICALONLY 0x00000002
  98. #define RMF_HORIZONTALONLY 0x00000004
  99. #define RM_SCROLLUNIT 20
  100. WINCOMMCTRLAPI void WINAPI DoReaderMode(PREADERMODEINFO prmi);
  101. // Cursors and Bitmaps used by ReaderMode
  102. #ifdef RC_INVOKED
  103. #define IDC_HAND_INTERNAL 108
  104. #define IDC_VERTICALONLY 109
  105. #define IDC_HORIZONTALONLY 110
  106. #define IDC_MOVE2D 111
  107. #define IDC_NORTH 112
  108. #define IDC_SOUTH 113
  109. #define IDC_EAST 114
  110. #define IDC_WEST 115
  111. #define IDC_NORTHEAST 116
  112. #define IDC_NORTHWEST 117
  113. #define IDC_SOUTHEAST 118
  114. #define IDC_SOUTHWEST 119
  115. #define IDB_2DSCROLL 132
  116. #define IDB_VSCROLL 133
  117. #define IDB_HSCROLL 134
  118. #else
  119. #define IDC_HAND_INTERNAL MAKEINTRESOURCE(108)
  120. #define IDC_VERTICALONLY MAKEINTRESOURCE(109)
  121. #define IDC_HORIZONTALONLY MAKEINTRESOURCE(110)
  122. #define IDC_MOVE2D MAKEINTRESOURCE(111)
  123. #define IDC_NORTH MAKEINTRESOURCE(112)
  124. #define IDC_SOUTH MAKEINTRESOURCE(113)
  125. #define IDC_EAST MAKEINTRESOURCE(114)
  126. #define IDC_WEST MAKEINTRESOURCE(115)
  127. #define IDC_NORTHEAST MAKEINTRESOURCE(116)
  128. #define IDC_NORTHWEST MAKEINTRESOURCE(117)
  129. #define IDC_SOUTHEAST MAKEINTRESOURCE(118)
  130. #define IDC_SOUTHWEST MAKEINTRESOURCE(119)
  131. #define IDB_2DSCROLL MAKEINTRESOURCE(132)
  132. #define IDB_VSCROLL MAKEINTRESOURCE(133)
  133. #define IDB_HSCROLL MAKEINTRESOURCE(134)
  134. #endif
  135. #define NUM_OVERLAY_IMAGES_0 4
  136. #define NUM_OVERLAY_IMAGES 15
  137. #define ILC_COLORMASK 0x000000FE
  138. #define ILC_SHARED 0x00000100 // this is a shareable image list
  139. #define ILC_LARGESMALL 0x00000200 // (not implenented) contains both large and small images
  140. #define ILC_UNIQUE 0x00000400 // (not implenented) makes sure no dup. image exists in list
  141. #define ILC_MOREOVERLAY 0x00001000 // contains more overlay in the structure
  142. #if (_WIN32_WINNT >= 0x501)
  143. #define ILC_VALID (ILC_MASK | ILC_COLORMASK | ILC_SHARED | ILC_PALETTE | ILC_MIRROR | ILC_PERITEMMIRROR) // legal implemented flags
  144. #else
  145. #define ILC_MIRROR 0x00002000 // Mirror the icons contained, if the process is mirrored;internal
  146. #define ILC_VALID (ILC_MASK | ILC_COLORMASK | ILC_SHARED | ILC_PALETTE | ILC_MIRROR) // legal implemented flags
  147. #endif
  148. #if (_WIN32_WINNT >= 0x501)
  149. #define ILD_BLENDMASK 0x00000006
  150. #else
  151. #define ILD_BLENDMASK 0x0000000E
  152. #endif
  153. #define ILD_BLEND75 0x00000008 // not implemented
  154. #define ILD_MIRROR 0x00000080
  155. #define OVERLAYMASKTOINDEX(i) ((((i) >> 8) & (ILD_OVERLAYMASK >> 8))-1)
  156. #define OVERLAYMASKTO1BASEDINDEX(i) (((i) >> 8) & (ILD_OVERLAYMASK >> 8))
  157. WINCOMMCTRLAPI BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, int *cx, int *cy);
  158. WINCOMMCTRLAPI BOOL WINAPI ImageList_GetImageRect(HIMAGELIST himl, int i, RECT *prcImage);
  159. 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);
  160. #if (_WIN32_IE >= 0x0300)
  161. WINCOMMCTRLAPI BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS* pimldp);
  162. #endif
  163. WINCOMMCTRLAPI BOOL WINAPI ImageList_Remove(HIMAGELIST himl, int i);
  164. #define ILCF_VALID (ILCF_SWAP)
  165. #if (_WIN32_IE >= 0x0500)
  166. WINCOMMCTRLAPI BOOL WINAPI ImageList_SetFlags(HIMAGELIST himl, UINT flags);
  167. #endif
  168. typedef BOOL (CALLBACK *PFNIMLFILTER)(HIMAGELIST *, int *, LPARAM, BOOL);
  169. WINCOMMCTRLAPI BOOL WINAPI ImageList_SetFilter(HIMAGELIST himl, PFNIMLFILTER pfnFilter, LPARAM lParamFilter);
  170. WINCOMMCTRLAPI int ImageList_SetColorTable(HIMAGELIST piml, int start, int len, RGBQUAD *prgb);
  171. WINCOMMCTRLAPI BOOL WINAPI MirrorIcon(HICON* phiconSmall, HICON* phiconLarge);
  172. WINCOMMCTRLAPI UINT WINAPI ImageList_GetFlags(HIMAGELIST himl);
  173. #if (_WIN32_WINNT >= 0x501)
  174. WINCOMMCTRLAPI HRESULT WINAPI ImageList_CreateInstance(int cx, int cy, UINT flags, int cInitial, int cGrow, REFIID riid, void **ppv);
  175. WINCOMMCTRLAPI HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void** ppv);
  176. #define IImageListToHIMAGELIST(himl) reinterpret_cast<HIMAGELIST>(himl)
  177. #endif
  178. #define HDS_VERT 0x0001
  179. #define HDS_SHAREDIMAGELISTS 0x0000
  180. #define HDS_PRIVATEIMAGELISTS 0x0010
  181. #define HDS_OWNERDATA 0x0020
  182. #define HDFT_ISMASK 0x000f
  183. #define HDI_ALL 0x01ff
  184. /* REVIEW: index, command, flag words, resource ids should be UINT */
  185. /* REVIEW: is this internal? if not, call it TBCOLORMAP, prefix tbc */
  186. #define CMB_DISCARDABLE 0x01
  187. #define CMB_DIBSECTION 0x04
  188. /*REVIEW: TBSTATE_* should be TBF_* (for Flags) */
  189. #if (_WIN32_IE >= 0x0501)
  190. #else
  191. #define BTNS_SHOWTEXT 0x0040
  192. #endif // 0x0501
  193. #if (_WIN32_IE >= 0x0501)
  194. #elif (_WIN32_IE >= 0x0500)
  195. #define TBSTYLE_EX_MIXEDBUTTONS 0x00000008
  196. #define TBSTYLE_EX_HIDECLIPPEDBUTTONS 0x00000010
  197. #endif // 0x0501
  198. #if (_WIN32_IE >= 0x0500)
  199. #define TBSTYLE_EX_MULTICOLUMN 0x00000002 // conflicts w/ TBSTYLE_WRAPABLE
  200. #define TBSTYLE_EX_VERTICAL 0x00000004
  201. #define TBSTYLE_EX_INVERTIBLEIMAGELIST 0x00000020 // Image list may contain inverted
  202. #define TBSTYLE_EX_FIXEDDROPDOWN 0x00000040 // Only used in the taskbar
  203. #endif
  204. #if (_WIN32_WINNT >= 0x501)
  205. #define TBSTYLE_EX_TRANSPARENTDEADAREA 0x00000100
  206. #define TBSTYLE_EX_TOOLTIPSEXCLUDETOOLBAR 0x00000200
  207. #endif
  208. /* Messages up to WM_USER+8 are reserved until we define more state bits */
  209. /* Messages up to WM_USER+16 are reserved until we define more state bits */
  210. #define IDB_STD_SMALL_MONO 2 /* not supported yet */
  211. #define IDB_STD_LARGE_MONO 3 /* not supported yet */
  212. #define IDB_VIEW_SMALL_MONO 6 /* not supported yet */
  213. #define IDB_VIEW_LARGE_MONO 7 /* not supported yet */
  214. #define STD_LAST (STD_PRINT) //
  215. #define STD_MAX (STD_LAST + 1) //
  216. #define VIEW_LAST (VIEW_VIEWMENU) //
  217. #define VIEW_MAX (VIEW_LAST + 1) //
  218. #define HIST_LAST (HIST_VIEWTREE) //
  219. #define HIST_MAX (HIST_LAST + 1) //
  220. #define TB_SETBUTTONTYPE (WM_USER + 34)
  221. #ifdef _WIN32
  222. #define TB_ADDBITMAP32 (WM_USER + 38)
  223. #endif
  224. #define TBBF_MONO 0x0002 /* not supported yet */
  225. // since we don't have these for all the toolbar api's, we shouldn't expose any
  226. #define ToolBar_ButtonCount(hwnd) \
  227. (BOOL)SNDMSG((hwnd), TB_BUTTONCOUNT, 0, 0)
  228. #define ToolBar_EnableButton(hwnd, idBtn, bSet) \
  229. (BOOL)SNDMSG((hwnd), TB_ENABLEBUTTON, (WPARAM)(idBtn), (LPARAM)(bSet))
  230. #define ToolBar_CheckButton(hwnd, idBtn, bSet) \
  231. (BOOL)SNDMSG((hwnd), TB_CHECKBUTTON, (WPARAM)(idBtn), (LPARAM)(bSet))
  232. #define ToolBar_PressButton(hwnd, idBtn, bSet) \
  233. (BOOL)SNDMSG((hwnd), TB_PRESSBUTTON, (WPARAM)(idBtn), (LPARAM)(bSet))
  234. #define ToolBar_HideButton(hwnd, idBtn, bSet) \
  235. (BOOL)SNDMSG((hwnd), TB_HIDEBUTTON, (WPARAM)(idBtn), (LPARAM)(bSet))
  236. #define ToolBar_MarkButton(hwnd, idBtn, bSet) \
  237. (BOOL)SNDMSG((hwnd), TB_MARKBUTTON, (WPARAM)(idBtn), (LPARAM)(bSet))
  238. #define ToolBar_CommandToIndex(hwnd, idBtn) \
  239. (BOOL)SNDMSG((hwnd), TB_COMMANDTOINDEX, (WPARAM)(idBtn), 0)
  240. #define ToolBar_SetState(hwnd, idBtn, dwState) \
  241. (BOOL)SNDMSG((hwnd), TB_SETSTATE, (WPARAM)(idBtn), (LPARAM)(dwState))
  242. #define ToolBar_GetState(hwnd, idBtn) \
  243. (DWORD)SNDMSG((hwnd), TB_GETSTATE, (WPARAM)(idBtn), 0L)
  244. #define ToolBar_GetRect(hwnd, idBtn, prect) \
  245. (DWORD)SNDMSG((hwnd), TB_GETRECT, (WPARAM)(idBtn), (LPARAM)(prect))
  246. #define ToolBar_SetButtonInfo(hwnd, idBtn, lptbbi) \
  247. (BOOL)SNDMSG((hwnd), TB_SETBUTTONINFO, (WPARAM)(idBtn), (LPARAM)(lptbbi))
  248. // returns -1 on failure, button index on success
  249. #define ToolBar_GetButtonInfo(hwnd, idBtn, lptbbi) \
  250. (int)(SNDMSG((hwnd), TB_GETBUTTONINFO, (WPARAM)(idBtn), (LPARAM)(lptbbi)))
  251. #define ToolBar_GetButton(hwnd, iIndex, ptbb) \
  252. (BOOL)SNDMSG((hwnd), TB_GETBUTTON, (WPARAM)(iIndex), (LPARAM)(ptbb))
  253. #define ToolBar_SetStyle(hwnd, dwStyle) \
  254. SNDMSG((hwnd), TB_SETSTYLE, 0, (LPARAM)(dwStyle))
  255. #define ToolBar_GetStyle(hwnd) \
  256. (DWORD)SNDMSG((hwnd), TB_GETSTYLE, 0, 0L)
  257. #define ToolBar_GetHotItem(hwnd) \
  258. (int)SNDMSG((hwnd), TB_GETHOTITEM, 0, 0L)
  259. #define ToolBar_SetHotItem(hwnd, iPosHot) \
  260. (int)SNDMSG((hwnd), TB_SETHOTITEM, (WPARAM)(iPosHot), 0L)
  261. #define ToolBar_GetAnchorHighlight(hwnd) \
  262. (BOOL)SNDMSG((hwnd), TB_GETANCHORHIGHLIGHT, 0, 0L)
  263. #define ToolBar_SetAnchorHighlight(hwnd, bSet) \
  264. SNDMSG((hwnd), TB_SETANCHORHIGHLIGHT, (WPARAM)(bSet), 0L)
  265. #define ToolBar_MapAccelerator(hwnd, ch, pidBtn) \
  266. (BOOL)SNDMSG((hwnd), TB_MAPACCELERATOR, (WPARAM)(ch), (LPARAM)(pidBtn))
  267. #define ToolBar_GetInsertMark(hwnd, ptbim) \
  268. (void)SNDMSG((hwnd), TB_GETINSERTMARK, 0, (LPARAM)(ptbim))
  269. #define ToolBar_SetInsertMark(hwnd, ptbim) \
  270. (void)SNDMSG((hwnd), TB_SETINSERTMARK, 0, (LPARAM)(ptbim))
  271. #if (_WIN32_IE >= 0x0400)
  272. #define ToolBar_GetInsertMarkColor(hwnd) \
  273. (COLORREF)SNDMSG((hwnd), TB_GETINSERTMARKCOLOR, 0, 0)
  274. #define ToolBar_SetInsertMarkColor(hwnd, clr) \
  275. (COLORREF)SNDMSG((hwnd), TB_SETINSERTMARKCOLOR, 0, (LPARAM)(clr))
  276. #define ToolBar_SetUnicodeFormat(hwnd, fUnicode) \
  277. (BOOL)SNDMSG((hwnd), TB_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0)
  278. #define ToolBar_GetUnicodeFormat(hwnd) \
  279. (BOOL)SNDMSG((hwnd), TB_GETUNICODEFORMAT, 0, 0)
  280. #endif
  281. // ToolBar_InsertMarkHitTest always fills in *ptbim with best hit information
  282. // returns TRUE if point is within the insert region (edge of buttons)
  283. // returns FALSE if point is outside the insert region (middle of button or background)
  284. #define ToolBar_InsertMarkHitTest(hwnd, ppt, ptbim) \
  285. (BOOL)SNDMSG((hwnd), TB_INSERTMARKHITTEST, (WPARAM)(ppt), (LPARAM)(ptbim))
  286. // ToolBar_MoveButton moves the button from position iOld to position iNew,
  287. // returns TRUE iff a button actually moved.
  288. #define ToolBar_MoveButton(hwnd, iOld, iNew) \
  289. (BOOL)SNDMSG((hwnd), TB_MOVEBUTTON, (WPARAM)(iOld), (LPARAM)(iNew))
  290. #define ToolBar_SetState(hwnd, idBtn, dwState) \
  291. (BOOL)SNDMSG((hwnd), TB_SETSTATE, (WPARAM)(idBtn), (LPARAM)(dwState))
  292. #define ToolBar_HitTest(hwnd, lppoint) \
  293. (int)SNDMSG((hwnd), TB_HITTEST, 0, (LPARAM)(lppoint))
  294. #define ToolBar_GetMaxSize(hwnd, lpsize) \
  295. (BOOL)SNDMSG((hwnd), TB_GETMAXSIZE, 0, (LPARAM) (lpsize))
  296. #define ToolBar_GetPadding(hwnd) \
  297. (LONG)SNDMSG((hwnd), TB_GETPADDING, 0, 0)
  298. #define ToolBar_SetPadding(hwnd, x, y) \
  299. (LONG)SNDMSG((hwnd), TB_SETPADDING, 0, MAKELONG(x, y))
  300. #if (_WIN32_IE >= 0x0500)
  301. #define ToolBar_SetExtendedStyle(hwnd, dw, dwMask)\
  302. (DWORD)SNDMSG((hwnd), TB_SETEXTENDEDSTYLE, dwMask, dw)
  303. #define ToolBar_GetExtendedStyle(hwnd)\
  304. (DWORD)SNDMSG((hwnd), TB_GETEXTENDEDSTYLE, 0, 0)
  305. #define ToolBar_SetBoundingSize(hwnd, lpSize)\
  306. (DWORD)SNDMSG((hwnd), TB_SETBOUNDINGSIZE, 0, (LPARAM)(lpSize))
  307. #define ToolBar_SetHotItem2(hwnd, iPosHot, dwFlags) \
  308. (int)SNDMSG((hwnd), TB_SETHOTITEM2, (WPARAM)(iPosHot), (LPARAM)(dwFlags))
  309. #define ToolBar_HasAccelerator(hwnd, ch, piNum) \
  310. (BOOL)SNDMSG((hwnd), TB_HASACCELERATOR, (WPARAM)(ch), (LPARAM)(piNum))
  311. #define ToolBar_SetListGap(hwnd, iGap) \
  312. (BOOL)SNDMSG((hwnd), TB_SETLISTGAP, (WPARAM)(iGap), 0)
  313. #define ToolBar_SetButtonHeight(hwnd, iMinHeight, iMaxHeight) \
  314. (BOOL)SNDMSG((hwnd), TB_SETBUTTONHEIGHT, 0, (LPARAM)(MAKELONG((iMinHeight),(iMaxHeight))))
  315. #define ToolBar_SetButtonWidth(hwnd, iMinWidth, iMaxWidth) \
  316. (BOOL)SNDMSG((hwnd), TB_SETBUTTONWIDTH, 0, (LPARAM)(MAKELONG((iMinWidth),(iMaxWidth))))
  317. #endif
  318. #define TB_SETBOUNDINGSIZE (WM_USER + 93)
  319. #define TB_SETHOTITEM2 (WM_USER + 94) // wParam == iHotItem, lParam = dwFlags
  320. #define TB_HASACCELERATOR (WM_USER + 95) // wParem == char, lParam = &iCount
  321. #define TB_SETLISTGAP (WM_USER + 96)
  322. // empty space -- use me
  323. #define TB_GETIMAGELISTCOUNT (WM_USER + 98)
  324. #define TB_GETIDEALSIZE (WM_USER + 99) // wParam == fHeight, lParam = psize
  325. #define TB_SETDROPDOWNGAP (WM_USER + 100)
  326. // before using WM_USER + 103, recycle old space above (WM_USER + 97)
  327. #define TB_TRANSLATEACCELERATOR CCM_TRANSLATEACCELERATOR
  328. #if (_WIN32_IE >= 0x0300)
  329. #define TBN_CLOSEUP (TBN_FIRST - 11) //
  330. #endif
  331. #define TBN_WRAPHOTITEM (TBN_FIRST - 24)
  332. #define TBN_DUPACCELERATOR (TBN_FIRST - 25)
  333. #define TBN_WRAPACCELERATOR (TBN_FIRST - 26)
  334. #define TBN_DRAGOVER (TBN_FIRST - 27)
  335. #define TBN_MAPACCELERATOR (TBN_FIRST - 28)
  336. typedef struct tagNMTBDUPACCELERATOR
  337. {
  338. NMHDR hdr;
  339. UINT ch;
  340. BOOL fDup;
  341. } NMTBDUPACCELERATOR, *LPNMTBDUPACCELERATOR;
  342. typedef struct tagNMTBWRAPACCELERATOR
  343. {
  344. NMHDR hdr;
  345. UINT ch;
  346. int iButton;
  347. } NMTBWRAPACCELERATOR, *LPNMTBWRAPACCELERATOR;
  348. typedef struct tagNMTBWRAPHOTITEM
  349. {
  350. NMHDR hdr;
  351. int iStart;
  352. int iDir;
  353. UINT nReason; // HICF_* flags
  354. } NMTBWRAPHOTITEM, *LPNMTBWRAPHOTITEM;
  355. #ifndef _WIN32
  356. // for compatibility with the old 16 bit WM_COMMAND hacks
  357. typedef struct _ADJUSTINFO {
  358. TBBUTTON tbButton;
  359. char szDescription[1];
  360. } ADJUSTINFO, NEAR* PADJUSTINFO, *LPADJUSTINFO;
  361. #define TBN_BEGINDRAG 0x0201
  362. #define TBN_ENDDRAG 0x0203
  363. #define TBN_BEGINADJUST 0x0204
  364. #define TBN_ADJUSTINFO 0x0205
  365. #define TBN_ENDADJUST 0x0206
  366. #define TBN_RESET 0x0207
  367. #define TBN_QUERYINSERT 0x0208
  368. #define TBN_QUERYDELETE 0x0209
  369. #define TBN_TOOLBARCHANGE 0x020a
  370. #define TBN_CUSTHELP 0x020b
  371. #endif
  372. #if (_WIN32_IE >= 0x0500)
  373. typedef struct tagNMTBCUSTOMIZEDLG {
  374. NMHDR hdr;
  375. HWND hDlg;
  376. } NMTBCUSTOMIZEDLG, *LPNMTBCUSTOMIZEDLG;
  377. #endif
  378. #define RBS_VALID (RBS_AUTOSIZE | RBS_TOOLTIPS | RBS_VARHEIGHT | RBS_BANDBORDERS | RBS_REGISTERDROP)
  379. #if (_WIN32_IE >= 0x0400) //
  380. #if (_WIN32_IE >= 0x0500) //
  381. #if (_WIN32_IE >= 0x0501) //
  382. #endif // 0x0501 //
  383. #endif // 0x0500 //
  384. #define RBBS_FIXEDHEADERSIZE 0x40000000 //
  385. #endif // 0x0400 //
  386. #define RBBS_DRAGBREAK 0x80000000 //
  387. #define RB_GETBANDINFOOLD (WM_USER + 5) //
  388. #define RB_GETOBJECT (WM_USER + 15) //
  389. #define RB_PRIV_RESIZE (WM_USER + 33) //
  390. #define RB_PRIV_DODELAYEDSTUFF (WM_USER+36) // Private to delay doing toolbar stuff
  391. // unused, reclaim (WM_USER + 41)
  392. // unused, reclaim (WM_USER + 42)
  393. // unused, reclaim (RBN_FIRST - 9)
  394. #define RBN_BANDHEIGHTCHANGE (RBN_FIRST - 20) // send when the rebar auto changes the height of a variableheight band
  395. #if (_WIN32_IE >= 0x0400) //
  396. //The following Style bit was 0x04. Now its set to zero
  397. #define TTS_TOPMOST 0x00 //
  398. #endif //
  399. // 0x04 used to be TTS_TOPMOST
  400. // ie4 gold shell32 defview sets the flag (using SetWindowBits)
  401. // so upgrade to ie5 will cause the new style to be used
  402. // on tooltips in defview (not something we want)
  403. #define TTF_STRIPACCELS 0x0008 // (this is implicit now)
  404. #define TTF_UNICODE 0x0040 // Unicode Notify's
  405. #define TTF_MEMALLOCED 0x0200
  406. #if (_WIN32_IE >= 0x0400)
  407. #define TTF_USEHITTEST 0x0400
  408. #define TTF_RIGHT 0x0800 // right-aligned tooltips text (multi-line tooltips)
  409. #endif
  410. #if (_WIN32_IE >= 0x500)
  411. #define TTF_EXCLUDETOOLAREA 0x4000
  412. #endif
  413. #if (_WIN32_IE >= 0x0500)
  414. typedef struct tagNMTTSHOWINFO {
  415. NMHDR hdr;
  416. DWORD dwStyle;
  417. } NMTTSHOWINFO, *LPNMTTSHOWINFO;
  418. #endif
  419. // SBS_* styles need to not overlap with CCS_* values
  420. #define SB_SETBORDERS (WM_USER+5)
  421. // Warning +11-+13 are used in the unicode stuff above!
  422. /*REVIEW: is this internal? */
  423. /*/////////////////////////////////////////////////////////////////////////*/
  424. #ifndef NOBTNLIST
  425. /*REVIEW: should be BUTTONLIST_CLASS */
  426. #define BUTTONLISTBOX "ButtonListBox"
  427. /* Button List Box Styles */
  428. #define BLS_NUMBUTTONS 0x00FF
  429. #define BLS_VERTICAL 0x0100
  430. #define BLS_NOSCROLL 0x0200
  431. /* Button List Box Messages */
  432. #define BL_ADDBUTTON (WM_USER+1)
  433. #define BL_DELETEBUTTON (WM_USER+2)
  434. #define BL_GETCARETINDEX (WM_USER+3)
  435. #define BL_GETCOUNT (WM_USER+4)
  436. #define BL_GETCURSEL (WM_USER+5)
  437. #define BL_GETITEMDATA (WM_USER+6)
  438. #define BL_GETITEMRECT (WM_USER+7)
  439. #define BL_GETTEXT (WM_USER+8)
  440. #define BL_GETTEXTLEN (WM_USER+9)
  441. #define BL_GETTOPINDEX (WM_USER+10)
  442. #define BL_INSERTBUTTON (WM_USER+11)
  443. #define BL_RESETCONTENT (WM_USER+12)
  444. #define BL_SETCARETINDEX (WM_USER+13)
  445. #define BL_SETCURSEL (WM_USER+14)
  446. #define BL_SETITEMDATA (WM_USER+15)
  447. #define BL_SETTOPINDEX (WM_USER+16)
  448. #define BL_MSGMAX (WM_USER+17)
  449. /* Button listbox notification codes send in WM_COMMAND */
  450. #define BLN_ERRSPACE (-2)
  451. #define BLN_SELCHANGE 1
  452. #define BLN_CLICKED 2
  453. #define BLN_SELCANCEL 3
  454. #define BLN_SETFOCUS 4
  455. #define BLN_KILLFOCUS 5
  456. /* Message return values */
  457. #define BL_OKAY 0
  458. #define BL_ERR (-1)
  459. #define BL_ERRSPACE (-2)
  460. /* Create structure for */
  461. /* BL_ADDBUTTON and */
  462. /* BL_INSERTBUTTON */
  463. /* lpCLB = (LPCREATELISTBUTTON)lParam */
  464. typedef struct tagCREATELISTBUTTON {
  465. UINT cbSize; /* size of structure */
  466. DWORD_PTR dwItemData; /* user defined item data */
  467. /* for LB_GETITEMDATA and LB_SETITEMDATA */
  468. HBITMAP hBitmap; /* button bitmap */
  469. LPCSTR lpszText; /* button text */
  470. } CREATELISTBUTTON, *LPCREATELISTBUTTON;
  471. #endif /* NOBTNLIST */
  472. //=============================================================================
  473. /*REVIEW: these match the SB_ (scroll bar messages); define them that way? */
  474. //
  475. // Unnecessary to create a A and W version
  476. // of this string since it is only passed
  477. // to RegisterWindowMessage.
  478. //
  479. #if (_WIN32_IE >= 0x0501)
  480. #define UDS_UNSIGNED 0x0200
  481. #endif
  482. #define PBS_SHOWPERCENT 0x01
  483. #define PBS_SHOWPOS 0x02
  484. // DOC'ed for DOJ compliance
  485. #define CCS_NOHILITE 0x00000010L
  486. #define LVS_PRIVATEIMAGELISTS 0x0000
  487. #define LVS_ALIGNBOTTOM 0x0400
  488. #define LVS_ALIGNRIGHT 0x0c00
  489. #define LVIF_ALL 0x001f
  490. #if (_WIN32_WINNT >= 0x501)
  491. #define LVIF_VALID 0x0f1f
  492. #else
  493. #define LVIF_VALID 0x081f
  494. #endif
  495. #define LVIF_RESERVED 0xf000 // all bits in high nibble is for notify specific stuff
  496. #define LVIS_LINK 0x0040
  497. #define LVIS_USERMASK LVIS_STATEIMAGEMASK
  498. #define LVIS_ALL 0xFFFF
  499. #define STATEIMAGEMASKTOINDEX(i) ((i & LVIS_STATEIMAGEMASK) >> 12)
  500. // all items above this line were for win95. don't touch them.
  501. // all items above this line were for win95. don't touch them.
  502. #define I_IMAGENONE (-2)
  503. #define LVNI_PREVIOUS 0x0020
  504. #define LVFI_SUBSTRING 0x0004
  505. #define LVFI_NOCASE 0x0010
  506. // the following #define's must be packed sequentially.
  507. #define LVIR_MAX 4
  508. #define LVHT_ONLEFTSIDEOFICON 0x0080 // on the left ~10% of the icon //
  509. #define LVHT_ONRIGHTSIDEOFICON 0x0100 // on the right ~10% of the icon //
  510. #define LVA_SORTASCENDING 0x0100
  511. #define LVA_SORTDESCENDING 0x0200
  512. // all items above this line were for win95. don't touch them.
  513. // all items above this line were for win95. don't touch them.
  514. #define LVCF_ALL 0x003f
  515. #define LVCFMT_LEFT_TO_RIGHT 0x0010
  516. #define LVCFMT_RIGHT_TO_LEFT 0x0020
  517. #define LVCFMT_DIRECTION_MASK (LVCFMT_LEFT_TO_RIGHT | LVCFMT_RIGHT_TO_LEFT)
  518. #if (_WIN32_IE >= 0x0500)
  519. #endif // End (_WIN32_IE >= 0x0500)
  520. #define LVM_GETHOTLIGHTCOLOR (LVM_FIRST + 79)
  521. #define ListView_GetHotlightColor(hwndLV)\
  522. (COLORREF)SNDMSG((hwndLV), LVM_GETHOTLIGHTCOLOR, 0, 0)
  523. #define LVM_SETHOTLIGHTCOLOR (LVM_FIRST + 80)
  524. #define ListView_SetHotlightColor(hwndLV, clrHotlight)\
  525. (BOOL)SNDMSG((hwndLV), LVM_SETHOTLIGHTCOLOR, 0, (LPARAM)(clrHotlight))
  526. #if (_WIN32_WINNT >= 0x501)
  527. #define LVGS_MASK 0x00000003
  528. #define LVGA_ALIGN_MASK 0x0000002F
  529. #define LVM_KEYBOARDSELECTED (LVM_FIRST + 178)
  530. #define ListView_KeyboardSelected(hwnd, i) \
  531. (BOOL)SNDMSG((hwnd), LVM_KEYBOARDSELECTED, (WPARAM)(i), 0)
  532. #define LVM_ISITEMVISIBLE (LVM_FIRST + 182)
  533. #define ListView_IsItemVisible(hwnd, index) \
  534. (UINT)SNDMSG((hwnd), LVM_ISITEMVISIBLE, (WPARAM)index, (LPARAM)0)
  535. #endif
  536. #ifndef UNIX
  537. #define INTERFACE_PROLOGUE(a)
  538. #define INTERFACE_EPILOGUE(a)
  539. #endif
  540. #ifdef __IUnknown_INTERFACE_DEFINED__ // Don't assume they've #included objbase
  541. #undef INTERFACE
  542. #define INTERFACE ILVRange
  543. DECLARE_INTERFACE_(ILVRange, IUnknown)
  544. {
  545. INTERFACE_PROLOGUE(ILVRange)
  546. // *** IUnknown methods ***
  547. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  548. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  549. STDMETHOD_(ULONG,Release) (THIS) PURE;
  550. // *** ISelRange methods ***
  551. STDMETHOD(IncludeRange)(THIS_ LONG iBegin, LONG iEnd) PURE;
  552. STDMETHOD(ExcludeRange)(THIS_ LONG iBegin, LONG iEnd) PURE;
  553. STDMETHOD(InvertRange)(THIS_ LONG iBegin, LONG iEnd) PURE;
  554. STDMETHOD(InsertItem)(THIS_ LONG iItem) PURE;
  555. STDMETHOD(RemoveItem)(THIS_ LONG iItem) PURE;
  556. STDMETHOD(Clear)(THIS) PURE;
  557. STDMETHOD(IsSelected)(THIS_ LONG iItem) PURE;
  558. STDMETHOD(IsEmpty)(THIS) PURE;
  559. STDMETHOD(NextSelected)(THIS_ LONG iItem, LONG *piItem) PURE;
  560. STDMETHOD(NextUnSelected)(THIS_ LONG iItem, LONG *piItem) PURE;
  561. STDMETHOD(CountIncluded)(THIS_ LONG *pcIncluded) PURE;
  562. INTERFACE_EPILOGUE(ILVRange)
  563. };
  564. #endif // __IUnknown_INTERFACE_DEFINED__
  565. #define LVSR_SELECTION 0x00000000 // Set the Selection range object
  566. #define LVSR_CUT 0x00000001 // Set the Cut range object
  567. #define LVM_SETLVRANGEOBJECT (LVM_FIRST + 82)
  568. #define ListView_SetLVRangeObject(hwndLV, iWhich, pilvRange)\
  569. (BOOL)SNDMSG((hwndLV), LVM_SETLVRANGEOBJECT, (WPARAM)(iWhich), (LPARAM)(pilvRange))
  570. #define LVM_RESETEMPTYTEXT (LVM_FIRST + 84)
  571. #define ListView_ResetEmptyText(hwndLV)\
  572. (BOOL)SNDMSG((hwndLV), LVM_RESETEMPTYTEXT, 0, 0)
  573. #define LVM_SETFROZENITEM (LVM_FIRST + 85)
  574. #define ListView_SetFrozenItem(hwndLV, fFreezeOrUnfreeze, iIndex)\
  575. (BOOL)SNDMSG((hwndLV), LVM_SETFROZENITEM, (WPARAM)(fFreezeOrUnfreeze), (LPARAM)(iIndex))
  576. #define LVM_GETFROZENITEM (LVM_FIRST + 86)
  577. #define ListView_GetFrozenItem(hwndLV)\
  578. (int)SNDMSG((hwndLV), LVM_GETFROZENITEM, 0, 0)
  579. #define LVM_SETFROZENSLOT (LVM_FIRST + 88)
  580. #define ListView_SetFrozenSlot(hwndLV, fFreezeOrUnfreeze, lpPt)\
  581. (BOOL)SNDMSG((hwndLV), LVM_SETFROZENSLOT, (WPARAM)(fFreezeOrUnfreeze), (LPARAM)(lpPt))
  582. #define LVM_GETFROZENSLOT (LVM_FIRST + 89)
  583. #define ListView_GetFrozenSlot(hwndLV, lpRect)\
  584. (BOOL)SNDMSG((hwndLV), LVM_GETFROZENSLOT, (WPARAM)(0), (LPARAM)(lpRect))
  585. #define LVM_SETVIEWMARGINS (LVM_FIRST + 90)
  586. #define ListView_SetViewMargins(hwndLV, lpRect)\
  587. (BOOL)SNDMSG((hwndLV), LVM_SETVIEWMARGINS, (WPARAM)(0), (LPARAM)(lpRect))
  588. #define LVM_GETVIEWMARGINS (LVM_FIRST + 91)
  589. #define ListView_GetViewMargins(hwndLV, lpRect)\
  590. (BOOL)SNDMSG((hwndLV), LVM_SETVIEWMARGINS, (WPARAM)(0), (LPARAM)(lpRect))
  591. #define LVN_ENDDRAG (LVN_FIRST-10)
  592. #define LVN_ENDRDRAG (LVN_FIRST-12)
  593. #ifdef PW2
  594. #define LVN_PEN (LVN_FIRST-20)
  595. #endif
  596. #define LVN_GETEMPTYTEXTA (LVN_FIRST-60)
  597. #define LVN_GETEMPTYTEXTW (LVN_FIRST-61)
  598. #ifdef UNICODE
  599. #define LVN_GETEMPTYTEXT LVN_GETEMPTYTEXTW
  600. #else
  601. #define LVN_GETEMPTYTEXT LVN_GETEMPTYTEXTA
  602. #endif
  603. #if (_WIN32_IE >= 0x0500)
  604. #define LVN_INCREMENTALSEARCHA (LVN_FIRST-62)
  605. #define LVN_INCREMENTALSEARCHW (LVN_FIRST-63)
  606. #ifdef UNICODE
  607. #define LVN_INCREMENTALSEARCH LVN_INCREMENTALSEARCHW
  608. #else
  609. #define LVN_INCREMENTALSEARCH LVN_INCREMENTALSEARCHA
  610. #endif
  611. #endif // _WIN32_IE >= 0x0500
  612. #define TVS_SHAREDIMAGELISTS 0x0000 //
  613. #define TVS_PRIVATEIMAGELISTS 0x0400 //
  614. #if (_WIN32_WINNT >= 0x0501)
  615. #define TVS_EX_NOSINGLECOLLAPSE 0x00000001 // for now make this internal
  616. #endif
  617. #define TVIF_WIN95 0x007F
  618. #define TVIF_ALL 0x00FF
  619. #define TVIF_RESERVED 0xf000 // all bits in high nibble is for notify specific stuff
  620. #define TVIS_FOCUSED 0x0001 // Never implemented
  621. #define TVIS_DISABLED 0 // GOING AWAY
  622. #define TVIS_ALL 0xFF7E
  623. #define I_CHILDRENAUTO (-2)
  624. // all items above this line were for win95. don't touch them.
  625. // unfortunately, this structure was used inline in tv's notify structures
  626. // which means that the size must be fixed for compat reasond
  627. // all items above this line were for win95. don't touch them.
  628. // unfortunately, this structure was used inline in tv's notify structures
  629. // which means that the size must be fixed for compat reasond
  630. // all items above this line were for win95. don't touch them.
  631. #define TVE_ACTIONMASK 0x0003 // (TVE_COLLAPSE | TVE_EXPAND | TVE_TOGGLE)
  632. #define TV_FINDITEM (TV_FIRST + 3)
  633. #define TVGN_VALID 0x000F
  634. #if (_WIN32_WINNT >= 0x501)
  635. #else
  636. #define TVSI_NOSINGLEEXPAND 0x8000 // Should not conflict with TVGN flags.
  637. #define TVSI_VALID 0x8000
  638. #endif
  639. #define TVM_SETBORDER (TV_FIRST + 35)
  640. #define TreeView_SetBorder(hwnd, dwFlags, xBorder, yBorder) \
  641. (int)SNDMSG((hwnd), TVM_SETBORDER, (WPARAM)(dwFlags), MAKELPARAM(xBorder, yBorder))
  642. #define TVM_GETBORDER (TV_FIRST + 36)
  643. #define TreeView_GetBorder(hwnd) \
  644. (int)SNDMSG((hwnd), TVM_GETBORDER, 0, 0)
  645. #define TVSBF_XBORDER 0x00000001
  646. #define TVSBF_YBORDER 0x00000002
  647. #define TVM_TRANSLATEACCELERATOR CCM_TRANSLATEACCELERATOR
  648. #define TVM_SETEXTENDEDSTYLE (TV_FIRST + 44)
  649. #define TreeView_SetExtendedStyle(hwnd, dw, mask) \
  650. (DWORD)SNDMSG((hwnd), TVM_SETEXTENDEDSTYLE, mask, dw)
  651. #define TVM_GETEXTENDEDSTYLE (TV_FIRST + 45)
  652. #define TreeView_GetExtendedStyle(hwnd) \
  653. (DWORD)SNDMSG((hwnd), TVM_GETEXTENDEDSTYLE, 0, 0)
  654. #define CBEN_ITEMCHANGED (CBEN_FIRST - 3) //
  655. #define TCS_SHAREIMAGELISTS 0x0000
  656. #define TCS_PRIVATEIMAGELISTS 0x0000
  657. #define TCM_GETBKCOLOR (TCM_FIRST + 0)
  658. #define TabCtrl_GetBkColor(hwnd) (COLORREF)SNDMSG((hwnd), TCM_GETBKCOLOR, 0, 0L)
  659. #define TCM_SETBKCOLOR (TCM_FIRST + 1)
  660. #define TabCtrl_SetBkColor(hwnd, clrBk) (BOOL)SNDMSG((hwnd), TCM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk))
  661. #define TCIF_ALL 0x001f
  662. #define TCIS_HIDDEN 0x0004
  663. // This block must be identical to TC_TEIMHEADER
  664. // This block must be identical to TC_TEIMHEADER
  665. // internal because it is not implemented yet
  666. #define TCM_GETOBJECT (TCM_FIRST + 54)
  667. #define TabCtrl_GetObject(hwnd, piid, ppv) \
  668. (DWORD)SNDMSG((hwnd), TCM_GETOBJECT, (WPARAM)(piid), (LPARAM)(ppv))
  669. #define MCSC_COLORCOUNT 6 //
  670. // NOTE: this was MCN_FIRST + 2 but I changed it when I changed the structre //
  671. #define MCS_VALIDBITS 0x001F //
  672. #define MCS_INVALIDBITS ((~MCS_VALIDBITS) & 0x0000FFFF) //
  673. #define DTS_FORMATMASK 0x000C
  674. #define DTS_VALIDBITS 0x003F //
  675. #define DTS_INVALIDBITS ((~DTS_VALIDBITS) & 0x0000FFFF) //
  676. #define PGM_SETSCROLLINFO (PGM_FIRST + 13)
  677. #define Pager_SetScrollInfo(hwnd, cTimeOut, cLinesPer, cPixelsPerLine) \
  678. (void) SNDMSG((hwnd), PGM_SETSCROLLINFO, cTimeOut, MAKELONG(cLinesPer, cPixelsPerLine))
  679. #ifndef NOCOMBOBOX
  680. // Combobox creates a specially registered version
  681. // of the Listbox control called ComboLBox.
  682. #ifdef _WIN32
  683. #define WC_COMBOLBOXA "ComboLBox"
  684. #define WC_COMBOLBOXW L"ComboLBox"
  685. #ifdef UNICODE
  686. #define WC_COMBOLBOX WC_COMBOLBOXW
  687. #else
  688. #define WC_COMBOLBOX WC_COMBOLBOXA
  689. #endif
  690. #else
  691. #define WC_COMBOLBOX "ComboLBox"
  692. #endif // _WIN32
  693. #endif // NOCOMBOBOX
  694. /// ===================== ReaderMode Control =========================
  695. #ifndef NOREADERMODE
  696. #ifdef _WIN32
  697. #define WC_READERMODEA "ReaderModeCtl"
  698. #define WC_READERMODEW L"ReaderModeCtl"
  699. #ifdef UNICODE
  700. #define WC_READERMODE WC_READERMODEW
  701. #else
  702. #define WC_READERMODE WC_READERMODEA
  703. #endif
  704. #else
  705. #define WC_READERMODE "ReaderModeCtl"
  706. #endif // _WIN32
  707. #endif // NOREADERMODE
  708. /// ===================== End ReaderMode Control =========================
  709. #ifndef NO_COMMCTRL_DA
  710. #define __COMMCTRL_DA_DEFINED__
  711. //====== Dynamic Array routines ==========================================
  712. // DOC'ed for DOJ compliance
  713. WINCOMMCTRLAPI BOOL WINAPI DSA_GetItem(HDSA hdsa, int i, void *pitem);
  714. WINCOMMCTRLAPI BOOL WINAPI DSA_SetItem(HDSA hdsa, int i, void *pitem);
  715. WINCOMMCTRLAPI BOOL WINAPI DSA_DeleteItem(HDSA hdsa, int i);
  716. WINCOMMCTRLAPI BOOL WINAPI DSA_DeleteAllItems(HDSA hdsa);
  717. WINCOMMCTRLAPI void WINAPI DSA_EnumCallback(HDSA hdsa, PFNDSAENUMCALLBACK pfnCB, void *pData);
  718. #define DSA_GetItemCount(hdsa) (*(int *)(hdsa))
  719. #define DSA_AppendItem(hdsa, pitem) DSA_InsertItem(hdsa, DA_LAST, pitem)
  720. // DOC'ed for DOJ compliance:
  721. WINCOMMCTRLAPI HDPA WINAPI DPA_CreateEx(int cpGrow, HANDLE hheap);
  722. WINCOMMCTRLAPI HDPA WINAPI DPA_Clone(HDPA hdpa, HDPA hdpaNew);
  723. WINCOMMCTRLAPI int WINAPI DPA_GetPtrIndex(HDPA hdpa, void *p);
  724. WINCOMMCTRLAPI BOOL WINAPI DPA_Grow(HDPA pdpa, int cp);
  725. #define DPA_GetPtrCount(hdpa) (*(int *)(hdpa))
  726. #define DPA_FastDeleteLastPtr(hdpa) (--*(int *)(hdpa))
  727. #define DPA_GetPtrPtr(hdpa) (*((void * **)((BYTE *)(hdpa) + sizeof(void *))))
  728. #define DPA_FastGetPtr(hdpa, i) (DPA_GetPtrPtr(hdpa)[i])
  729. #define DPA_AppendPtr(hdpa, pitem) DPA_InsertPtr(hdpa, DA_LAST, pitem)
  730. #ifdef __IStream_INTERFACE_DEFINED__
  731. // Save to and load from a stream. The stream callback gets a pointer to
  732. // a DPASTREAMINFO structure.
  733. //
  734. // For DPA_SaveStream, the callback is responsible for writing the pvItem
  735. // info to the stream. (It's not necessary to write the iPos to the
  736. // stream.) Return S_OK if the element was saved, S_FALSE if it wasn't
  737. // but continue anyway, or some failure.
  738. //
  739. // For DPA_LoadStream, the callback is responsible for allocating an
  740. // item and setting the pvItem field to the new pointer. Return S_OK
  741. // if the element was loaded, S_FALSE it it wasn't but continue anyway,
  742. // or some failure.
  743. //
  744. typedef struct _DPASTREAMINFO
  745. {
  746. int iPos; // Index of item
  747. void *pvItem;
  748. } DPASTREAMINFO;
  749. typedef HRESULT (CALLBACK *PFNDPASTREAM)(DPASTREAMINFO * pinfo, IStream * pstream, void *pvInstData);
  750. WINCOMMCTRLAPI HRESULT WINAPI DPA_LoadStream(HDPA * phdpa, PFNDPASTREAM pfn, IStream * pstream, void *pvInstData);
  751. WINCOMMCTRLAPI HRESULT WINAPI DPA_SaveStream(HDPA hdpa, PFNDPASTREAM pfn, IStream * pstream, void *pvInstData);
  752. #endif
  753. // DOC'ed for DOJ compliance
  754. // Merge two DPAs. This takes two (optionally) presorted arrays and merges
  755. // the source array into the dest. DPA_Merge uses the provided callbacks
  756. // to perform comparison and merge operations. The merge callback is
  757. // called when two elements (one in each list) match according to the
  758. // compare function. This allows portions of an element in one list to
  759. // be merged with the respective element in the second list.
  760. //
  761. // The first DPA (hdpaDest) is the output array.
  762. //
  763. // Merge options:
  764. //
  765. // DPAM_SORTED The arrays are already sorted; don't sort
  766. // DPAM_UNION The resulting array is the union of all elements
  767. // in both arrays (DPAMM_INSERT may be sent for
  768. // this merge option.)
  769. // DPAM_INTERSECT Only elements in the source array that intersect
  770. // with the dest array are merged. (DPAMM_DELETE
  771. // may be sent for this merge option.)
  772. // DPAM_NORMAL Like DPAM_INTERSECT except the dest array
  773. // also maintains its original, additional elements.
  774. //
  775. #define DPAM_SORTED 0x00000001
  776. #define DPAM_NORMAL 0x00000002
  777. #define DPAM_UNION 0x00000004
  778. #define DPAM_INTERSECT 0x00000008
  779. // The merge callback should merge contents of the two items and return
  780. // the pointer of the merged item. It's okay to simply use pvDest
  781. // as the returned pointer.
  782. //
  783. typedef void * (CALLBACK *PFNDPAMERGE)(UINT uMsg, void *pvDest, void *pvSrc, LPARAM lParam);
  784. // Messages for merge callback
  785. #define DPAMM_MERGE 1
  786. #define DPAMM_DELETE 2
  787. #define DPAMM_INSERT 3
  788. WINCOMMCTRLAPI BOOL WINAPI DPA_Merge(HDPA hdpaDest, HDPA hdpaSrc, DWORD dwFlags, PFNDPACOMPARE pfnCompare, PFNDPAMERGE pfnMerge, LPARAM lParam);
  789. // DOC'ed for DOJ compliance
  790. #define DPA_SortedInsertPtr(hdpa, pFind, iStart, pfnCompare, lParam, options, pitem) \
  791. DPA_InsertPtr(hdpa, DPA_Search(hdpa, pFind, iStart, pfnCompare, lParam, (DPAS_SORTED | (options))), (pitem))
  792. //======================================================================
  793. // String management helper routines
  794. WINCOMMCTRLAPI int WINAPI Str_GetPtrA(LPCSTR psz, LPSTR pszBuf, int cchBuf);
  795. WINCOMMCTRLAPI int WINAPI Str_GetPtrW(LPCWSTR psz, LPWSTR pszBuf, int cchBuf);
  796. WINCOMMCTRLAPI BOOL WINAPI Str_SetPtrA(LPSTR * ppsz, LPCSTR psz);
  797. // DOC'ed for DOJ compliance:
  798. #ifdef UNICODE
  799. #define Str_GetPtr Str_GetPtrW
  800. #define Str_SetPtr Str_SetPtrW
  801. #else
  802. #define Str_GetPtr Str_GetPtrA
  803. #define Str_SetPtr Str_SetPtrA
  804. #endif
  805. #endif // NO_COMMCTRL_DA
  806. #ifndef NO_COMMCTRL_ALLOCFCNS
  807. //====== Memory allocation functions ===================
  808. #ifdef _WIN32
  809. #define _huge
  810. #endif
  811. WINCOMMCTRLAPI void _huge* WINAPI Alloc(long cb);
  812. WINCOMMCTRLAPI void _huge* WINAPI ReAlloc(void _huge* pb, long cb);
  813. WINCOMMCTRLAPI BOOL WINAPI Free(void _huge* pb);
  814. WINCOMMCTRLAPI DWORD_PTR WINAPI GetSize(void _huge* pb);
  815. #endif
  816. #ifndef _SIZE_T_DEFINED
  817. #define _SIZE_T_DEFINED
  818. typedef unsigned int size_t;
  819. #endif
  820. #ifdef _WIN32
  821. //===================================================================
  822. typedef int (CALLBACK *MRUCMPPROCA)(LPCSTR, LPCSTR);
  823. typedef int (CALLBACK *MRUCMPPROCW)(LPCWSTR, LPCWSTR);
  824. #ifdef UNICODE
  825. #define MRUCMPPROC MRUCMPPROCW
  826. #else
  827. #define MRUCMPPROC MRUCMPPROCA
  828. #endif
  829. // NB This is cdecl - to be compatible with the crts.
  830. typedef int (cdecl *MRUCMPDATAPROC)(const void *, const void *,
  831. size_t);
  832. typedef struct _MRUINFOA {
  833. DWORD cbSize;
  834. UINT uMax;
  835. UINT fFlags;
  836. HKEY hKey;
  837. LPCSTR lpszSubKey;
  838. MRUCMPPROCA lpfnCompare;
  839. } MRUINFOA, *LPMRUINFOA;
  840. typedef struct _MRUINFOW {
  841. DWORD cbSize;
  842. UINT uMax;
  843. UINT fFlags;
  844. HKEY hKey;
  845. LPCWSTR lpszSubKey;
  846. MRUCMPPROCW lpfnCompare;
  847. } MRUINFOW, *LPMRUINFOW;
  848. typedef struct _MRUDATAINFOA {
  849. DWORD cbSize;
  850. UINT uMax;
  851. UINT fFlags;
  852. HKEY hKey;
  853. LPCSTR lpszSubKey;
  854. MRUCMPDATAPROC lpfnCompare;
  855. } MRUDATAINFOA, *LPMRUDATAINFOA;
  856. typedef struct _MRUDATAINFOW {
  857. DWORD cbSize;
  858. UINT uMax;
  859. UINT fFlags;
  860. HKEY hKey;
  861. LPCWSTR lpszSubKey;
  862. MRUCMPDATAPROC lpfnCompare;
  863. } MRUDATAINFOW, *LPMRUDATAINFOW;
  864. #ifdef UNICODE
  865. #define MRUINFO MRUINFOW
  866. #define LPMRUINFO LPMRUINFOW
  867. #define MRUDATAINFO MRUDATAINFOW
  868. #define LPMRUDATAINFO LPMRUDATAINFOW
  869. #else
  870. #define MRUINFO MRUINFOA
  871. #define LPMRUINFO LPMRUINFOA
  872. #define MRUDATAINFO MRUDATAINFOA
  873. #define LPMRUDATAINFO LPMRUDATAINFOA
  874. #endif
  875. #define MRU_BINARY 0x0001
  876. #define MRU_CACHEWRITE 0x0002
  877. #define MRU_ANSI 0x0004
  878. #define MRU_LAZY 0x8000
  879. WINCOMMCTRLAPI HANDLE WINAPI CreateMRUListA(LPMRUINFOA lpmi);
  880. WINCOMMCTRLAPI HANDLE WINAPI CreateMRUListW(LPMRUINFOW lpmi);
  881. WINCOMMCTRLAPI void WINAPI FreeMRUList(HANDLE hMRU);
  882. WINCOMMCTRLAPI int WINAPI AddMRUStringA(HANDLE hMRU, LPCSTR szString);
  883. WINCOMMCTRLAPI int WINAPI AddMRUStringW(HANDLE hMRU, LPCWSTR szString);
  884. WINCOMMCTRLAPI int WINAPI DelMRUString(HANDLE hMRU, int nItem);
  885. WINCOMMCTRLAPI int WINAPI FindMRUStringA(HANDLE hMRU, LPCSTR szString, LPINT lpiSlot);
  886. WINCOMMCTRLAPI int WINAPI FindMRUStringW(HANDLE hMRU, LPCWSTR szString, LPINT lpiSlot);
  887. WINCOMMCTRLAPI int WINAPI EnumMRUListA(HANDLE hMRU, int nItem, void * lpData, UINT uLen);
  888. WINCOMMCTRLAPI int WINAPI EnumMRUListW(HANDLE hMRU, int nItem, void * lpData, UINT uLen);
  889. WINCOMMCTRLAPI int WINAPI AddMRUData(HANDLE hMRU, const void *lpData, UINT cbData);
  890. WINCOMMCTRLAPI int WINAPI FindMRUData(HANDLE hMRU, const void *lpData, UINT cbData,
  891. LPINT lpiSlot);
  892. WINCOMMCTRLAPI HANDLE WINAPI CreateMRUListLazyA(LPMRUINFOA lpmi, const void *lpData, UINT cbData, LPINT lpiSlot);
  893. WINCOMMCTRLAPI HANDLE WINAPI CreateMRUListLazyW(LPMRUINFOW lpmi, const void *lpData, UINT cbData, LPINT lpiSlot);
  894. #ifdef UNICODE
  895. #define CreateMRUList CreateMRUListW
  896. #define AddMRUString AddMRUStringW
  897. #define FindMRUString FindMRUStringW
  898. #define EnumMRUList EnumMRUListW
  899. #define CreateMRUListLazy CreateMRUListLazyW
  900. #else
  901. #define CreateMRUList CreateMRUListA
  902. #define AddMRUString AddMRUStringA
  903. #define FindMRUString FindMRUStringA
  904. #define EnumMRUList EnumMRUListA
  905. #define CreateMRUListLazy CreateMRUListLazyA
  906. #endif
  907. #endif
  908. //=========================================================================
  909. // for people that just gotta use GetProcAddress()
  910. #ifdef _WIN32
  911. #define DPA_CreateORD 328
  912. #define DPA_DestroyORD 329
  913. #define DPA_GrowORD 330
  914. #define DPA_CloneORD 331
  915. #define DPA_GetPtrORD 332
  916. #define DPA_GetPtrIndexORD 333
  917. #define DPA_InsertPtrORD 334
  918. #define DPA_SetPtrORD 335
  919. #define DPA_DeletePtrORD 336
  920. #define DPA_DeleteAllPtrsORD 337
  921. #define DPA_SortORD 338
  922. #define DPA_SearchORD 339
  923. #define DPA_CreateExORD 340
  924. #define SendNotifyORD 341
  925. #define CreatePageORD 163
  926. #define CreateProxyPageORD 164
  927. #endif
  928. #define WM_TRACKMOUSEEVENT_FIRST 0x02A0
  929. #define WM_TRACKMOUSEEVENT_LAST 0x02AF
  930. #ifndef TME_VALID
  931. #if (WINVER >= 0x0500)
  932. #define TME_VALID (TME_HOVER | TME_LEAVE | TME_NONCLIENT | TME_QUERY | TME_CANCEL)
  933. #else
  934. #define TME_VALID (TME_HOVER | TME_LEAVE | TME_QUERY | TME_CANCEL)
  935. #endif // WINVER >= 0x0500
  936. #endif // !TME_VALID
  937. // These definitions are never used as a bitmask; I don't know why
  938. // they are all powers of two.
  939. #if (_WIN32_IE >= 0x0500)
  940. #define WSB_PROP_GUTTER 0x00001000L
  941. #endif // (_WIN32_IE >= 0x0500)
  942. // WSP_PROP_MASK is completely unused, but it was public in IE4
  943. //====== SetPathWordBreakProc ======================================
  944. void WINAPI SetPathWordBreakProc(HWND hwndEdit, BOOL fSet);
  945. #if (_WIN32_WINNT >= 0x501)
  946. #else
  947. //
  948. // subclassing stuff
  949. //
  950. typedef LRESULT (CALLBACK *SUBCLASSPROC)(HWND hWnd, UINT uMsg, WPARAM wParam,
  951. LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
  952. /* #!perl
  953. PoundIf("SetWindowSubclass", "(_WIN32_IE >= 0x560)");
  954. PoundIf("GetWindowSubclass", "(_WIN32_IE >= 0x560)");
  955. PoundIf("RemoveWindowSubclass", "(_WIN32_IE >= 0x560)");
  956. // DefSubclassProc doesn't reference the type SUBCLASSPROC, so it does not need the guard.
  957. // PoundIf("DefSubclassProc", "(_WIN32_IE >= 0x560)");
  958. */
  959. BOOL WINAPI SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIdSubclass,
  960. DWORD_PTR dwRefData);
  961. BOOL WINAPI GetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIdSubclass,
  962. DWORD_PTR *pdwRefData);
  963. BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass,
  964. UINT_PTR uIdSubclass);
  965. /* #!perl DeclareFunctionErrorValue("DefSubclassProc", "0"); */
  966. LRESULT WINAPI DefSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  967. #endif
  968. #if (_WIN32_WINNT >= 0x501)
  969. /* #!perl DeclareFunctionErrorValue("DrawShadowText", "-1"); */
  970. int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT* prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow,
  971. int ixOffset, int iyOffset);
  972. #endif
  973. #ifdef __cplusplus
  974. }
  975. #endif
  976. #endif
  977. #endif // _INC_COMMCTRLP