commctrl.pp 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2006-2008 Free Pascal development team.
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. { Declarations for commctrl WinCE API
  11. }
  12. {exported functions list = to do,
  13. * please remove functions done *
  14. Exports
  15. ordinal name
  16. 73 AddMRUData
  17. 66 AddMRUStringA
  18. 67 AddMRUStringW
  19. 35 CenterWindow
  20. 11 CommandBar_GetItemWindow
  21. 63 CreateMRUListA
  22. 64 CreateMRUListW
  23. 15 CreateToolbar
  24. 50 DPA_Create
  25. 61 DPA_DeleteAllPtrs
  26. 60 DPA_DeletePtr
  27. 31 DPA_Destroy
  28. 56 DPA_DestroyCallback
  29. 32 DPA_GetPtr
  30. 62 DPA_GetPtrIndex
  31. 54 DPA_Grow
  32. 51 DPA_InsertPtr
  33. 59 DPA_Search
  34. 53 DPA_SetPtr
  35. 52 DPA_Sort
  36. 46 DSA_Clone
  37. 23 DSA_Create
  38. 30 DSA_DeleteAllItems
  39. 29 DSA_DeleteItem
  40. 24 DSA_Destroy
  41. 47 DSA_DestroyCallback
  42. 48 DSA_EnumCallback
  43. 25 DSA_GetItem
  44. 26 DSA_GetItemPtr
  45. 27 DSA_InsertItem
  46. 45 DSA_Search
  47. 28 DSA_SetItem
  48. 58 DSA_SetRange
  49. 57 DSA_Sort
  50. 68 DelMRUString
  51. 49 DoReaderMode
  52. 71 EnumMRUListA
  53. 72 EnumMRUListW
  54. 74 FindMRUData
  55. 69 FindMRUStringA
  56. 70 FindMRUStringW
  57. 65 FreeMRUList
  58. 22 InvertRect
  59. 55 IsCapEditAvailable
  60. ListView_SetItemSpacing
  61. 75 PopulateComboWithMRU
  62. 76 PopulateMenuWithMRU
  63. 80 SHCreateDefaultGradient
  64. 79 SHDrawGradient
  65. 81 SHDrawText
  66. 77 SHGetSysColor
  67. 78 SHGetSystemMetrics
  68. 82 SHSetSysColors
  69. 83 SHSetSystemMetrics
  70. 34 StrToIntW
  71. 33 Str_SetPtrW
  72. }
  73. unit commctrl;
  74. interface
  75. uses windows;
  76. {$calling cdecl}
  77. //*****************************************************************************
  78. // consts
  79. //*****************************************************************************
  80. const
  81. ComctlDLL = 'commctrl';
  82. COMCTL32_VERSION=$020c;
  83. // Common control shared messages
  84. CCM_FIRST = $2000;
  85. CCM_LAST = CCM_FIRST + $200;
  86. CCM_SETBKCOLOR = CCM_FIRST + $1; // lParam is bkColor
  87. CCM_SETVERSION = CCM_FIRST + $7;
  88. CCM_GETVERSION = CCM_FIRST + $8;
  89. //InitCommonControlEx
  90. //I_IMAGENONE = -2; // Desktop listview uses this same value for I_IMAGENONE when (_WIN32_IE >= 0x0501)
  91. //ICC_LISTVIEW_CLASSES = $00000001; // listview, header
  92. //ICC_TREEVIEW_CLASSES = $00000002; // treeview, tooltips
  93. //ICC_BAR_CLASSES = $00000004; // toolbar, statusbar, trackbar, tooltips
  94. //ICC_TAB_CLASSES = $00000008; // tab, tooltips
  95. //ICC_UPDOWN_CLASS = $00000010; // updown
  96. //ICC_PROGRESS_CLASS = $00000020; // progress
  97. ICC_ANIMATE_CLASS = $00000080; // animate
  98. //ICC_WIN95_CLASSES = $0000007F;
  99. //ICC_DATE_CLASSES = $00000100; // month picker, date picker, time picker, updown
  100. //ICC_COOL_CLASSES = $00000400; // rebar (coolbar) control
  101. //ICC_INTERNET_CLASSES = $00000800; // IP Address control
  102. //ICC_TOOLTIP_CLASSES = $00001000; // Tooltip static & button
  103. //ICC_CAPEDIT_CLASS = $00002000; // All-caps edit control
  104. //ICC_FE_CLASSES = $40000000; // FE specific input subclasses
  105. LVM_FIRST = $1000; // ListView messages
  106. TV_FIRST = $1100; // TreeView messages
  107. HDM_FIRST = $1200; // Header messages
  108. //Ranges for control message IDs
  109. LVN_FIRST = (-100); // listview
  110. LVN_LAST = (-199);
  111. HDN_FIRST = (-300); // header
  112. HDN_LAST = (-399);
  113. TVN_FIRST = (-400); // treeview
  114. TVN_LAST = (-499);
  115. TTN_FIRST = (-520); // tooltips
  116. TTN_LAST = (-549);
  117. TCN_FIRST = (-550); // tab control
  118. TCN_LAST = (-580);
  119. // Shell reserved (0U-580U) - (0U-589U)
  120. CDN_FIRST = (-601); // common dialog (new)
  121. CDN_LAST = (-699);
  122. TBN_FIRST = (-700); // toolbar
  123. TBN_LAST = (-720);
  124. UDN_FIRST = (-721); // updown
  125. UDN_LAST = (-740);
  126. MCN_FIRST = (-750); // monthcal
  127. MCN_LAST = (-759);
  128. RBN_FIRST = (-831); // rebar
  129. RBN_LAST = (-859);
  130. IPN_FIRST = (-860); // internet address
  131. IPN_LAST = (-879); // internet address
  132. SBN_FIRST = (-880); // status bar
  133. SBN_LAST = (-900);
  134. SHN_FIRST = (-1400); // Shell reserved
  135. SHN_LAST = (-1500);
  136. MSGF_COMMCTRL_BEGINDRAG = $4200;
  137. MSGF_COMMCTRL_SIZEHEADER = $4201;
  138. MSGF_COMMCTRL_DRAGSELECT = $4202;
  139. //Generic WM_NOTIFY notification codes
  140. NM_FIRST = 0;
  141. NM_LAST = -99;
  142. //NM_OUTOFMEMORY = (NM_FIRST-1);
  143. //NM_CLICK = (NM_FIRST-2);
  144. //NM_DBLCLK = (NM_FIRST-3);
  145. //NM_RETURN = (NM_FIRST-4);
  146. //NM_RCLICK = (NM_FIRST-5);
  147. //NM_RDBLCLK = (NM_FIRST-6);
  148. //NM_SETFOCUS = (NM_FIRST-7);
  149. //NM_KILLFOCUS = (NM_FIRST-8);
  150. NM_CUSTOMDRAW = (NM_FIRST-12);
  151. NM_HOVER = (NM_FIRST-13);
  152. NM_NCHITTEST = (NM_FIRST-14);
  153. NM_KEYDOWN = (NM_FIRST-15);
  154. NM_RECOGNIZEGESTURE = (NM_FIRST-50);
  155. { Header control notifications }
  156. HDN_BEGINTRACKW = HDN_FIRST-26;
  157. HDN_DIVIDERDBLCLICKW = HDN_FIRST-25;
  158. HDN_ENDTRACKW = HDN_FIRST-27;
  159. HDN_ITEMCHANGEDW = HDN_FIRST-21;
  160. HDN_ITEMCHANGINGW = HDN_FIRST-20;
  161. HDN_ITEMCLICKW = HDN_FIRST-22;
  162. HDN_ITEMDBLCLICKW = HDN_FIRST-23;
  163. HDN_TRACKW = HDN_FIRST-28;
  164. HDN_GETDISPINFOW = HDN_FIRST-29;
  165. HDN_BEGINDRAG = HDN_FIRST-10;
  166. HDN_ENDDRAG = HDN_FIRST-11;
  167. HDN_BEGINTRACK = HDN_BEGINTRACKW;
  168. HDN_DIVIDERDBLCLICK = HDN_DIVIDERDBLCLICKW;
  169. HDN_ENDTRACK = HDN_ENDTRACKW;
  170. HDN_ITEMCHANGED = HDN_ITEMCHANGEDW;
  171. HDN_ITEMCHANGING = HDN_ITEMCHANGINGW;
  172. HDN_ITEMCLICK = HDN_ITEMCLICKW;
  173. HDN_ITEMDBLCLICK = HDN_ITEMDBLCLICKW;
  174. HDN_TRACK = HDN_TRACKW;
  175. HDN_GETDISPINFO = HDN_GETDISPINFOW;
  176. // MONTHCAL CONTROL
  177. MONTHCAL_CLASS = 'SysMonthCal32';
  178. MCM_FIRST = $1000;
  179. MCM_GETCURSEL = MCM_FIRST + 1;
  180. MCM_SETCURSEL = MCM_FIRST + 2;
  181. MCM_GETMAXSELCOUNT = MCM_FIRST + 3;
  182. MCM_SETMAXSELCOUNT = MCM_FIRST + 4;
  183. MCM_GETSELRANGE = MCM_FIRST + 5;
  184. MCM_SETSELRANGE = MCM_FIRST + 6;
  185. MCM_GETMONTHRANGE = MCM_FIRST + 7;
  186. MCM_SETDAYSTATE = MCM_FIRST + 8;
  187. MCM_GETMINREQRECT = MCM_FIRST + 9;
  188. MCM_SETCOLOR = MCM_FIRST + 10;
  189. MCM_GETCOLOR = MCM_FIRST + 11;
  190. // color consts
  191. MCSC_BACKGROUND = 0; // the background color (between months)
  192. MCSC_TEXT = 1; // the dates
  193. MCSC_TITLEBK = 2; // background of the title
  194. MCSC_TITLETEXT = 3;
  195. MCSC_MONTHBK = 4; // background within the month cal
  196. MCSC_TRAILINGTEXT = 5; // the text color of header & trailing days
  197. MCM_SETTODAY = MCM_FIRST + 12;
  198. MCM_GETTODAY = MCM_FIRST + 13;
  199. MCM_HITTEST = MCM_FIRST + 14;
  200. // hittest contst
  201. MCHT_TITLE = $00010000;
  202. MCHT_CALENDAR = $00020000;
  203. MCHT_TODAYLINK = $00030000;
  204. MCHT_NONELINK = $00040000;
  205. MCHT_NEXT = $01000000; // these indicate that hitting
  206. MCHT_PREV = $02000000; // here will go to the next/prev month
  207. MCHT_NOWHERE = $00000000;
  208. MCHT_TITLEBK = MCHT_TITLE;
  209. MCHT_TITLEMONTH = MCHT_TITLE or $0001;
  210. MCHT_TITLEYEAR = MCHT_TITLE or $0002;
  211. MCHT_TITLEBTNNEXT = MCHT_TITLE or MCHT_NEXT or $0003;
  212. MCHT_TITLEBTNPREV = MCHT_TITLE or MCHT_PREV or $0003;
  213. MCHT_CALENDARBK = MCHT_CALENDAR;
  214. MCHT_CALENDARDATE = MCHT_CALENDAR or $0001;
  215. MCHT_CALENDARDATENEXT = MCHT_CALENDARDATE or MCHT_NEXT;
  216. MCHT_CALENDARDATEPREV = MCHT_CALENDARDATE or MCHT_PREV;
  217. MCHT_CALENDARDAY = MCHT_CALENDAR or $0002;
  218. MCHT_CALENDARWEEKNUM = MCHT_CALENDAR or $0003;
  219. MCM_SETFIRSTDAYOFWEEK = MCM_FIRST + 15;
  220. MCM_GETFIRSTDAYOFWEEK = MCM_FIRST + 16;
  221. MCM_GETRANGE = MCM_FIRST + 17;
  222. MCM_SETRANGE = MCM_FIRST + 18;
  223. MCM_GETMONTHDELTA = MCM_FIRST + 19;
  224. MCM_SETMONTHDELTA = MCM_FIRST + 20;
  225. MCM_GETMAXTODAYWIDTH = MCM_FIRST + 21;
  226. MCM_GETMAXNONEWIDTH = MCM_FIRST + 22;
  227. // notifications
  228. MCN_SELCHANGE = MCN_FIRST + 1;
  229. MCN_GETDAYSTATE = MCN_FIRST + 3;
  230. MCN_SELECT = MCN_FIRST + 4;
  231. MCN_SELECTNONE = MCN_FIRST + 5;
  232. // control styles
  233. MCS_DAYSTATE = $0001;
  234. MCS_MULTISELECT = $0002;
  235. MCS_WEEKNUMBERS = $0004;
  236. MCS_SHOWNONE = $0080;
  237. MCS_NOTODAYCIRCLE = $0008;
  238. MCS_NOTODAY = $0010;
  239. GMR_VISIBLE = 0; // visible portion of display
  240. GMR_DAYSTATE = 1; // above plus the grayed out parts of
  241. // partially displayed months
  242. // DATETIMEPICK CONTROL
  243. DATETIMEPICK_CLASS ='SysDateTimePick32';
  244. DTM_FIRST = $1000;
  245. DTM_GETSYSTEMTIME = DTM_FIRST + 1;
  246. DTM_SETSYSTEMTIME = DTM_FIRST + 2;
  247. DTM_GETRANGE = DTM_FIRST + 3;
  248. DTM_SETRANGE = DTM_FIRST + 4;
  249. DTM_SETFORMATA = DTM_FIRST + 5;
  250. DTM_SETMCCOLOR = DTM_FIRST + 6;
  251. DTM_GETMCCOLOR = DTM_FIRST + 7;
  252. DTM_GETMONTHCAL = DTM_FIRST + 8;
  253. DTM_SETMCFONT = DTM_FIRST + 9;
  254. DTM_GETMCFONT = DTM_FIRST + 10;
  255. DTM_SETFORMATW = DTM_FIRST + 50;
  256. DTM_SETFORMAT = DTM_SETFORMATW;
  257. DTS_UPDOWN = $0001;
  258. DTS_SHOWNONE = $0002;
  259. DTS_SHORTDATEFORMAT = $0000;
  260. DTS_LONGDATEFORMAT = $0004;
  261. DTS_SHORTDATECENTURYFORMAT = $000C;
  262. DTS_TIMEFORMAT = $0009;
  263. DTS_APPCANPARSE = $0010;
  264. DTS_RIGHTALIGN = $0020;
  265. DTS_NONEBUTTON = $0080;
  266. //datetimepick
  267. DTN_FIRST =-760;
  268. DTN_LAST =-799;
  269. DTN_DATETIMECHANGE = DTN_FIRST + 1;
  270. DTN_USERSTRINGA = DTN_FIRST + 2;
  271. DTN_WMKEYDOWNA = DTN_FIRST + 3;
  272. DTN_FORMATA = DTN_FIRST + 4;
  273. DTN_FORMATQUERYA = DTN_FIRST + 5;
  274. DTN_DROPDOWN = DTN_FIRST + 6;
  275. DTN_CLOSEUP = DTN_FIRST + 7;
  276. DTN_USERSTRINGW = DTN_FIRST + 15;
  277. DTN_WMKEYDOWNW = DTN_FIRST + 16;
  278. DTN_FORMATW = DTN_FIRST + 17;
  279. DTN_FORMATQUERYW = DTN_FIRST + 18;
  280. DTN_USERSTRING = DTN_USERSTRINGW;
  281. GDTR_MIN = $0001;
  282. GDTR_MAX = $0002;
  283. GDT_ERROR = -1;
  284. GDT_VALID = 0;
  285. GDT_NONE = 1;
  286. //TOOLBAR CONTROL
  287. //TOOLBARCLASSNAMEW = 'ToolbarWindow32';
  288. //TOOLBARCLASSNAME = TOOLBARCLASSNAMEW;
  289. TBIF_IMAGE = $00000001;
  290. TBIF_TEXT = $00000002;
  291. TBIF_STATE = $00000004;
  292. TBIF_STYLE = $00000008;
  293. TBIF_LPARAM = $00000010;
  294. TBIF_COMMAND = $00000020;
  295. TBIF_SIZE = $00000040;
  296. // BUTTONINFO APIs
  297. TB_GETBUTTONINFOW = (WM_USER + 63);
  298. TB_SETBUTTONINFOW = (WM_USER + 64);
  299. TB_GETBUTTONINFO = TB_GETBUTTONINFOW;
  300. TB_SETBUTTONINFO = TB_SETBUTTONINFOW;
  301. TB_INSERTBUTTONW = (WM_USER + 67);
  302. TB_ADDBUTTONSW = (WM_USER + 68);
  303. TB_HITTEST = (WM_USER + 69);
  304. //TB_INSERTBUTTON = TB_INSERTBUTTONW;
  305. //TB_ADDBUTTONS = TB_ADDBUTTONSW;
  306. TB_SETDRAWTEXTFLAGS = (WM_USER + 70);
  307. //TBN_GETBUTTONINFOW = (TBN_FIRST-20);
  308. //TBN_BEGINDRAG = (TBN_FIRST-1);
  309. //TBN_ENDDRAG = (TBN_FIRST-2);
  310. TBN_DROPDOWN = (TBN_FIRST - 10);
  311. TBN_DRAGOUT = (TBN_FIRST - 14);
  312. //TBN_GETBUTTONINFO = TBN_GETBUTTONINFOW;
  313. // custom draw return flags
  314. // values under 0x00010000 are reserved for global custom draw values.
  315. // above that are for specific controls
  316. CDRF_DODEFAULT = $00000000;
  317. CDRF_NEWFONT = $00000002;
  318. CDRF_SKIPDEFAULT = $00000004;
  319. CDRF_NOTIFYPOSTPAINT = $00000010;
  320. CDRF_NOTIFYITEMDRAW = $00000020;
  321. CDRF_NOTIFYSUBITEMDRAW = $00000020; // flags are the same, we can distinguish by context
  322. CDRF_NOTIFYPOSTERASE = $00000040;
  323. // drawstage flags
  324. // values under = $00010000 are reserved for global custom draw values.
  325. // above that are for specific controls
  326. CDDS_PREPAINT = $00000001;
  327. CDDS_POSTPAINT = $00000002;
  328. CDDS_PREERASE = $00000003;
  329. CDDS_POSTERASE = $00000004;
  330. // the = $000010000 bit means it's individual item specific
  331. CDDS_ITEM = $00010000;
  332. CDDS_ITEMPREPAINT = CDDS_ITEM or CDDS_PREPAINT;
  333. CDDS_ITEMPOSTPAINT = CDDS_ITEM or CDDS_POSTPAINT;
  334. CDDS_ITEMPREERASE = CDDS_ITEM or CDDS_PREERASE;
  335. CDDS_ITEMPOSTERASE = CDDS_ITEM or CDDS_POSTERASE;
  336. CDDS_SUBITEM = $00020000;
  337. // Pocket PC special controls
  338. WC_CAPEDIT = 'CAPEDIT';
  339. WC_TSTATIC = 'TTSTATIC';
  340. WC_TBUTTON = 'TTBUTTON';
  341. // for FE, single byte character edit
  342. WC_SBEDIT = 'sbedit';
  343. // REBAR CONTROL
  344. REBARCLASSNAME = 'ReBarWindow';
  345. RBIM_IMAGELIST = $00000001;
  346. RBS_VARHEIGHT = $0200;
  347. RBS_BANDBORDERS = $0400;
  348. RBS_FIXEDORDER = $0800;
  349. RBS_SMARTLABELS = $1000;
  350. RBS_AUTOSIZE = $2000;
  351. RBS_VERTICALGRIPPER = $4000; { this always has the vertical gripper (default for horizontal mode) }
  352. RBBS_BREAK = $00000001; { break to new line }
  353. RBBS_FIXEDSIZE = $00000002; { band can't be sized }
  354. RBBS_CHILDEDGE = $00000004; { edge around top & bottom of child window }
  355. RBBS_HIDDEN = $00000008; { don't show }
  356. RBBS_NOVERT = $00000010; { don't show when vertical }
  357. RBBS_FIXEDBMP = $00000020; { bitmap doesn't move during band resize }
  358. RBBS_VARIABLEHEIGHT = $00000040; { allow autosizing of this child vertically }
  359. RBBS_GRIPPERALWAYS = $00000080; { always show the gripper }
  360. RBBS_NOGRIPPER = $00000100; { never show gripper for this band }
  361. RBBIM_STYLE = $00000001;
  362. RBBIM_COLORS = $00000002;
  363. RBBIM_TEXT = $00000004;
  364. RBBIM_IMAGE = $00000008;
  365. RBBIM_CHILD = $00000010;
  366. RBBIM_CHILDSIZE = $00000020;
  367. RBBIM_SIZE = $00000040;
  368. RBBIM_BACKGROUND = $00000080;
  369. RBBIM_ID = $00000100;
  370. RBBIM_IDEALSIZE = $00000200;
  371. RBBIM_LPARAM = $00000400;
  372. RB_DELETEBAND = WM_USER+2;
  373. RB_GETBARINFO = WM_USER+3;
  374. RB_SETBARINFO = WM_USER+4;
  375. RB_SETPARENT = WM_USER+7;
  376. RB_HITTEST = WM_USER+8;
  377. RB_GETRECT = WM_USER+9;
  378. RB_INSERTBANDW = WM_USER+10;
  379. RB_SETBANDINFOW = WM_USER+11;
  380. RB_GETBANDCOUNT = WM_USER+12;
  381. RB_GETROWCOUNT = WM_USER+13;
  382. RB_GETROWHEIGHT = WM_USER+14;
  383. RB_IDTOINDEX = WM_USER+16; { wParam == id }
  384. RB_SETBKCOLOR = WM_USER+19; { sets the default BK color }
  385. RB_GETBKCOLOR = WM_USER+20; { defaults to CLR_NONE }
  386. RB_SETTEXTCOLOR = WM_USER+21;
  387. RB_GETTEXTCOLOR = WM_USER+22; { defaults to 0x00000000 }
  388. RB_SIZETORECT = WM_USER+23; { resize the rebar/break bands and such to this rect (lparam) }
  389. RB_INSERTBAND = RB_INSERTBANDW;
  390. RB_SETBANDINFO = RB_SETBANDINFOW;
  391. RB_BEGINDRAG = WM_USER+24;
  392. RB_ENDDRAG = WM_USER+25;
  393. RB_DRAGMOVE = WM_USER+26;
  394. RB_GETBARHEIGHT = WM_USER+27;
  395. RB_GETBANDINFOW = WM_USER+28;
  396. RB_GETBANDINFO = RB_GETBANDINFOW;
  397. RB_MINIMIZEBAND = WM_USER+30;
  398. RB_MAXIMIZEBAND = WM_USER+31;
  399. RB_GETBANDBORDERS = WM_USER+34; { returns in lparam = lprc the amount of edges added to band wparam }
  400. RB_SHOWBAND = WM_USER+35; { show/hide band }
  401. RB_MOVEBAND = WM_USER+36;
  402. RBN_HEIGHTCHANGE = RBN_FIRST-0;
  403. RBN_LAYOUTCHANGED = RBN_FIRST-2;
  404. RBN_AUTOSIZE = RBN_FIRST-3;
  405. RBN_BEGINDRAG = RBN_FIRST-4;
  406. RBN_ENDDRAG = RBN_FIRST-5;
  407. RBHT_NOWHERE = $0001;
  408. RBHT_CAPTION = $0002;
  409. RBHT_CLIENT = $0003;
  410. RBHT_GRABBER = $0004;
  411. CMDBAR_HELP = $000B;
  412. CMDBAR_OK = $F000;
  413. //*****************************************************************************
  414. // types
  415. //*****************************************************************************
  416. type
  417. // MONTHCAL CONTROL
  418. MONTHDAYSTATE = DWORD;
  419. LPMONTHDAYSTATE = ^MONTHDAYSTATE;
  420. TMonthDayState = MONTHDAYSTATE;
  421. PMonthDayState = LPMONTHDAYSTATE;
  422. MCHITTESTINFO = record
  423. cbSize: UINT;
  424. pt : POINT;
  425. uHit : UINT; // out param
  426. st : SYSTEMTIME;
  427. end;
  428. TMCMHITTESTINFO = MCHITTESTINFO;
  429. PMCMHitTestInfo = ^MCHITTESTINFO;
  430. tagNMSELCHANGE = record
  431. nmhdr : NMHDR; // this must be first, so we don't break WM_NOTIFY
  432. stSelStart: SYSTEMTIME;
  433. stSelEnd : SYSTEMTIME;
  434. end;
  435. NMSELCHANGE = tagNMSELCHANGE;
  436. TNMSELCHANGE = tagNMSELCHANGE;
  437. LPNMSELCHANGE = ^tagNMSELCHANGE;
  438. tagNMDAYSTATE = record
  439. nmhdr : NMHDR; // this must be first, so we don't break WM_NOTIFY
  440. stStart : SYSTEMTIME;
  441. cDayState : longint;
  442. prgDayState: LPMONTHDAYSTATE; // points to cDayState MONTHDAYSTATEs
  443. end;
  444. NMDAYSTATE = tagNMDAYSTATE;
  445. TNMDAYSTATE = tagNMDAYSTATE;
  446. LPNMDAYSTATE = ^tagNMDAYSTATE;
  447. // DATETIMEPICK CONTROL
  448. tagNMDATETIMECHANGE = record
  449. nmhdr : NMHDR;
  450. dwFlags : DWORD;
  451. st : SYSTEMTIME;
  452. end;
  453. NMDATETIMECHANGE=tagNMDATETIMECHANGE;
  454. TNMDATETIMECHANGE=tagNMDATETIMECHANGE;
  455. LPNMDATETIMECHANGE=^tagNMDATETIMECHANGE;
  456. tagNMDATETIMESTRINGW = record
  457. nmhdr : NMHDR;
  458. pszUserString : LPCWSTR;
  459. st : SYSTEMTIME;
  460. dwFlags : DWORD;
  461. end;
  462. NMDATETIMESTRINGW=tagNMDATETIMESTRINGW;
  463. TNMDATETIMESTRINGW=tagNMDATETIMESTRINGW;
  464. LPNMDATETIMESTRINGW=^tagNMDATETIMESTRINGW;
  465. NMDATETIMESTRING=tagNMDATETIMESTRINGW;
  466. TNMDATETIMESTRING=tagNMDATETIMESTRINGW;
  467. PNMDATETIMESTRING=^tagNMDATETIMESTRINGW;
  468. tagNMDATETIMEWMKEYDOWNA = record
  469. nmhdr : NMHDR;
  470. nVirtKey : longint;
  471. pszFormat : LPCSTR;
  472. st : SYSTEMTIME;
  473. end;
  474. NMDATETIMEWMKEYDOWNA=tagNMDATETIMEWMKEYDOWNA;
  475. TNMDATETIMEWMKEYDOWNA=tagNMDATETIMEWMKEYDOWNA;
  476. LPNMDATETIMEWMKEYDOWNA=^tagNMDATETIMEWMKEYDOWNA;
  477. tagNMDATETIMEWMKEYDOWNW = record
  478. nmhdr : NMHDR;
  479. nVirtKey : longint;
  480. pszFormat : LPCWSTR;
  481. st : SYSTEMTIME;
  482. end;
  483. NMDATETIMEWMKEYDOWNW=tagNMDATETIMEWMKEYDOWNW;
  484. TNMDATETIMEWMKEYDOWNW=tagNMDATETIMEWMKEYDOWNW;
  485. LPNMDATETIMEWMKEYDOWNW=^tagNMDATETIMEWMKEYDOWNW;
  486. tagNMDATETIMEFORMATA = record
  487. nmhdr : NMHDR;
  488. pszFormat : LPCSTR;
  489. st : SYSTEMTIME;
  490. pszDisplay : LPCSTR;
  491. szDisplay : Array[0..63] of CHAR;
  492. end;
  493. NMDATETIMEFORMATA=tagNMDATETIMEFORMATA;
  494. TNMDATETIMEFORMATA=tagNMDATETIMEFORMATA;
  495. LPNMDATETIMEFORMATA=^NMDATETIMEFORMATA;
  496. tagNMDATETIMEFORMATW = record
  497. nmhdr : NMHDR;
  498. pszFormat : LPCWSTR;
  499. st : SYSTEMTIME;
  500. pszDisplay : LPCWSTR;
  501. szDisplay : Array[0..63] of WCHAR;
  502. end;
  503. NMDATETIMEFORMATW=tagNMDATETIMEFORMATW;
  504. TNMDATETIMEFORMATW=tagNMDATETIMEFORMATW;
  505. LPNMDATETIMEFORMATW=^NMDATETIMEFORMATW;
  506. tagNMDATETIMEFORMATQUERYA = record
  507. nmhdr : NMHDR;
  508. pszFormat : LPCSTR;
  509. szMax : SIZE;
  510. end;
  511. NMDATETIMEFORMATQUERYA=tagNMDATETIMEFORMATQUERYA;
  512. TNMDATETIMEFORMATQUERYA=tagNMDATETIMEFORMATQUERYA;
  513. LPNMDATETIMEFORMATQUERYA=^tagNMDATETIMEFORMATQUERYA;
  514. tagNMDATETIMEFORMATQUERYW = record
  515. nmhdr : NMHDR;
  516. pszFormat : LPCWSTR;
  517. szMax : SIZE;
  518. end;
  519. NMDATETIMEFORMATQUERYW=tagNMDATETIMEFORMATQUERYW;
  520. TNMDATETIMEFORMATQUERYW=tagNMDATETIMEFORMATQUERYW;
  521. LPNMDATETIMEFORMATQUERYW=^tagNMDATETIMEFORMATQUERYW;
  522. //Generic structure for a key
  523. tagNMKEY = Record
  524. hdr : NMHDR;
  525. wVKey : WORD;
  526. flags : UINT;
  527. end;
  528. NMKEY=tagNMKEY;
  529. LPNMKEY=^NMKEY;
  530. //Generic WM_NOTIFY notification structures
  531. tagNMMOUSE = Record
  532. hdr : NMHDR;
  533. dwItemSpec : DWORD;
  534. dwItemData : DWORD;
  535. pt : POINT;
  536. end;
  537. NMMOUSE=tagNMMOUSE;
  538. LPNMMOUSE=^NMMOUSE;
  539. PNMMOUSE=^NMMOUSE;
  540. NMCLICK=NMMOUSE;
  541. LPNMCLICK=LPNMMOUSE;
  542. //TOOLBAR CONTROL
  543. TBBUTTONINFOW = record
  544. cbSize : UINT;
  545. dwMask : DWORD;
  546. idCommand : Longint;
  547. iImage : Longint;
  548. fsState : BYTE;
  549. fsStyle : BYTE;
  550. cx : WORD;
  551. lParam : DWORD;
  552. pszText : LPWSTR;
  553. cchText : Longint;
  554. end;
  555. LPTBBUTTONINFOW=^TBBUTTONINFOW;
  556. TBBUTTONINFO=TBBUTTONINFOW;
  557. TTBButtonInfo=TBBUTTONINFO;
  558. tagNMCUSTOMDRAWINFO = record
  559. hdr: TNMHdr;
  560. dwDrawStage: DWORD;
  561. hdc: HDC;
  562. rc: TRect;
  563. dwItemSpec: DWORD;
  564. uItemState: UINT;
  565. lItemlParam: LPARAM;
  566. end;
  567. PNMCustomDraw = ^TNMCustomDraw;
  568. TNMCustomDraw = tagNMCUSTOMDRAWINFO;
  569. tagNMLVCUSTOMDRAW = record
  570. nmcd: TNMCustomDraw;
  571. clrText: COLORREF;
  572. clrTextBk: COLORREF;
  573. iSubItem: longint;
  574. end;
  575. PNMLVCustomDraw = ^TNMLVCustomDraw;
  576. TNMLVCustomDraw = tagNMLVCUSTOMDRAW;
  577. tagNMLVODSTATECHANGE = record
  578. hdr: TNMHdr;
  579. iFrom: longint;
  580. iTo: longint;
  581. uNewState: UINT;
  582. uOldState: UINT;
  583. end;
  584. PNMLVODStateChange = ^TNMLVODStateChange;
  585. TNMLVODStateChange = tagNMLVODSTATECHANGE;
  586. tagREBARINFO = record
  587. cbSize : UINT;
  588. fMask : UINT;
  589. himl : HIMAGELIST;
  590. end;
  591. REBARINFO = tagREBARINFO;
  592. LPREBARINFO = ^tagREBARINFO;
  593. tagREBARBANDINFOW = record
  594. cbSize : UINT;
  595. fMask : UINT;
  596. fStyle : UINT;
  597. clrFore : COLORREF;
  598. clrBack : COLORREF;
  599. lpText : LPWSTR;
  600. cch : UINT;
  601. iImage : longint;
  602. hwndChild : HWND;
  603. cxMinChild : UINT;
  604. cyMinChild : UINT;
  605. cx : UINT;
  606. hbmBack : HBITMAP;
  607. wID : UINT;
  608. cyChild : UINT;
  609. cyMaxChild : UINT;
  610. cyIntegral : UINT;
  611. cxIdeal : UINT;
  612. lParam : LPARAM;
  613. end;
  614. REBARBANDINFOW = tagREBARBANDINFOW;
  615. LPREBARBANDINFOW = ^tagREBARBANDINFOW;
  616. LPCREBARBANDINFOW = REBARBANDINFOW;
  617. REBARBANDINFO = REBARBANDINFOW;
  618. LPREBARBANDINFO = LPREBARBANDINFOW;
  619. LPCREBARBANDINFO = LPCREBARBANDINFOW;
  620. tagNMREBAR = record
  621. hdr : NMHDR;
  622. uBand : UINT;
  623. wID : UINT;
  624. cyChild : UINT;
  625. cyBand : UINT;
  626. end;
  627. NMREBAR = tagNMREBAR;
  628. LPNMREBAR = ^tagNMREBAR;
  629. tagNMRBAUTOSIZE = record
  630. hdr : NMHDR;
  631. fChanged : BOOL;
  632. rcTarget : RECT;
  633. rcActual : RECT;
  634. end;
  635. NMRBAUTOSIZE = tagNMRBAUTOSIZE;
  636. LPNMRBAUTOSIZE = ^tagNMRBAUTOSIZE;
  637. _RB_HITTESTINFO = record
  638. pt : POINT;
  639. flags : UINT;
  640. iBand : longint;
  641. end;
  642. RBHITTESTINFO = _RB_HITTESTINFO;
  643. LPRBHITTESTINFO = ^_RB_HITTESTINFO;
  644. tagCOMMANDBANDSRESTOREINFO = record
  645. cbSize : UINT;
  646. wID : UINT;
  647. fStyle : UINT;
  648. cxRestored : UINT;
  649. fMaximized : BOOL;
  650. end;
  651. COMMANDBANDSRESTOREINFO = tagCOMMANDBANDSRESTOREINFO;
  652. LPCOMMANDBANDSRESTOREINFO = ^tagCOMMANDBANDSRESTOREINFO;
  653. LPCCOMMANDBANDSRESTOREINFO = COMMANDBANDSRESTOREINFO;
  654. //*****************************************************************************
  655. // functions
  656. //*****************************************************************************
  657. function CreatePropertySheetPage(lppsp:LPCPROPSHEETPAGE):HPROPSHEETPAGE; external ComctlDLL name 'CreatePropertySheetPageW';
  658. function CreatePropertySheetPageW(lppsp:LPCPROPSHEETPAGE):HPROPSHEETPAGE; external ComctlDLL name 'CreatePropertySheetPageW';
  659. function CreateStatusWindow(style:LONG; lpszText:LPCWSTR; hwndParent:HWND; wID:UINT):HWND; external ComctlDll name 'CreateStatusWindowW';
  660. function CreateStatusWindowW(style:LONG; lpszText:LPCWSTR; hwndParent:HWND; wID:UINT):HWND; external ComctlDll name 'CreateStatusWindowW';
  661. function CreateToolbarEx(hwnd:HWND; ws:DWORD; wID:UINT; nBitmaps:longint; hBMInst:HINST;wBMID:UINT; lpButtons:LPCTBBUTTON; iNumButtons:longint; dxButton:longint; dyButton:longint;dxBitmap:longint;
  662. dyBitmap:longint; uStructSize:UINT):HWND; external ComctlDLL name 'CreateToolbarEx';
  663. function CreateUpDownControl(dwStyle:DWORD; x:longint; y:longint; cx:longint; cy:longint;hParent:HWND; nID:longint; hInst:HINST; hBuddy:HWND; nUpper:longint;nLower:longint; nPos:longint):HWND; external ComctlDLL name 'CreateUpDownControl';
  664. function DestroyPropertySheetPage(hPSPage:HPROPSHEETPAGE):WINBOOL; external ComctlDLL name 'DestroyPropertySheetPage';
  665. procedure DrawStatusText(hDC:HDC; lprc:LPRECT; pszText:LPCWSTR; uFlags:UINT); external ComctlDLL name 'DrawStatusTextW';
  666. procedure DrawStatusTextW(hDC:HDC; lprc:LPRECT; pszText:LPCWSTR; uFlags:UINT); external ComctlDLL name 'DrawStatusTextW';
  667. procedure InitCommonControls; external ComctlDLL name 'InitCommonControls';
  668. function InitCommonControlsEx(_para1:LPINITCOMMONCONTROLSEX):WINBOOL; external ComctlDLL name 'InitCommonControlsEx';
  669. function PropertySheet(lppsph:LPCPROPSHEETHEADER):longint; external ComctlDll name 'PropertySheetW';
  670. function PropertySheetW(lppsph:LPCPROPSHEETHEADER):longint; external ComctlDll name 'PropertySheetW';
  671. function CommandBands_AddAdornments(hwndCmdBands:HWND; hinst:THandle; dwFlags:DWORD; prbbi:LPREBARBANDINFO):BOOL;external ComctlDll name 'CommandBands_AddAdornments';
  672. function CommandBands_AddBands(hwndCmdBands:HWND; hinst:THandle; cBands:UINT; prbbi:LPREBARBANDINFO):BOOL;external ComctlDll name 'CommandBands_AddBands';
  673. function CommandBands_Create(hinst:THandle; hwndParent:HWND; wID:UINT; dwStyles:DWORD; himl:HIMAGELIST):HWND;external ComctlDll name 'CommandBands_Create';
  674. function CommandBands_GetCommandBar(hwndCmdBands:HWND; uBand:UINT):HWND;external ComctlDll name 'CommandBands_GetCommandBar';
  675. function CommandBands_GetRestoreInformation(hwndCmdBands:HWND; uBand:UINT; pcbri:LPCOMMANDBANDSRESTOREINFO):BOOL;external ComctlDll name 'CommandBands_GetRestoreInformation';
  676. function CommandBands_Show(hwndCmdBands:HWND; fShow:BOOL):BOOL;external ComctlDll name 'CommandBands_Show';
  677. function CommandBar_AddAdornments(hwndCB:HWND; dwFlags:DWORD; dwReserved:DWORD):BOOL;external ComctlDll name 'CommandBar_AddAdornments';
  678. function CommandBar_AddBitmap(hwndCB:HWND; hInst:THandle; idBitmap:longint; iNumImages:longint; iImageWidth:longint; iImageHeight:longint):longint;external ComctlDll name 'CommandBar_AddBitmap';
  679. function CommandBar_Create(hInst:THandle; hwndParent:HWND; idCmdBar:longint):HWND;external ComctlDll name 'CommandBar_Create';
  680. function CommandBar_DrawMenuBar(hwndCB:HWND; iButton:WORD):BOOL;external ComctlDll name 'CommandBar_DrawMenuBar';
  681. function CommandBar_GetMenu(hwndCB:HWND; iButton:WORD):HMENU;external ComctlDll name 'CommandBar_GetMenu';
  682. function CommandBar_Height(hwndCB:HWND):longint;external ComctlDll name 'CommandBar_Height';
  683. function CommandBar_InsertComboBox(hwndCB:HWND; THandle:THandle; iWidth:longint; dwStyle:UINT; idComboBox:WORD; iButton:WORD):HWND;external ComctlDll name 'CommandBar_InsertComboBox';
  684. function CommandBar_InsertMenubar(hwndCB:HWND; hInst:THandle; idMenu:WORD; iButton:WORD):BOOL;external ComctlDll name 'CommandBar_InsertMenubar';
  685. function CommandBar_InsertMenubarEx(hwndCB:HWND; hinst:THandle; pszMenu:LPTSTR; iButton:WORD):BOOL;external ComctlDll name 'CommandBar_InsertMenubarEx';
  686. function CommandBar_Show(hwndCB:HWND; fShow:BOOL):BOOL;external ComctlDll name 'CommandBar_Show';
  687. function IsCommandBarMessage(hwndCB:HWND; lpMsg:LPMSG):BOOL;external ComctlDll name 'IsCommandBarMessage';
  688. procedure CommandBar_Destroy(hwndCB : HWND);
  689. function CommandBar_IsVisible(hwndCB : HWND) : BOOL;
  690. function CommandBar_AddButtons(hwndCB : HWND; cbButtons : UINT; lpButtons : LPTBBUTTON) : BOOL;
  691. function CommandBar_InsertButton(hwndCB : HWND; iButton : longint; lpButton : LPTBBUTTON) : BOOL;
  692. function CommandBar_AddToolTips(hwndCB: HWND; cbToolTips : UINT; lpToolTipsStrings : LPTSTR) : BOOL;
  693. function CommandBands_Height(hwndCmdBands : HWND) : UINT;
  694. function CommandBands_IsVisible(hwndCmdBands : HWND) : BOOL;
  695. implementation
  696. procedure CommandBar_Destroy(hwndCB : HWND);
  697. begin
  698. DestroyWindow(hwndCB);
  699. end;
  700. function CommandBar_IsVisible(hwndCB : HWND) : BOOL;
  701. begin
  702. CommandBar_IsVisible:=IsWindowVisible(hwndCB);
  703. end;
  704. function CommandBar_AddButtons(hwndCB : HWND; cbButtons : UINT; lpButtons : LPTBBUTTON) : BOOL;
  705. begin
  706. CommandBar_AddButtons:=BOOL(SendMessage(hwndCB,TB_ADDBUTTONS,WPARAM(cbButtons),LPARAM(lpButtons)));
  707. end;
  708. function CommandBar_InsertButton(hwndCB : HWND; iButton : longint; lpButton : LPTBBUTTON) : BOOL;
  709. begin
  710. CommandBar_InsertButton:=BOOL(SendMessage(hwndCB,TB_INSERTBUTTON,WPARAM(iButton),LPARAM(lpButton)));
  711. end;
  712. function CommandBar_AddToolTips(hwndCB: HWND; cbToolTips : UINT; lpToolTipsStrings : LPTSTR) : BOOL;
  713. begin
  714. CommandBar_AddToolTips:=BOOL(SendMessage(hwndCB,TB_SETTOOLTIPS,WPARAM(cbToolTips),LPARAM(lpToolTipsStrings)));
  715. end;
  716. function CommandBands_Height(hwndCmdBands : HWND) : UINT;
  717. begin
  718. CommandBands_Height:=UINT(SendMessage(hwndCmdBands,RB_GETBARHEIGHT,0,0));
  719. end;
  720. function CommandBands_IsVisible(hwndCmdBands : HWND) : BOOL;
  721. begin
  722. CommandBands_IsVisible:=IsWindowVisible(hwndCmdBands);
  723. end;
  724. end.