ml_ipc_0313.h 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852
  1. #ifndef NULLOSFT_MEDIALIBRARY_IPC_EXTENSION_HEADER_0x0313
  2. #define NULLOSFT_MEDIALIBRARY_IPC_EXTENSION_HEADER_0x0313
  3. #include <wtypes.h>
  4. ////////////////////////////////////////////////////////////////////
  5. // Notifications
  6. //
  7. //
  8. #define ML_MSG_NAVIGATION_FIRST 0x106 // base
  9. #define ML_MSG_NAVIGATION_ONMOVE (ML_MSG_NAVIGATION_FIRST + 1) // Notifies that item was moved.
  10. // param1 = item handle. param2 - item old sort order, param3 - item new sort order
  11. // Return value ignored.
  12. #define ML_MSG_NAVIGATION_ONDELETE (ML_MSG_NAVIGATION_FIRST + 2) // Notifies that item is being deleted.
  13. // param1 = item handle.
  14. // Return value ignored.
  15. #define ML_MSG_NAVIGATION_ONBEGINTITLEEDIT (ML_MSG_NAVIGATION_FIRST + 3) // Notifies about the start of title editing for an item.
  16. // param1 = item handle.
  17. // Return TRUE to cancel title editing.
  18. #define ML_MSG_NAVIGATION_ONENDTITLEEDIT (ML_MSG_NAVIGATION_FIRST + 4) // Notifies about the end of title editing for an item.
  19. // param1 = item handle, param2 = (LPCWSTR)pszNewTitle.
  20. // Return TRUE to accept new title. if (NULL == pszNewText) editing was canceled and return value ignored.
  21. #define ML_MSG_NAVIGATION_ONCUSTOMDRAW (ML_MSG_NAVIGATION_FIRST + 5) // Perform custom draw here.
  22. // param1 = item handle, param2 = (NAVITEMDRAW*)pnicd, param3 = (LPARAM)lParam.
  23. // Return combination of the NICDRF_XXX flags.
  24. #define ML_MSG_NAVIGATION_ONHITTEST (ML_MSG_NAVIGATION_FIRST + 6) // Perform custom hit test
  25. // param1 = item handle, param2 = (NAVHITTEST*)pnavHitTest, param3 = (LPARAM)lParam.
  26. // Return non zero if you handle it.
  27. #define ML_MSG_NAVIGATION_ONSETCURSOR (ML_MSG_NAVIGATION_FIRST + 7) // Set cursor.
  28. // param1 = item handle, param2 = 0, param3 = (LPARAM)lParam.
  29. // Return 1 if you proccessed this messeage and set cursor, -1 if you want default processing, 0 - if not yours.
  30. #define ML_MSG_NAVIGATION_ONDESTROY (ML_MSG_NAVIGATION_FIRST + 8) // Notifies that navigation control about to be destroyed.
  31. // param1 = not used, param2 = not used, param3 = not used.
  32. // Return value ignored.
  33. #define ML_MSG_NAVIGATION_CONTEXTMENU (ML_MSG_NAVIGATION_FIRST + 9) // Notifies that context menu was requested for the item
  34. // param1 = item handle, param2 = (HWND)hHost, param3 = (POINTS)cursor
  35. // Return non zero if you handle it.
  36. #define ML_MSG_NAVIGATION_HELP (ML_MSG_NAVIGATION_FIRST + 10) // Notifies that help was requested for the item
  37. // param1 = item handle, param2 = (HWND)hHost, param3 = (POINTS)cursor
  38. // Return non zero if you handle it.
  39. #define ML_MSG_MLVISIBLE 0x410 // Notifies that Media Library Window changed visible state.
  40. // param1 = (BOOL)fVisible, param2 = Not used, param3 = Not used.
  41. // Return value ignored. (Return zero).
  42. /////////////////////////////////////////////////////////////////////
  43. // Drag&Drop for outsiders <<< will be discontinued at some point >>>
  44. //
  45. #define WAMLM_DRAGDROP L"WaMediaLibraryDragDrop" // use RegisterWindowMessage
  46. // values for wParam
  47. #define DRAGDROP_DRAGENTER 0 // lParam = (LPARAM)(mlDropItemStruct*)pdis. return TRUE if you accepted this message.
  48. #define DRAGDROP_DRAGLEAVE 1 // lParam = not used. Return: nothing.
  49. #define DRAGDROP_DRAGOVER 2 // lParam = (LPARAM)(mlDropItemStruct*)pdis. Return: nothing.
  50. #define DRAGDROP_DROP 3 // (LPARAM)(mlDropItemStruct*)pdis. Return: nothing.
  51. ////////////////////////////////////////////////////////////////////
  52. // IPC
  53. //
  54. #ifdef __cplusplus
  55. #define SENDMSG(__hwnd, __msgId, __wParam, __lParam) ::SendMessageW((__hwnd), (__msgId), (__wParam), (__lParam))
  56. #else
  57. #define SENDMSG(__hwnd, __msgId, __wParam, __lParam) SendMessageW((__hwnd), (__msgId), (__wParam), (__lParam))
  58. #endif // __cplusplus
  59. #define SENDMLIPC(__hwndML, __ipcMsgId, __param) SENDMSG((__hwndML), WM_ML_IPC, (WPARAM)(__param), (LPARAM)(__ipcMsgId))
  60. #define SENDWAIPC(__hwndWA, __ipcMsgId, __param) SENDMSG((__hwndWA), WM_WA_IPC, (WPARAM)(__param), (LPARAM)(__ipcMsgId))
  61. /////////////////////////////////////////////////////////////////
  62. // Getting MediaLibrary (gen_ml) version
  63. // if version is less then 3.13 return value will be 0.
  64. // Build types
  65. #define ML_BUILDTYPE_FINAL 0x0000
  66. #define ML_BUILDTYPE_BETA 0x0001
  67. #define ML_BUILDTYPE_NIGHTLY 0x0002
  68. // Message
  69. #define ML_IPC_GETVERSION 0x0000L // Returns DWORD where LOWORD contains version number and HIWORD - build type . param is ignored.
  70. #define GetMLVersion(/*HWND*/ hwndML) (DWORD)SENDMLIPC(hwndML, ML_IPC_GETVERSION, 0)
  71. #define ML_IPC_SHOW_HELP (0x1200L - 1) // Shows Help. param = (const wchar_t*)helpUrl, Returns TRUE on SUCCESS.
  72. #define MediaLibrary_ShowHelp(/*HWND*/ _hwndML, /* const wchar_t* */ _helpUrl)\
  73. ((BOOL)SENDMLIPC((_hwndML), ML_IPC_SHOW_HELP, (WPARAM)(_helpUrl)))
  74. //////////////////////////////////////////////////////////////////
  75. // MLImageLoader
  76. //
  77. //
  78. //
  79. /// Structs
  80. typedef struct _MLIMAGESOURCE
  81. {
  82. INT cbSize; // sizeof(MLIMAGESOURCE)
  83. HINSTANCE hInst; //
  84. LPCWSTR lpszName; //
  85. UINT bpp; //
  86. INT xSrc; //
  87. INT ySrc; //
  88. INT cxSrc; //
  89. INT cySrc; //
  90. INT cxDst; //
  91. INT cyDst; //
  92. UINT type; //
  93. UINT flags; //
  94. } MLIMAGESOURCE;
  95. // Image Source types:
  96. #define SRC_TYPE_BMP 0x01 // hInst = depends on ISF_LOADFROMFILE, lpszName = resource (file) name. To make resource name from resource id use MAKEINTERESOURCEW().
  97. #define SRC_TYPE_PNG 0x02 // hInst = depends on ISF_LOADFROMFILE, lpszName = resource (file) name. To make resource name from resource id use MAKEINTERESOURCEW().
  98. #define SRC_TYPE_HBITMAP 0x03 // hInst = NULL, lpszName =(HBITMAP)hbmp.
  99. #define SRC_TYPE_HIMAGELIST 0x04 // hInst = (HIMAGELIST)himl, lpszName = MAKEINTERESOURCEW(index). Make Sure that common controls initialized before using this.
  100. // Image Source flags:
  101. #define ISF_LOADFROMFILE 0x0001 // Load image from file. hInst ignored.
  102. #define ISF_USE_OFFSET 0x0002 // xSrc and ySrc valid.
  103. #define ISF_USE_SIZE 0x0004 // cxSrc and cySrc valid.
  104. #define ISF_FORCE_BPP 0x0010 //
  105. #define ISF_FORCE_SIZE 0x0020 //
  106. #define ISF_SCALE 0x0040 //
  107. #define ISF_PREMULTIPLY 0x0100 // supported only by png
  108. #define ISF_NOLOCALIZED_LOAD 0x0200 // when loading res:// protocol do not try to load resource from localized resource first
  109. // use with ML_IPC_IMAGESOURCE_COPYSTRUCT
  110. typedef struct _MLIMAGESOURCECOPY
  111. {
  112. MLIMAGESOURCE *src; // pointer to the source struct
  113. MLIMAGESOURCE *dest; // pointer to the destination struct
  114. } MLIMAGESOURCECOPY;
  115. // Messages
  116. #define ML_IPC_IMAGELOADER_FIRST 0x1200L
  117. #define ML_IPC_IMAGELOADER_LOADDIB (ML_IPC_IMAGELOADER_FIRST + 1) // Loads Dib from source. param = (MLIMAGESOURCE*)pmlis;
  118. #define ML_IPC_IMAGELOADER_COPYSTRUCT (ML_IPC_IMAGELOADER_FIRST + 2) // Creates copy of image source struct. Use ML_IPC_IMAGESOURCE_FREESTRUCT to free copy data. Returns TRUE if success. param = (MLIMAGESOURCECOPY*)pmlis;
  119. #define ML_IPC_IMAGELOADER_FREESTRUCT (ML_IPC_IMAGELOADER_FIRST + 3) // Use it to free MLIMAGESOURCE that was filled using ML_IPC_IMAGESOURCE_COPYSTRUCT. Returns TRUE if sucess. param = (MLIMAGESOURCE*)pmlis;
  120. #define ML_IPC_IMAGELOADER_CHECKEXIST (ML_IPC_IMAGELOADER_FIRST + 4) // Performs simple checks to validate source. Returns TRUE if sucess. param = (MLIMAGESOURCE*)pmlis;
  121. // Macros
  122. #define MLImageLoader_LoadDib(/*HWND*/ hwndML, /*MLIMAGESOURCE**/ pmlisStruct) \
  123. (HBITMAP)SENDMLIPC((hwndML), ML_IPC_IMAGELOADER_LOADDIB, (WPARAM)(pmlisStruct))
  124. #define MLImageLoader_CopyStruct(/*HWND*/ hwndML, /*MLIMAGESOURCECOPY**/ pmlisCopyStrust) \
  125. ((BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELOADER_COPYSTRUCT, (WPARAM)(pmlisCopyStrust)))
  126. #define MLImageLoader_FreeStruct(/*HWND*/ hwndML, /*MLIMAGESOURCE*/ pmlisStruct) \
  127. ((BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELOADER_FREESTRUCT, (WPARAM)(pmlisStruct)))
  128. #define MLImageLoader_CheckExist(/*HWND*/ hwndML, /*MLIMAGESOURCE**/ pmlisStruct) \
  129. ((BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELOADER_CHECKEXIST, (WPARAM)(pmlisStruct)))
  130. //////////////////////////////////////////////////////////////////////////////
  131. // MLImageFilter
  132. //
  133. //
  134. //
  135. // Filter callback
  136. typedef BOOL (CALLBACK *MLIMAGEFILTERPROC)(LPBYTE /*pData*/, LONG /*cx*/, LONG /*cy*/, INT /*bpp*/, COLORREF /*rgbBk*/,
  137. COLORREF /*rgbFg*/, INT_PTR /*imageTag*/, LPARAM /*lParam*/);
  138. typedef struct _MLIMAGEFILTERINFO
  139. {
  140. INT cbSize; // sizeof(MLIMAGEFILTERINFO)
  141. UINT mask; // mask
  142. GUID uid; // filterUID
  143. MLIMAGEFILTERPROC fnProc; // procedure to call
  144. LPARAM lParam; // user parameter ( will be passed to every call of filter proc)
  145. UINT fFlags; // filter flags
  146. LPWSTR pszTitle; // filter title
  147. INT cchTitleMax; // max title size (only for get info)
  148. } MLIMAGEFILTERINFO;
  149. typedef struct _MLIMAGEFILTERAPPLYEX
  150. {
  151. INT cbSize;
  152. GUID filterUID; // Filter to use.
  153. LPBYTE pData; // Pointer to dib data.
  154. LONG cx; // Image width in pixels.
  155. LONG cy; // Image height in pixels.
  156. INT bpp; // Bits per pixel
  157. COLORREF rgbBk; // Back color to use
  158. COLORREF rgbFg; // Front color to use
  159. INT_PTR imageTag; // Image tag. will be passed to the filter
  160. } MLIMAGEFILTERAPPLYEX;
  161. // filter flags
  162. #define MLIFF_IGNORE_BKCOLOR 0x0001 // Filter result doesn't depend on rgbBk.
  163. #define MLIFF_IGNORE_FGCOLOR 0x0002 // Filter result doesn't depend on rgbFg.
  164. // mask used to set/get filter info
  165. #define MLIFF_TITLE 0x0001 //
  166. #define MLIFF_PARAM 0x0002 //
  167. #define MLIFF_FLAGS 0x0004 //
  168. #define MLIFF_PROC 0x0008 //
  169. // Messages
  170. #define ML_IPC_IMAGEFILTER_FIRST 0x1240L
  171. #define ML_IPC_IMAGEFILTER_REGISTER (ML_IPC_IMAGEFILTER_FIRST + 1) // Registers filter in ml. param = (MLIMAGEFILTERINFO*)pmlif. uid and proc must be always set. Returns TRUE on success.
  172. #define ML_IPC_IMAGEFILTER_UNREGISTER (ML_IPC_IMAGEFILTER_FIRST + 2) // Unregisters filter. param = (const GUID*)filterUID. Returns TRUE on success.
  173. #define ML_IPC_IMAGEFILTER_GETINFO (ML_IPC_IMAGEFILTER_FIRST + 3) // Get fitler info. param = (MLIMAGEFILTERINFO*)pmlif. set mask to whatever you wnat to get. set uid to filterUID. Returnd TRUE on success
  174. #define ML_IPC_IMAGEFILTER_APPLYEX (ML_IPC_IMAGEFILTER_FIRST + 4) // Apply Filter. param = (MLIMAGEFILTERAPPLYEX)pmlif. Runs Filter over image. Returns TRUE if ok.
  175. // Macros
  176. #define MLImageFilter_Register(/*HWND*/ hwndML, /*MLIMAGEFILTERINFO**/ pmlifInfo) \
  177. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGEFILTER_REGISTER, (WPARAM)(pmlifInfo))
  178. #define MLImageFilter_Unregister(/*HWND*/ hwndML, /*const GUID**/ filterUID) \
  179. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGEFILTER_UNREGISTER, (WPARAM)(filterUID))
  180. #define MLImageFilter_GetInfo(/*HWND*/ hwndML, /*MLIMAGEFILTERINFO**/ pmlifInfo) \
  181. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGEFILTER_GETINFO, (WPARAM)(pmlifInfo))
  182. #define MLImageFilter_ApplyEx(/*HWND*/ hwndML, /*MLIMAGEFILTERAPPLY**/ pmlifApply) \
  183. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGEFILTER_APPLYEX, (WPARAM)(pmlifApply))
  184. /// Default Filters
  185. #ifdef __cplusplus
  186. extern "C" {
  187. #endif // __cplusplus
  188. extern const GUID MLIF_FILTER1_UID; // {8A054D1F-E38E-4cc0-A78A-F216F059F57E}
  189. extern const GUID MLIF_FILTER2_UID; // {BE1A6A40-39D1-4cfb-8C33-D8988E8DD2F8}
  190. extern const GUID MLIF_FILTER3_UID; // {721E9E62-CC6D-4fd7-A6ED-DD4CD2B2612E}
  191. extern const GUID MLIF_GRAYSCALE_UID; // {B6310C20-E731-44dd-83BD-FBC3349798F2}
  192. extern const GUID MLIF_BLENDONBK_UID; // {526C6F4A-C979-4d6a-B8ED-1A90F5A26F7B}
  193. extern const GUID MLIF_BUTTONBLEND_UID; // {E61C5E67-B2CC-4f89-9C95-40D18FCAF1F8}
  194. extern const GUID MLIF_BUTTONBLENDPLUSCOLOR_UID; // {3619BA52-5088-4f21-9AF1-C5FCFE5AAA99}
  195. extern const GUID MLIF_FILTER1_PRESERVE_ALPHA_UID; // {F1DD3228-7DA8-4524-B7D3-46F651BFB680}
  196. #ifdef __cplusplus
  197. }
  198. #endif // __cplusplus
  199. //////////////////////////////////////////////////////////////////////////////
  200. // MLImageList
  201. //
  202. //
  203. //
  204. typedef LPVOID HMLIMGLST;
  205. // Used with ML_IPC_IMAGELIST_CREATE
  206. typedef struct _MLIMAGELISTCREATE
  207. {
  208. INT cx; // image width
  209. INT cy; // image height
  210. UINT flags; // see MLIMAGELISTCREATE flags
  211. INT cInitial; // initial size
  212. INT cGrow; // realloc step
  213. INT cCacheSize; // how many colors can be cached for each entry
  214. }MLIMAGELISTCREATE;
  215. // MLIMAGELISTCREATE flags
  216. #define MLILC_COLOR24 0x00000018 // Use a 24-bit DIB section.
  217. #define MLILC_COLOR32 0x00000020 // Use a 32-bit DIB section.
  218. #define MLILC_MASK 0x00000001 // Creates underlying HIMAGELIST with mask parameter.
  219. // Used with ML_IPC_IMAGELIST_GETREALINDEX
  220. typedef struct _MLIMAGELISTREALINDEX
  221. {
  222. INT cbSize; // sizeof(MLIMAGELISTREALINDEX)
  223. HMLIMGLST hmlil; // MLImageList handle returned from ML_IPC_IMAGELIST_CREATE.
  224. INT mlilIndex; // Image index in MLImageList
  225. COLORREF rgbBk; // Requested background color.
  226. COLORREF rgbFg; // Requested foreground color.
  227. } MLIMAGELISTREALINDEX;
  228. // Used with ML_IPC_IMAGELIST_ADD, ML_IPC_IMAGELIST_REPLACE, ML_IPC_IMAGELIST_REMOVE
  229. typedef struct _MLIMAGELISTITEM
  230. {
  231. INT cbSize; // sizeof(MLIMAGELISTITEM)
  232. HMLIMGLST hmlil; // MLImageList handle returned from ML_IPC_IMAGELIST_CREATE.
  233. MLIMAGESOURCE *pmlImgSource; // handle to the MLIMAGESOURCE struct.
  234. GUID filterUID; // MLImageFilter to use. // Set to GUID_NULL if you don't wnat any filtering.
  235. INT_PTR nTag; // Tag assign to image. Note: MLImageList dosn't check if tag is unique!
  236. INT mlilIndex; // MLImageList index. This field ignored in ML_IPC_IMAGELIST_ADD.
  237. } MLIMAGELISTITEM;
  238. // Used with ML_IPC_IMAGELIST_GETIMAGESIZE
  239. typedef struct _MLIMAGELISTIMAGESIZE
  240. {
  241. HMLIMGLST hmlil; // MLImageList handle returned from ML_IPC_IMAGELIST_CREATE.
  242. INT cx; // Image width
  243. INT cy; // Image height
  244. } MLIMAGELISTIMAGESIZE;
  245. // Used with ML_IPC_IMAGELIST_GETINDEXFROMTAG and ML_IPC_IMAGELIST_GETTAGFROMINDEX
  246. typedef struct _MLIMAGELISTTAG
  247. {
  248. HMLIMGLST hmlil; // MLImageList handle returned from ML_IPC_IMAGELIST_CREATE.
  249. INT mlilIndex; // MLImageList image index. ML_IPC_IMAGELIST_GETINDEXFROMTAG will contain index if any.
  250. INT_PTR nTag; // MLImageList image tag. ML_IPC_IMAGELIST_GETTAGFROMINDEX will contain tag if any.
  251. } MLIMAGELISTTAG;
  252. #define ML_IPC_IMAGELIST_FIRST 0x1260L
  253. #define ML_IPC_IMAGELIST_CREATE (ML_IPC_IMAGELIST_FIRST + 1) // Creates new MLImageList
  254. #define ML_IPC_IMAGELIST_DESTROY (ML_IPC_IMAGELIST_FIRST + 2) // Destroys MLImageList
  255. #define ML_IPC_IMAGELIST_GETREALLIST (ML_IPC_IMAGELIST_FIRST + 3) // Returns handle to the system HIMAGELIST
  256. #define ML_IPC_IMAGELIST_GETREALINDEX (ML_IPC_IMAGELIST_FIRST + 4) // Returns image index in the HIMAGELIST if ok or -1 if error. If image with this colors is not cached yet it will be loaded and if Filter function speicified it will be Filtered
  257. // ( user param in Filter function will be set to the tag assigned to the image)
  258. #define ML_IPC_IMAGELIST_ADD (ML_IPC_IMAGELIST_FIRST + 5) // Add new item. Returns item index or -1 if failed.
  259. // When adding images IMAGESOURCE can have different bpp from imagelist. After image loaded it first filtered and than added to to the system imagelist
  260. #define ML_IPC_IMAGELIST_REPLACE (ML_IPC_IMAGELIST_FIRST + 6) // Replace existing item. Returns TRUE if ok.
  261. #define ML_IPC_IMAGELIST_REMOVE (ML_IPC_IMAGELIST_FIRST + 7) // Removes existing item. Returns TRUE if ok.
  262. #define ML_IPC_IMAGELIST_GETIMAGESIZE (ML_IPC_IMAGELIST_FIRST + 8) // Retrives size of stored images. Returns TRUE if ok.
  263. #define ML_IPC_IMAGELIST_GETIMAGECOUNT (ML_IPC_IMAGELIST_FIRST + 9) // Gets images count in MLImageList.
  264. #define ML_IPC_IMAGELIST_GETINDEXFROMTAG (ML_IPC_IMAGELIST_FIRST + 10) // Finds item with specified tag. Returns TRUE if found.
  265. #define ML_IPC_IMAGELIST_GETTAGFROMINDEX (ML_IPC_IMAGELIST_FIRST + 11) // Finds item tag by index. Returns TRUE if found.
  266. #define ML_IPC_IMAGELIST_CHECKEXIST (ML_IPC_IMAGELIST_FIRST + 12) // Performs simple checks to validate source. Returns TRUE ok.
  267. // Macros
  268. #define MLImageList_Create(/*HWND*/ hwndML, /*MLIMAGELISTCREATE**/ pmlilCreate) \
  269. (HMLIMGLST)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_CREATE, (WPARAM)(pmlilCreate))
  270. #define MLImageList_Destroy(/*HWND*/ hwndML, /*HMLIMGLST*/ hmlil) \
  271. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_DESTROY, (WPARAM)(hmlil))
  272. #define MLImageList_GetRealList(/*HWND*/ hwndML, /*HMLIMGLST*/ hmlil) \
  273. (HIMAGELIST)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_GETREALLIST, (WPARAM)(hmlil))
  274. #define MLImageList_GetRealIndex(/*HWND*/ hwndML, /*MLIMAGELISTREALINDEX**/ pmlilRealIndex) \
  275. (INT)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_GETREALINDEX, (WPARAM)(pmlilRealIndex))
  276. #define MLImageList_Add(/*HWND*/ __hwndML, /*MLIMAGELISTITEM**/ pmlilItem) \
  277. (INT)SENDMLIPC((__hwndML), ML_IPC_IMAGELIST_ADD, (WPARAM)(pmlilItem))
  278. #define MLImageList_Add2(/*HWND*/ __hwndML, /*HMLIMGLST*/ __hmlil, /*GUID*/ __filterUID, /*MLIMAGESOURCE* */__pmlis, /*INT_PTR*/ __nTag) \
  279. { MLIMAGELISTITEM mli;\
  280. mli.cbSize = sizeof(MLIMAGELISTITEM);\
  281. mli.hmlil = (__hmlil);\
  282. mli.filterUID = (__filterUID);\
  283. mli.pmlImgSource = (__pmlis);\
  284. mli.nTag = (__nTag);\
  285. ((INT)SENDMLIPC((__hwndML), ML_IPC_IMAGELIST_ADD, (WPARAM)(&mli)));}
  286. #define MLImageList_Replace(/*HWND*/ hwndML, /*MLIMAGELISTITEM**/ pmlilItem) \
  287. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_REPLACE, (WPARAM)(pmlilItem))
  288. #define MLImageList_Remove(/*HWND*/ hwndML, /*MLIMAGELISTITEM**/ pmlilItem) \
  289. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_REMOVE, (WPARAM)(pmlilItem))
  290. #define MLImageList_GetImageSize(/*HWND*/ hwndML, /*MLIMAGELISTIMAGESIZE**/ pmlilImageSize) \
  291. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_GETIMAGESIZE, (WPARAM)(pmlilImageSize))
  292. #define MLImageList_GetImageCount(/*HWND*/ hwndML, /*HMLIMGLST*/ hmlil) \
  293. (INT)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_GETIMAGECOUNT, (WPARAM)(hmlil))
  294. #define MLImageList_GetIndexFromTag(/*HWND*/ hwndML, /*MLIMAGELISTTAG**/ pmlilTag)\
  295. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_GETINDEXFROMTAG, (WPARAM)(pmlilTag))
  296. #define MLImageList_GetTagFromIndex(/*HWND*/ hwndML, /*MLIMAGELISTTAG**/ pmlilTag)\
  297. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_GETTAGFROMINDEX, (WPARAM)(pmlilTag))
  298. #define MLImageList_CheckItemExist(/*HWND*/ hwndML, /*MLIMAGELISTITEM**/ pmlilItem)\
  299. (BOOL)SENDMLIPC((hwndML), ML_IPC_IMAGELIST_CHECKEXIST, (WPARAM)(pmlilItem))
  300. //////////////////////////////////////////////////////////////////////////////
  301. // MLNavigation
  302. // Navigation Control & Items
  303. //
  304. //
  305. typedef LPVOID HNAVCTRL;
  306. typedef LPVOID HNAVITEM;
  307. // Structs
  308. // Navigation Item Info
  309. typedef struct _NAVITEM
  310. {
  311. INT cbSize; // Always set to sizeof(NAVITEM).
  312. HNAVITEM hItem; // handle to the item (must be set for ML_IPC_NAVITEM_GETINFO and ML_IPC_NAVITEM_SETINFO)
  313. UINT mask; // Mask valid values.
  314. INT id; // Item id.
  315. LPWSTR pszText; // Text to display.
  316. INT cchTextMax; // Text buffer length (used to GET item info).
  317. LPWSTR pszInvariant; // Invariant text name. Any unique string you can assign to the item that will not change.
  318. // For expample if item can be renamed by user invariat text will stay the same and can be used to save/load item state and position.
  319. INT cchInvariantMax; // Invariant text buffer size ( used to GET item info).
  320. INT iImage; // Image index. This is image index in the MLImageList assigned to the Navigation control. If you want to use default images set index to -1
  321. INT iSelectedImage; // Selected image index. This is image index in the MLImageList assigned to the Navigation control.
  322. // You need/want to assign selected image index only if you want to display different image on selection.
  323. UINT state; // Item state.
  324. UINT stateMask; // Item state mask.
  325. UINT style; // Item style.
  326. UINT styleMask; // Item style mask.
  327. HFONT hFont; // Item font. You can set this if you want item to use special font. You are responsible about free font object. If you want item to use default font set hFont to NULL.
  328. LPARAM lParam; // User parameter. You can use it as you want.
  329. } NAVITEM;
  330. typedef struct _NAVINSERTSTRUCT
  331. {
  332. HNAVITEM hParent; // Parent Item (NULL to insert in the root).
  333. HNAVITEM hInsertAfter; // insert after item. You can use NCI_FIRST or NCI_LAST or you can use MAKE_NAVITEMSORTORDER to specify order index instead.
  334. NAVITEM item;
  335. } NAVINSERTSTRUCT;
  336. typedef struct _NAVITEMDRAW
  337. {
  338. HDC hdc; // Handle to the DC.
  339. COLORREF clrText; // Text Fore color
  340. COLORREF clrTextBk; // Text Back color.
  341. HFONT hFont; // Handle to the selected font.
  342. RECT *prc; // pointer to the item rect.
  343. UINT itemState; // NIIS_XXX
  344. UINT drawStage; // NIDS_XXX
  345. INT iLevel; // Zero-based level of the item being drawn.
  346. } NAVITEMDRAW;
  347. // ML_IPC_NAVCTRL_ENUMITEMS callback
  348. typedef BOOL (CALLBACK *NAVENUMPROC)(HNAVITEM /*hItem*/, LPARAM /*lParam*/); // Return FALSE to stop enumeration
  349. // Use it to enumerate navigation items with ML_IPC_NAVCTRL_ENUMITEMS
  350. typedef struct _NAVCTRLENUMPARAMS
  351. {
  352. NAVENUMPROC enumProc; // Enum proc..
  353. HNAVITEM hItemStart; // Item to start enumeration from. If hItemStar == NULL enumeration will start from the root.
  354. LPARAM lParam; // User value
  355. } NAVCTRLENUMPARAMS;
  356. /// Find by name prarams (ML_IPC_NAVCTRL_FINDBYNAME)
  357. typedef struct _NAVCTRLFINDPARAMS
  358. {
  359. LCID Locale; // Locale to use. Note: when searching using invariant name locale forced to invariant and case ignored.
  360. UINT compFlags; // Name compare flags (NCCF_XXX).
  361. LPWSTR pszName; // Name to look for.
  362. INT cchLength; // Name length (can be -1).
  363. BOOL fFullNameSearch; // Perform full name search.
  364. BOOL fAncestorOk; // When performing full name search if fAncestorOk is set and item with this name not exist - will fall back to closest ancestor
  365. } NAVCTRLFINDPARAMS;
  366. // Perform hit test
  367. typedef struct _NAVHITTEST
  368. {
  369. POINT pt; // [in] Point in control coordinates.
  370. UINT flags; // [out] Test result flags
  371. HNAVITEM hItem; // [out] Navigation Item at this point if any.
  372. } NAVHITTEST;
  373. // used to send item epxnd command ML_IPC_NAVITEM_EXPAND
  374. typedef struct _NAVITEMEXPAND
  375. {
  376. HNAVITEM hItem; // handle to the item
  377. UINT fCmdExpand; // command to execute (NAITEM_TOGGLE/ NAITEM_EXOPAND/NAITEM_COLLAPSE).
  378. } NAVITEMEXPAND;
  379. // used to get fullitem name via ML_IPC_NAVITEM_GETFULLNAME
  380. typedef struct _NAVITEMFULLNAME
  381. {
  382. HNAVITEM hItem; // Handle to the item.
  383. LPWSTR pszText; // Buffer that will recive full name.
  384. INT cchTextMax; // Maximum amount of characters that can be wirtten to buffer.
  385. } NAVITEMFULLNAME;
  386. // ML_IPC_NAVITEM_GETRECT
  387. typedef struct _NAVITEMGETRECT
  388. {
  389. HNAVITEM hItem; // [in] Handle to the item.
  390. RECT rc; // [out] Bounding rectangle.
  391. BOOL fItem; // [in] If this parameter is TRUE, the bounding rectangle includes only the text of the item. Otherwise, it includes the entire line that the item occupies in the navigation control.
  392. } NAVITEMGETRECT;
  393. typedef struct _NAVITEMINAVLIDATE
  394. {
  395. HNAVITEM hItem; // [in] Handle to the item.
  396. RECT *prc; // [in] If this parameter is set specifies portion of item to invalidate in control coordinates. if it is NULL whole item will be invalidated
  397. BOOL fErase; // [in] If TRUE background will be erased.
  398. } NAVITEMINAVLIDATE;
  399. //ML_IPC_NAVITEM_MOVE
  400. typedef struct _NAVITEMMOVE
  401. {
  402. HNAVITEM hItem; // [in] Handle to the item that need to be moved.
  403. HNAVITEM hItemDest; // [in] Handle to the item where to move.
  404. BOOL fAfter; // [in] If set to TRUE hItem will be moved after hItemDest.
  405. } NAVITEMMOVE;
  406. typedef struct _NAVITEMORDER
  407. {
  408. HNAVITEM hItem; // Handle to the item that need to be moved.
  409. WORD order; // Minimal order value 1.
  410. UINT flags; // Flags one of the NOF_XXX
  411. } NAVITEMORDER;
  412. // Nav control styles
  413. #define NCS_NORMAL 0x0000
  414. #define NCS_FULLROWSELECT 0x0001
  415. #define NCS_SHOWICONS 0x0002
  416. // NAVITEM mask flags. if mask set filed considered to be valid
  417. #define NIMF_ITEMID 0x0001
  418. #define NIMF_TEXT 0x0002
  419. #define NIMF_TEXTINVARIANT 0x0004
  420. #define NIMF_IMAGE 0x0008
  421. #define NIMF_IMAGESEL 0x0010
  422. #define NIMF_STATE 0x0020
  423. #define NIMF_STYLE 0x0040
  424. #define NIMF_FONT 0x0080
  425. #define NIMF_PARAM 0x0100
  426. // NAVITEM states.
  427. #define NIS_NORMAL 0x0000
  428. #define NIS_SELECTED 0x0001
  429. #define NIS_EXPANDED 0x0002
  430. #define NIS_DROPHILITED 0x0004
  431. #define NIS_FOCUSED 0x0008 // used with draw item
  432. // NAVITEM styles
  433. #define NIS_HASCHILDREN 0x0001 // item has children
  434. #define NIS_ALLOWCHILDMOVE 0x0002 // allow children to be moved (re-ordered)
  435. #define NIS_ALLOWEDIT 0x0004 // allow title edit
  436. #define NIS_ITALIC 0x0100 // when displaying item text draw it with italic style
  437. #define NIS_BOLD 0x0200 // when displaying item text draw it with bold style
  438. #define NIS_UNDERLINE 0x0400 // when displaying item text draw it with underline style
  439. #define NIS_CUSTOMDRAW 0x0010 // use ML_MSG_NAVIGATION_ONCUSTOMDRAW
  440. #define NIS_WANTSETCURSOR 0x0020 // item want to recive set cursor notification
  441. #define NIS_WANTHITTEST 0x0040 // item want to monitor/modify hittest results
  442. #define NIS_DEFAULTIMAGE 0x0080 // navigation control will ignore iImage and iSelectedImage
  443. // NAVITEMINSERT hInsertAfter flags
  444. #define NCI_FIRST ((HNAVITEM)(ULONG_PTR)-0x0FFFF) // insert first item
  445. #define NCI_LAST ((HNAVITEM)(ULONG_PTR)-0x00000) // insert as last item
  446. // BeginUpdate Lock flags
  447. #define NUF_LOCK_NONE 0x00 // Do not lock...
  448. #define NUF_LOCK_SELECTED 0x01 // Lock selected item position.
  449. #define NUF_LOCK_TOP 0x02 // Lock top item position
  450. // Name compare flags
  451. #define NICF_DISPLAY 0x0001 // Compare display name (if specified in combination with othe flags will be used last).
  452. #define NICF_INVARIANT 0x0002 // Compare invariant name (if specified in combination with DISPLAY will be used first).
  453. #define NICF_IGNORECASE 0x0004 // Ignore case (always used when comparing invariant names).
  454. // Navigation control hit test result flags.
  455. #define NAVHT_NOWHERE 0x0001 //
  456. #define NAVHT_ONITEM 0x0002 //
  457. #define NAVHT_ONITEMBUTTON 0x0004 // only if item currently has children
  458. #define NAVHT_ONITEMINDENT 0x0010 //
  459. #define NAVHT_ONITEMRIGHT 0x0020 //
  460. #define NAVHT_ABOVE 0x0100 //
  461. #define NAVHT_BELOW 0x0200 //
  462. #define NAVHT_TORIGHT 0x0400 //
  463. #define NAVHT_TOLEFT 0x0800 //
  464. // item expand command flags
  465. #define NAVITEM_TOGGLE 0x0000
  466. #define NAVITEM_EXPAND 0x0001
  467. #define NAVITEM_COLLAPSE 0x0002
  468. // item drawing stages
  469. #define NIDS_PREPAINT 0x0001
  470. #define NIDS_POSTPAINT 0x0002
  471. // item custom draw return flags
  472. #define NICDRF_NOTMINE 0x0000 // It is not your item.
  473. #define NICDRF_DODEFAULT 0x0001 // Perform default drawing.
  474. #define NICDRF_SKIPDEFAULT 0x0002 // Do not perform default drawing.
  475. #define NICDRF_NOTIFYPOSTPAINT 0x0004 // You want to be called after paint.
  476. #define NICDRF_NEWFONT 0x0008 // Font changed.
  477. // Messages
  478. #define ML_IPC_NAVIGATION_FIRST 0x1280L
  479. #define ML_IPC_NAVCTRL_BEGINUPDATE (ML_IPC_NAVIGATION_FIRST + 1) // Use it to lock control updates while you managing items. param = NUF_LOCK_XXX. Do not forget to call ML_IPC_NAVCTRL_ENDUPDATE when done. Returns lock counter or -1 if error.
  480. #define ML_IPC_NAVCTRL_DELETEITEM (ML_IPC_NAVIGATION_FIRST + 2) // Delete Item. param = (WPARAM)(HNAVITEM)hItem. Return TRUE if success.
  481. #define ML_IPC_NAVCTRL_ENDEDITTITLE (ML_IPC_NAVIGATION_FIRST + 13) // Ends Title edit, param = (WPARAM)(BOOL)fCancel, if fCancel == TRUE item editing will be terminated and changes lost otherwise new title will be saved.
  482. #define ML_IPC_NAVCTRL_ENDUPDATE (ML_IPC_NAVIGATION_FIRST + 3) // Call this when you finished updating items. Returns lock counter or -1 if error. if loock reached 0 - window will be updated.
  483. #define ML_IPC_NAVCTRL_ENUMITEMS (ML_IPC_NAVIGATION_FIRST + 4) // Enumerates items in navigation control. param= (WPARAM)(NAVCTRLENUMPARAMS*)pnavEnumParams. Returns TRUE if all items was enumerated successfully.
  484. #define ML_IPC_NAVCTRL_FINDITEMBYID (ML_IPC_NAVIGATION_FIRST + 5) // Search for an item in navigation control by it's id. param = (WPARAM)(INT)id. Returns HNAVITEM on success or NULL.
  485. #define ML_IPC_NAVCTRL_FINDITEMBYNAME (ML_IPC_NAVIGATION_FIRST + 6) // Search for an item in navigation control by it's name. param = (WPARAM)(NAVCTRLFINDPARAMS)pnavFindParams. Returns HNAVITEM on success or NULL.
  486. #define ML_IPC_NAVCTRL_GETIMAGELIST (ML_IPC_NAVIGATION_FIRST + 7) // Returnrs handle to MLImageList associated with navigation control. param = (WPARAM)0. Return HMLIMGLST if success or NULL.
  487. #define ML_IPC_NAVCTRL_GETFIRST (ML_IPC_NAVIGATION_FIRST + 8) // Returns handle to first item in the navigation control. param = (WPARAM)0. Return HNAVITEM or NULL.
  488. #define ML_IPC_NAVCTRL_GETINDENT (ML_IPC_NAVIGATION_FIRST + 14) // Retrieves the amount, in pixels, that child items are indented relative to their parent items. param = (WPARAM)0.
  489. #define ML_IPC_NAVCTRL_GETSELECTION (ML_IPC_NAVIGATION_FIRST + 9) // Returns handle to selected item in the navigation control. param = (WPARAM)0. Return HNAVITEM or NULL.
  490. #define ML_IPC_NAVCTRL_GETHWND (ML_IPC_NAVIGATION_FIRST + 10) // Returns host window HWND. param = (WPARAM)0. Return HWND.
  491. #define ML_IPC_NAVCTRL_HITTEST (ML_IPC_NAVIGATION_FIRST + 11) // Performs hit-test. param = (WPARAM)(NAVHITTEST*)pnavHitTest. Return HNAVITEM if any item under this point or NULL.
  492. #define ML_IPC_NAVCTRL_INSERTITEM (ML_IPC_NAVIGATION_FIRST + 12) // Insert Item. param = (WPARAM)(NAVINSERTSTRUCT*)pnavInsert. Returns handle to created item if you not speicified item id - you wil be assigned auto generated one pnavInsert->id
  493. #define ML_IPC_NAVCTRL_GETSTYLE (ML_IPC_NAVIGATION_FIRST + 15) // Returns NCS_XXX. param = (WPARAM)0.
  494. #define ML_IPC_NAVITEM_EDITTITLE (ML_IPC_NAVIGATION_FIRST + 58) // Begins Title edit. param = (WPARAM)(HNAVITEM)hItem. Returns TRUE if item edit begins
  495. #define ML_IPC_NAVITEM_ENSUREVISIBLE (ML_IPC_NAVIGATION_FIRST + 40) // Enusres that item visible. param =(WPARAM)(HNAVITEM)hItem. Return TRUE if ok.
  496. #define ML_IPC_NAVITEM_EXPAND (ML_IPC_NAVIGATION_FIRST + 41) // Command to change item expand state. param = (WPARAM)(NAVITEMEXPAND*)hnavItemExpand. Returns TRUE if ok.
  497. #define ML_IPC_NAVITEM_GETCHILD (ML_IPC_NAVIGATION_FIRST + 42) // Returns handle to the child item of current one. param =(WPARAM)(HNAVITEM)hItem. Return HNAVITEM or NULL.
  498. #define ML_IPC_NAVITEM_GETCHILDRENCOUNT (ML_IPC_NAVIGATION_FIRST + 43) // Returns children count. param = (WPARAM)(HNAVITEM)hItem.
  499. #define ML_IPC_NAVITEM_GETFULLNAME (ML_IPC_NAVIGATION_FIRST + 44) // Returns item full name. param = (WPARAM)(NAVITEMFULLNAME*)pnavFullName. Returns INT number of characters copied or 0. Full name includes names of all item parents separated by '/' if character '/' was used in name it is doubled
  500. #define ML_IPC_NAVITEM_GETINFO (ML_IPC_NAVIGATION_FIRST + 45) // Retrives item info. param = (WPARAM)(NAVITEM*)pnavItem. Returns TRUE if success. You must set hItem.
  501. #define ML_IPC_NAVITEM_GETNEXT (ML_IPC_NAVIGATION_FIRST + 46) // Returns handle to the next item of current one. param =(WPARAM)(HNAVITEM)hItem. Return HNAVITEM or NULL.
  502. #define ML_IPC_NAVITEM_GETORDER (ML_IPC_NAVIGATION_FIRST + 47) // Returns item sort order. param = (WPARAM)(HNAVITEM)hItem. Return item sort order or -1 if error.
  503. #define ML_IPC_NAVITEM_GETPARENT (ML_IPC_NAVIGATION_FIRST + 48) // Returns handle to the parent item of current one. param =(WPARAM)(HNAVITEM)hItem. Return HNAVITEM or NULL.
  504. #define ML_IPC_NAVITEM_GETPREVIOUS (ML_IPC_NAVIGATION_FIRST + 49) // Returns handle to the previous item of current one. param =(WPARAM)(HNAVITEM)hItem. Return HNAVITEM or NULL.
  505. #define ML_IPC_NAVITEM_GETRECT (ML_IPC_NAVIGATION_FIRST + 50) // Retrive item rect. param =(WPARAM)(NAVITEMGETRECT*)hnavRect. If the item is visible and the bounding rectangle was successfully retrieved, the return value is TRUE.
  506. #define ML_IPC_NAVITEM_GETSTATE (ML_IPC_NAVIGATION_FIRST + 51) // Returns item state flags. param = (WPARAM)(HNAVITEM)hItem. Return item state flags.
  507. #define ML_IPC_NAVITEM_HASCHILDRENREAL (ML_IPC_NAVIGATION_FIRST + 52) // Returns TRUE if item has at least one child right now. param =(WPARAM)(HNAVITEM)hItem. Return BOOL.
  508. #define ML_IPC_NAVITEM_INVALIDATE (ML_IPC_NAVIGATION_FIRST + 53) // Invalidate Item. param = (WPARAM)(NAVITEMINAVLIDATE*)hnavItemInvalidate. Return TRUE if success.
  509. #define ML_IPC_NAVITEM_MOVE (ML_IPC_NAVIGATION_FIRST + 54) // Move Item inside parent group. param =(WPARAM)(NAVITEMMOVE*)pnavMove. Return TRUE on success.
  510. #define ML_IPC_NAVITEM_SELECT (ML_IPC_NAVIGATION_FIRST + 55) // Select current item. param =(WPARAM)(HNAVITEM)hItem. Return TRUE if success.
  511. #define ML_IPC_NAVITEM_SETINFO (ML_IPC_NAVIGATION_FIRST + 56) // Modifies item info. param = (WPARAM)(NAVITEM*)pnavItem. Returns TRUE if success. You must set hItem.
  512. #define ML_IPC_NAVITEM_SETORDER (ML_IPC_NAVIGATION_FIRST + 57) // Sets item order and modifies all items oreder after it if required. if oder == 0xFFFF order will be set to max + 1 for this group. param = (WPARAM)(NAVITEMORDER*)pnavOrder. Returns new item order or 0xFFFF if error
  513. // Macros
  514. // Use this in ML_IPC_NAVCTRL_INSERTITEM to create hInsertAfter
  515. #define MAKE_NAVITEMSORTORDER(o) ((HNAVITEM)((ULONG_PTR)((WORD)(o))))
  516. #define IS_NAVITEMSORTORDER(_i) ((((ULONG_PTR)(_i)) >> 16) == 0)
  517. #define MLNavCtrl_BeginUpdate(/*HWND*/ hwndML, /*UINT*/ fLockFlags) \
  518. (INT)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_BEGINUPDATE, (WPARAM)(fLockFlags))
  519. #define MLNavCtrl_DeleteItem(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  520. (INT)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_DELETEITEM, (WPARAM)(hItem))
  521. #define MLNavCtrl_EndEditTitle(/*HWND*/ hwndML, /*BOOL*/fCancel) \
  522. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_ENDEDITTITLE, (WPARAM)(fCancel))
  523. #define MLNavCtrl_EndUpdate(/*HWND*/ hwndML) \
  524. (INT)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_ENDUPDATE, (WPARAM)0)
  525. #define MLNavCtrl_EnumItems(/*HWND*/ hwndML, /*NAVCTRLENUMPARAMS**/pnavEnumParams) \
  526. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_ENUMITEMS, (WPARAM)(pnavEnumParams))
  527. #define MLNavCtrl_FindItemById(/*HWND*/ hwndML, /*INT*/itemId) \
  528. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_FINDITEMBYID, (WPARAM)(itemId))
  529. #define MLNavCtrl_FindItemByName(/*HWND*/ hwndML, /*NAVCTRLFINDPARAMS**/pnavFindParams) \
  530. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_FINDITEMBYNAME, (WPARAM)(pnavFindParams))
  531. #define MLNavCtrl_GetImageList(/*HWND*/ hwndML) \
  532. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_GETIMAGELIST, (WPARAM)0)
  533. #define MLNavCtrl_GetFirst(/*HWND*/ hwndML) \
  534. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_GETFIRST, (WPARAM)0)
  535. #define MLNavCtrl_GetIndent(/*HWND*/ hwndML) \
  536. (INT)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_GETINDENT, (WPARAM)0)
  537. #define MLNavCtrl_GetSelection(/*HWND*/ hwndML) \
  538. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_GETSELECTION, (WPARAM)0)
  539. #define MLNavCtrl_GetHWND(/*HWND*/ hwndML) \
  540. (HWND)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_GETHWND, (WPARAM)0)
  541. #define MLNavCtrl_HitTest(/*HWND*/ hwndML, /*NAVHITTEST**/pnavHitTest) \
  542. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_HITTEST, (WPARAM)(pnavHitTest))
  543. #define MLNavCtrl_InsertItem(/*HWND*/ hwndML, /*NAVINSERTSTRUCT**/pnavInsert) \
  544. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_INSERTITEM, (WPARAM)(pnavInsert))
  545. #define MLNavCtrl_GetStyle(/*HWND*/ hwndML) \
  546. (DWORD)SENDMLIPC((hwndML), ML_IPC_NAVCTRL_GETSTYLE, (WPARAM)0)
  547. #define MLNavItem_EditTitle(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  548. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_EDITTITLE, (WPARAM)(hItem))
  549. #define MLNavItem_EnsureVisible(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  550. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_ENSUREVISIBLE, (WPARAM)(hItem))
  551. #define MLNavItem_Expand(/*HWND*/ hwndML, /*NAVITEMEXPAND**/pnavItemExpand) \
  552. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_EXPAND, (WPARAM)(pnavItemExpand))
  553. #define MLNavItem_GetChild(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  554. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETCHILD, (WPARAM)(hItem))
  555. #define MLNavItem_GetChildrenCount(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  556. (INT)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETCHILDRENCOUNT, (WPARAM)(hItem))
  557. #define MLNavItem_GetFullName(/*HWND*/ hwndML, /*NAVITEMFULLNAME**/pnavFullName) \
  558. (INT)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETFULLNAME, (WPARAM)(pnavFullName))
  559. #define MLNavItem_GetInfo(/*HWND*/ hwndML, /*NAVITEM**/pnavItem) \
  560. (INT)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETINFO, (WPARAM)(pnavItem))
  561. #define MLNavItem_GetNext(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  562. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETNEXT, (WPARAM)(hItem))
  563. #define MLNavItem_GetOrder(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  564. (WORD)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETORDER, (WPARAM)(hItem))
  565. #define MLNavItem_GetParent(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  566. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETPARENT, (WPARAM)(hItem))
  567. #define MLNavItem_GetPrevious(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  568. (HNAVITEM)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETPREVIOUS, (WPARAM)(hItem))
  569. #define MLNavItem_GetRect(/*HWND*/ hwndML, /*NAVITEMGETRECT**/pnavRect) \
  570. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETRECT, (WPARAM)(pnavRect))
  571. #define MLNavItem_GetState(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  572. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_GETSTATE, (WPARAM)(hItem))
  573. #define MLNavItem_HasChildrenReal(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  574. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_HASCHILDRENREAL, (WPARAM)(hItem))
  575. #define MLNavItem_Invalidate(/*HWND*/ hwndML, /*NAVITEMINAVLIDATE**/pnavItemInvalidate) \
  576. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_INVALIDATE, (WPARAM)(pnavItemInvalidate))
  577. #define MLNavItem_Move(/*HWND*/ hwndML, /*NAVITEMMOVE**/pnavMove) \
  578. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_MOVE, (WPARAM)(pnavMove))
  579. #define MLNavItem_Select(/*HWND*/ hwndML, /*HNAVITEM*/hItem) \
  580. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_SELECT, (WPARAM)(hItem))
  581. #define MLNavItem_SetInfo(/*HWND*/ hwndML, /*NAVITEM**/pnavItem) \
  582. (BOOL)SENDMLIPC((hwndML), ML_IPC_NAVITEM_SETINFO, (WPARAM)(pnavItem))
  583. #define MLNavItem_SetOrder(/*HWND*/ hwndML, /*NAVITEMORDER**/pNavOrder) \
  584. (WORD)SENDMLIPC((hwndML), ML_IPC_NAVITEM_SETORDER, (WPARAM)(pNavOrder))
  585. //////////////////////////////////////////////////////////////////////////////
  586. // MLRating
  587. // Rating control
  588. //
  589. //
  590. typedef struct _RATINGDRAWPARAMS
  591. {
  592. INT cbSize; // The size of this structure, in bytes. You must specify size !!!
  593. HDC hdcDst; // A handle to the destination device context.
  594. RECT rc; // Rectangle that specifies where the image is drawn.
  595. INT value; // Rating value.
  596. INT maxValue; // Maximum rating value.
  597. INT trackingValue; // Current tracking value.
  598. UINT fStyle; // combination of RDS_XXX
  599. HMLIMGLST hMLIL; // Media Libary ImageList. Set to NULL if you want to use default media library list.
  600. INT index; // index of image inside Media Libary ImageList to use. Ignored if used with default media library list.
  601. } RATINGDRAWPARAMS;
  602. typedef struct _RATINGHITTESTPARAMS
  603. {
  604. INT cbSize; // The size of this structure, in bytes. You must specify size !!!
  605. POINT pt; // Client coordinates of the point to test.
  606. RECT rc; // Rectangle that specifies where the image is drawn.
  607. INT maxValue; // Maximum rating value.
  608. UINT fStyle; // combination of RDS_XXX
  609. HMLIMGLST hMLIL; // Media Libary ImageList. Set to NULL if you want to use default media library list.
  610. INT value; // Rating value at this point.
  611. UINT hitFlags; // Variable that receives information about the results of a hit test.
  612. } RATINGHITTESTPARAMS;
  613. /// Rating_Draw Styles
  614. #define RDS_SHOWEMPTY 0x00000001 // Draw elements that not set.
  615. #define RDS_OPAQUE 0x00000002 // Fill rest of the rectangle with rgbBk.
  616. #define RDS_HOT 0x00000004 // Draw elements as "hot".
  617. #define RDS_LEFT 0x00000000 // Aligns elements to the left.
  618. #define RDS_TOP 0x00000000 // Justifies elements to the top of the rectangle.
  619. #define RDS_RIGHT 0x00000010 // Aligns elements to the right.
  620. #define RDS_BOTTOM 0x00000020 // Justifies elements to the bottom of the rectangle.
  621. #define RDS_HCENTER 0x00000040 // Centers elements horizontally in the rectangle.
  622. #define RDS_VCENTER 0x00000080 // Centers elements horizontally in the rectangle.
  623. #define RDS_NORMAL (RDS_SHOWEMPTY | RDS_OPAQUE | RDS_LEFT | RDS_TOP)
  624. // Rating_HitTest hitFlags
  625. #define RHT_NOWHERE 0x0001
  626. #define RHT_ONVALUE 0x0002
  627. #define RHT_ONVALUEABOVE 0x0004
  628. #define RHT_ONVALUEBELOW 0x0008
  629. #define RHT_TOLEFT 0x0100
  630. #define RHT_TORIGHT 0x0200
  631. // Messages
  632. #define ML_IPC_RATING_FIRST 0x1380L
  633. #define ML_IPC_RATING_DRAW (ML_IPC_RATING_FIRST + 1) // Draws rating. param = (WPARAM)(RATINGDRAWPARAMS*)prdp. return TRUE on success.
  634. #define ML_IPC_RATING_HITTEST (ML_IPC_RATING_FIRST + 2) // Performs hit test. param = (WPARAM)(RATINGDRAWPARAMS*)prdp. returns value.
  635. #define ML_IPC_RATING_CALCRECT (ML_IPC_RATING_FIRST + 3) // calculates minimal rect required to show rating. (param) = (WPARAM)(RECT*)prc. Set prc->left to HMLIMGLST (or NULL to use default) and prc->top to maxValue. Returns TRUE if ok.
  636. #define MLRating_Draw(/*HWND*/ hwndML, /*RATINGDRAWPARAMS**/prdp) \
  637. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATING_DRAW, (WPARAM)(RATINGDRAWPARAMS*)(prdp))
  638. #define MLRating_HitTest(/*HWND*/ hwndML, /*RATINGHITTESTPARAMS**/prhtp) \
  639. (INT)SENDMLIPC((hwndML), ML_IPC_RATING_HITTEST, (WPARAM)(RATINGHITTESTPARAMS*)(prhtp))
  640. #define MLRating_CalcRect(/*HWND*/ hwndML, /*HMLIMGLST*/ hmlil, /*INT*/ maxVal, /*RECT**/prc) \
  641. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATING_CALCRECT, ((prc) ? ((((RECT*)(prc))->left = hmlil), \
  642. (((RECT*)(prc))->top = maxVal), (WPARAM)(prc)) : (WPARAM)(RECT*)NULL))
  643. //////////////////////////////////////////////////////////////////////////////
  644. // MLRatingColumn
  645. // Helpers to display rating in the listview
  646. //
  647. //
  648. typedef struct _RATINGCOLUMNPAINT
  649. {
  650. HWND hwndList; // hwnd of the listview
  651. HDC hdc; // hdc
  652. UINT iItem; // item index
  653. UINT iSubItem; // subitem index
  654. INT value; // database rating value
  655. RECT *prcItem; // whole item rect (plvcd->nmcd.rc)
  656. RECT *prcView; // client area size (you can get it at CDDS_PREPAINT in plvcd->nmcd.rc)
  657. COLORREF rgbBk; // color to use as background (plvcd->clrTextBk)
  658. COLORREF rgbFg; // color to use as foreground (plvcd->clrText)
  659. UINT fStyle; // style to use RCS_XXX
  660. } RATINGCOLUMNPAINT;
  661. typedef struct _RATINGCOLUMN
  662. {
  663. HWND hwndList;
  664. UINT iItem;
  665. UINT iSubItem;
  666. INT value;
  667. POINT ptAction; //
  668. BOOL bRedrawNow; // You want list to be redrawn immediatly
  669. BOOL bCanceled; // Used with EndDrag - i
  670. UINT fStyle; // RCS_XXX
  671. } RATINGCOLUMN;
  672. typedef struct _RATINGBACKTEXT
  673. {
  674. LPWSTR pszText;
  675. INT cchTextMax;
  676. INT nColumnWidth; // used if style is RCS_ALLIGN_CENTER or RCS_ALLIGN_RIGHT
  677. UINT fStyle;
  678. } RATINGBACKTEXT;
  679. typedef struct _RATINGWIDTH
  680. {
  681. INT width; // desired width
  682. UINT fStyle; // RCS_XXX
  683. } RATINGWIDTH;
  684. // styles
  685. #define RCS_DEFAULT 0xFFFFFFFF // set this if you want to use gen_ml provided style
  686. // layout
  687. #define RCS_ALLIGN_LEFT 0x00000000 // allign column left
  688. #define RCS_ALLIGN_CENTER 0x00000001 // allign column center
  689. #define RCS_ALLIGN_RIGHT 0x00000002 // allign column right
  690. // showepmty
  691. #define RCS_SHOWEMPTY_NEVER 0x00000000
  692. #define RCS_SHOWEMPTY_NORMAL 0x00000010
  693. #define RCS_SHOWEMPTY_HOT 0x00000020
  694. #define RCS_SHOWEMPTY_ANIMATION 0x00000040
  695. #define RCS_SHOWEMPTY_ALWAYS 0x00000070
  696. // traking (when)
  697. #define RCS_TRACK_NEVER 0x00000000
  698. #define RCS_TRACK_WNDFOCUSED 0x00000100
  699. #define RCS_TRACK_ANCESTORACITVE 0x00000200
  700. #define RCS_TRACK_PROCESSACTIVE 0x00000400
  701. #define RCS_TRACK_ALWAYS 0x00000800
  702. // traking (what)
  703. #define RCS_TRACKITEM_ALL 0x00000000
  704. #define RCS_TRACKITEM_SELECTED 0x00100000
  705. #define RCS_TRACKITEM_FOCUSED 0x00200000
  706. #define RCS_BLOCKCLICK 0x01000000
  707. #define RCS_BLOCKUNRATECLICK 0x02000000
  708. #define RCS_BLOCKDRAG 0x04000000
  709. #define RCS_SIZE_ALLOWDECREASE 0x10000000
  710. #define RCS_SIZE_ALLOWINCREASE 0x20000000
  711. #define ML_IPC_RATINGCOLUMN_FIRST 0x1420L
  712. #define ML_IPC_RATINGCOLUMN_PAINT (ML_IPC_RATINGCOLUMN_FIRST + 1) // Paints rating column (call it in (CDDS_SUBITEM | CDDS_ITEMPREPAINT) handler).
  713. // param = (WPARAM)(RATINGCOLUMNPAINT*)prcp. if Return TRUE - you need to return SDRF_SKIPDEFAULT
  714. #define ML_IPC_RATINGCOLUMN_CLICK (ML_IPC_RATINGCOLUMN_FIRST + 2) // param = (WPARAM)(RATINGCOLUMN*)prc. You need to set: hwndList, ptAction, bRedraw. iItem - will be set to iItem where click happened. Returns TRUE if click is on the column.
  715. #define ML_IPC_RATINGCOLUMN_TRACK (ML_IPC_RATINGCOLUMN_FIRST + 3) // param = (WPARAM)(RATINGCOLUMN*)prc. You need to set: hwndList, ptAction, iItem, iSubItem, vale, bRedraw. iItem - will be set to iItem where click happened. No return value.
  716. #define ML_IPC_RATINGCOLUMN_CANCELTRACKING (ML_IPC_RATINGCOLUMN_FIRST + 4) // param = (WPARAM)(BOOL)bRedraw. No return value.
  717. #define ML_IPC_RATINGCOLUMN_BEGINDRAG (ML_IPC_RATINGCOLUMN_FIRST + 5) // param = (WPARAM)(RATINGCOLUMN*)prc. Set: hwndList, iItem, iSubItem, value. No return value.
  718. #define ML_IPC_RATINGCOLUMN_DRAG (ML_IPC_RATINGCOLUMN_FIRST + 6) // param = (WPARAM)(POINT*)ppt. Returns TRUE if drag is porcessed.
  719. #define ML_IPC_RATINGCOLUMN_ENDDRAG (ML_IPC_RATINGCOLUMN_FIRST + 7) // param = (WPARAM)(RATINGCOLUMN*)prc. Set: ptAction, bCanceled, bRedrawNow. Returns TRUE if value modified. Sets: iItem, iSubItemVal.
  720. #define ML_IPC_RATINGCOLUMN_ANIMATE (ML_IPC_RATINGCOLUMN_FIRST + 8) // param = (WPARAM)(RATINGCOLUMN*)prc. Set: hwndList, iItem, iSubItem. iSubItem - contains duration in ms. No return.
  721. #define ML_IPC_RATINGCOLUMN_GETMINWIDTH (ML_IPC_RATINGCOLUMN_FIRST + 9) // param = (WPARAM)0. Returns minimum width required to display rating column.
  722. #define ML_IPC_RATINGCOLUMN_FILLBACKSTRING (ML_IPC_RATINGCOLUMN_FIRST + 10) // Generates string thats when displayed equal to the right border of maximum rating value. If rating column has 0 index you can use this string as column text to prevent mouse group selection over rating. If width is less than allowed pszText[0] = 0x00
  723. // param = (WPARAM)(RATINGBACKTEXT*)prct. Returns TRUE if ok
  724. #define ML_IPC_RATINGCOLUMN_GETWIDTH (ML_IPC_RATINGCOLUMN_FIRST + 11) // Set width according to the policies. param = (WPARAM)(RATINGWIDTH*)prw. Return TRUE if ok. prw->width will contain allowed width
  725. #define MLRatingColumn_Paint(/*HWND*/ hwndML, /*RATINGCOLUMNPAINT**/prcp) \
  726. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_PAINT, (WPARAM)(RATINGCOLUMNPAINT*)(prcp))
  727. #define MLRatingColumn_Click(/*HWND*/ hwndML, /*RATINGCOLUMN**/pRating) \
  728. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_CLICK, (WPARAM)(RATINGCOLUMN*)(pRating))
  729. #define MLRatingColumn_Track(/*HWND*/ hwndML, /*RATINGCOLUMN**/pRating) \
  730. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_TRACK, (WPARAM)(RATINGCOLUMN*)(pRating))
  731. #define MLRatingColumn_CancelTracking(/*HWND*/ hwndML, /*BOOL*/bRedrawNow) \
  732. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_CANCELTRACKING, (WPARAM)(BOOL)(bRedrawNow))
  733. #define MLRatingColumn_BeginDrag(/*HWND*/ hwndML, /*RATINGCOLUMN**/pRating) \
  734. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_BEGINDRAG, (WPARAM)(RATINGCOLUMN*)(pRating))
  735. #define MLRatingColumn_Drag(/*HWND*/ hwndML, /*POINT**/ppt) \
  736. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_DRAG, (WPARAM)(POINT*)(ppt))
  737. #define MLRatingColumn_EndDrag(/*HWND*/ hwndML, /*RATINGCOLUMN**/pRating) \
  738. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_ENDDRAG, (WPARAM)(RATINGCOLUMN*)(pRating))
  739. #define MLRatingColumn_Animate(/*HWND*/ hwndML, /*RATINGCOLUMN**/pRating) \
  740. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_ANIMATE, (WPARAM)(RATINGCOLUMN*)(pRating))
  741. #define MLRatingColumn_GetMinWidth(/*HWND*/ hwndML) \
  742. (INT)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_GETMINWIDTH, (WPARAM)0)
  743. #define MLRatingColumn_FillBackString(/*HWND*/ hwndML, /*RATINGBACKTEXT**/prbt) \
  744. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_FILLBACKSTRING, (WPARAM)(RATINGBACKTEXT*)(prbt))
  745. #define MLRatingColumn_GetWidth(/*HWND*/ hwndML, /*RATINGWIDTH**/prw) \
  746. (BOOL)SENDMLIPC((hwndML), ML_IPC_RATINGCOLUMN_GETWIDTH, (WPARAM)(RATINGWIDTH*)(prw))
  747. //////////////////////////////////////////////////////////////////////////////
  748. // MLCloud
  749. // Cloud control
  750. //
  751. //
  752. typedef struct _CLOUDDRAWPARAMS
  753. {
  754. INT cbSize; // The size of this structure, in bytes. You must specify size !!!
  755. HDC hdcDst; // A handle to the destination device context.
  756. RECT rc; // Rectangle that specifies where the image is drawn.
  757. INT value; // Database cloud status (1=full,2=partial,3=unavail)
  758. HMLIMGLST hMLIL; // Media Libary ImageList. Set to NULL if you want to use default media library list.
  759. INT index; // index of image inside Media Libary ImageList to use. Ignored if used with default media library list.
  760. } CLOUDDRAWPARAMS;
  761. #define ML_IPC_CLOUD_FIRST 0x1500L
  762. #define ML_IPC_CLOUD_DRAW (ML_IPC_CLOUD_FIRST + 1) // Draws cloud status. param = (WPARAM)(CLOUDDRAWPARAMS*)prdp. return TRUE on success.
  763. #define ML_IPC_CLOUD_CALCRECT (ML_IPC_CLOUD_FIRST + 2) // calculates minimal rect required to show cloud status. (param) = (WPARAM)(RECT*)prc. Set prc->left to HMLIMGLST (or NULL to use default) and prc->top to maxValue. Returns TRUE if ok.
  764. #define MLCloud_Draw(/*HWND*/ hwndML, /*CLOUDDRAWPARAMS**/prdp) \
  765. (BOOL)SENDMLIPC((hwndML), ML_IPC_CLOUD_DRAW, (WPARAM)(CLOUDDRAWPARAMS*)(prdp))
  766. #define MLCloud_CalcRect(/*HWND*/ hwndML, /*HMLIMGLST*/ hmlil, /*RECT**/prc) \
  767. (BOOL)SENDMLIPC((hwndML), ML_IPC_CLOUD_CALCRECT, \
  768. ((prc) ? ((((RECT*)(prc))->left = hmlil), \
  769. (WPARAM)(prc)) : (WPARAM)(RECT*)NULL))
  770. //////////////////////////////////////////////////////////////////////////////
  771. // MLCloudColumn
  772. // Helpers to display cloud in the listview
  773. //
  774. //
  775. typedef struct _CLOUDCOLUMNPAINT
  776. {
  777. HWND hwndList; // hwnd of the listview
  778. HDC hdc; // hdc
  779. UINT iItem; // item index
  780. UINT iSubItem; // subitem index
  781. INT value; // database cloud status (1=full,2=partial,3=unavail)
  782. RECT *prcItem; // whole item rect (plvcd->nmcd.rc)
  783. RECT *prcView; // client area size (you can get it at CDDS_PREPAINT in plvcd->nmcd.rc)
  784. COLORREF rgbBk; // color to use as background (plvcd->clrTextBk)
  785. COLORREF rgbFg; // color to use as foreground (plvcd->clrText)
  786. } CLOUDCOLUMNPAINT;
  787. typedef struct _CLOUDBACKTEXT
  788. {
  789. LPWSTR pszText;
  790. INT cchTextMax;
  791. INT nColumnWidth; // used if style is RCS_ALLIGN_CENTER or RCS_ALLIGN_RIGHT
  792. } CLOUDBACKTEXT;
  793. #define ML_IPC_CLOUDCOLUMN_PAINT (ML_IPC_CLOUD_FIRST + 3) // Paints cloud column (call it in (CDDS_SUBITEM | CDDS_ITEMPREPAINT) handler).
  794. // param = (WPARAM)(CLOUDCOLUMNPAINT*)prcp. if Return TRUE - you need to return SDRF_SKIPDEFAULT
  795. #define ML_IPC_CLOUDCOLUMN_GETMINWIDTH (ML_IPC_CLOUD_FIRST + 4) // param = (WPARAM)0. Returns minimum width required to display cloud status column.
  796. #define ML_IPC_CLOUDCOLUMN_GETWIDTH (ML_IPC_CLOUD_FIRST + 5) // Set width according to the policies. param = (WPARAM)(INT*)width. Return TRUE if ok. 'width' will contain allowed width
  797. #define MLCloudColumn_Paint(/*HWND*/ hwndML, /*CLOUDCOLUMNPAINT**/prcp) \
  798. (BOOL)SENDMLIPC((hwndML), ML_IPC_CLOUDCOLUMN_PAINT, (WPARAM)(CLOUDCOLUMNPAINT*)(prcp))
  799. #define MLCloudColumn_GetMinWidth(/*HWND*/ hwndML) \
  800. (INT)SENDMLIPC((hwndML), ML_IPC_CLOUDCOLUMN_GETMINWIDTH, (WPARAM)0)
  801. #define MLCloudColumn_GetWidth(/*HWND*/ hwndML, /*INT**/width) \
  802. (BOOL)SENDMLIPC((hwndML), ML_IPC_CLOUDCOLUMN_GETWIDTH, (WPARAM)(INT*)(width))
  803. //////////////////////////////////////////////////////////////////////////////////
  804. // Skinning
  805. ///
  806. // supported window types
  807. #define SKINNEDWND_TYPE_AUTO 0x0000 // type will be determine based on class name
  808. #define SKINNEDWND_TYPE_ERROR 0x0000 // return code for ML_IPC_SKINNEDWND_GETTYPE in case of error
  809. #define SKINNEDWND_TYPE_WINDOW 0x0001 // base skinned window type.
  810. #define SKINNEDWND_TYPE_SCROLLWND 0x0002 // base skinned window with skinned scrollbar.
  811. #define SKINNEDWND_TYPE_DIALOG 0x0003
  812. #define SKINNEDWND_TYPE_HEADER 0x0004
  813. #define SKINNEDWND_TYPE_LISTVIEW 0x0005
  814. #define SKINNEDWND_TYPE_BUTTON 0x0006
  815. #define SKINNEDWND_TYPE_DIVIDER 0x0007
  816. #define SKINNEDWND_TYPE_EDIT 0x0008
  817. #define SKINNEDWND_TYPE_STATIC 0x0009
  818. #define SKINNEDWND_TYPE_LISTBOX 0x000A // you need to set owner draw style to allow selection skinning
  819. #define SKINNEDWND_TYPE_COMBOBOX 0x000B
  820. #define SKINNEDWND_TYPE_FOLDERBROWSER 0x000C
  821. #define SKINNEDWND_TYPE_POPUPMENU 0x000D
  822. #define SKINNEDWND_TYPE_TOOLTIP 0x000E
  823. #define SKINNEDWND_TYPE_PROGRESSBAR 0x000F
  824. // skin styles
  825. #define SWS_NORMAL 0x00000000
  826. #define SWS_USESKINFONT 0x00000001
  827. #define SWS_USESKINCOLORS 0x00000002
  828. #define SWS_USESKINCURSORS 0x00000004
  829. #define SWS_NO_DIRECT_MOUSE_WHEEL 0x00000008
  830. // styles listview
  831. #define SWLVS_FULLROWSELECT 0x00010000
  832. #define SWLVS_DOUBLEBUFFER 0x00020000
  833. #define SWLVS_ALTERNATEITEMS 0x00040000 // Since Winamp 5.55
  834. #define SWLVS_SELALWAYS 0x00080000 // Since Winamp 5.56
  835. // styles divider
  836. #define SWDIV_HORZ 0x00000000
  837. #define SWDIV_VERT 0x00010000
  838. #define SWDIV_NOHILITE 0x00020000 // do not draw hilite line
  839. // styles edit (single line)
  840. #define SWES_TOP 0x00000000
  841. #define SWES_BOTTOM 0x00010000
  842. #define SWES_VCENTER 0x00020000
  843. #define SWES_SELECTONCLICK 0x00040000
  844. // styles button
  845. #define SWBS_SPLITBUTTON 0x00010000
  846. #define SWBS_DROPDOWNBUTTON 0x00020000
  847. #define SWBS_SPLITPRESSED 0x00100000
  848. #define SWBS_TOOLBAR 0x00080000 // draw control as a part of the toolbar
  849. // styles combobox
  850. #define SWCBS_TOOLBAR 0x00080000 // draw control as a part of the toolbar
  851. // reserved range 0x10000000 - 0xF0000000
  852. // Use to skin window (ML_IPC_SKINWINDOW)
  853. typedef struct _MLSKINWINDOW
  854. {
  855. HWND hwndToSkin; // hwnd to skin
  856. UINT skinType; // skin as... SKINNEDWND_TYPE_XXX
  857. UINT style; // skin style supported by this window
  858. } MLSKINWINDOW;
  859. #define ML_IPC_SKINWINDOW 0x1400L // param = (WPARAM)(MLSKINWINDOW)pmlSkinWnd. Return TRUE if ok.
  860. // Note: If window already skinned you will get error.
  861. // Some controls require they parent to support reflection which provided by all skinned windows.
  862. // In case parent not skined it will be skinned automaticly as SKINNEDWND_TYPE_WINDOW.
  863. // You can always reskin parent window later with desired type.
  864. // Skinned window will unskin itself on WM_NCDESTROY.
  865. #define ML_IPC_UNSKINWINDOW 0x1401L // param = (WPARAM)(HWND)hwndToUnskin.
  866. // Macros
  867. #define MLSkinWindow(/*HWND*/ hwndML, /*MLSKINWINDOW**/pmlSkinWnd) \
  868. (BOOL)SENDMLIPC((HWND)(hwndML), ML_IPC_SKINWINDOW, (WPARAM)(MLSKINWINDOW*)(pmlSkinWnd))
  869. #define MLSkinWindow2(/*HWND*/ __hwndML, /*HWND*/__hwndToSkin, /*UINT*/__skinType, /*UINT*/__skinStyle) \
  870. { MLSKINWINDOW __mlsw;\
  871. __mlsw.hwndToSkin = __hwndToSkin;\
  872. __mlsw.skinType = __skinType;\
  873. __mlsw.style = __skinStyle;\
  874. (BOOL)SENDMLIPC((HWND)(__hwndML), ML_IPC_SKINWINDOW, (WPARAM)(MLSKINWINDOW*)(&__mlsw));}
  875. #define MLUnskinWindow(/*HWND*/ hwndML, /*HWND*/hwndToUnskin) \
  876. (BOOL)SENDMLIPC((HWND)(hwndML), ML_IPC_UNSKINWINDOW, (WPARAM)(HWND)(hwndToUnskin))
  877. #define SMS_NORMAL 0x00000000
  878. #define SMS_USESKINFONT 0x00000001
  879. #define SMS_FORCEWIDTH 0x00000002
  880. #define SMS_DISABLESHADOW 0x00000004
  881. #define SMS_SYSCOLORS 0x00000008
  882. #define MLMENU_WANT_DRAWPART ((-1))
  883. #define MLMENU_ACTION_MEASUREITEM 0 // param = (LPARAM)(MEASUREITEMSTRUCT*)pmis;
  884. #define MLMENU_ACTION_DRAWITEM 1 // param = (LPARAM)(DRAWITEMSTRUCT*)pdis; Return: 0 - default processing, 1 - if you draw it all, MLMENU_WANT_DRAWPART - want to receive parts
  885. #define MLMENU_ACTION_DRAWBACK 2 // param = (LPARAM)(DRAWITEMSTRUCT*)pdis; Return: 0 - default processing, 1 - if you draw it all
  886. #define MLMENU_ACTION_DRAWICON 3 // param = (LPARAM)(DRAWITEMSTRUCT*)pdis; Return: 0 - default processing, 1 - if you draw it all
  887. #define MLMENU_ACTION_DRAWTEXT 4 // param = (LPARAM)(DRAWITEMSTRUCT*)pdis; Return: 0 - default processing, 1 - if you draw it all
  888. typedef INT (CALLBACK *MENUCUSTOMIZEPROC)(INT /*action*/, HMENU /*hMenu*/, HDC /*hdc*/, LPARAM /*param*/, ULONG_PTR /*user*/);
  889. typedef struct _MLSKINNEDPOPUP
  890. {
  891. INT cbSize;
  892. HMENU hmenu;
  893. UINT fuFlags;
  894. int x;
  895. int y;
  896. HWND hwnd;
  897. LPTPMPARAMS lptpm;
  898. HMLIMGLST hmlil;
  899. INT width;
  900. UINT skinStyle;
  901. MENUCUSTOMIZEPROC customProc;
  902. ULONG_PTR customParam;
  903. } MLSKINNEDPOPUP;
  904. #define ML_IPC_TRACKSKINNEDPOPUPEX 0x1402L // param = (WPARAM)(MLSKINNEDPOPUP)pmlSkinnedPopup
  905. #define MLTrackSkinnedPopupMenuEx(/*HWND*/ __hwndML, /*HMENU*/__hmenu, /*UINT*/__uFlags, /*INT*/__x, /*INT*/__y,\
  906. /*HWND*/ __hwndOwner, /*LPTPMPARAMS*/__lptpm, /*HMLIMGLST*/ __hmlil, /*INT*/__width,\
  907. /*UINT*/__skinStyle, /*MENUCUSTOMIZEPROC*/ __customProc, /*ULONG_PTR*/ __customParam) \
  908. { MLSKINNEDPOPUP __mlspm;\
  909. __mlspm.cbSize = sizeof(MLSKINNEDPOPUP);\
  910. __mlspm.hmenu = __hmenu;\
  911. __mlspm.fuFlags = __uFlags;\
  912. __mlspm.x = __x;\
  913. __mlspm.y = __y;\
  914. __mlspm.hwnd = __hwndOwner;\
  915. __mlspm.lptpm = __lptpm;\
  916. __mlspm.hmlil = __hmlil;\
  917. __mlspm.width = __width;\
  918. __mlspm.skinStyle = __skinStyle;\
  919. __mlspm.customProc = __customProc;\
  920. __mlspm.customParam = __customParam;\
  921. (BOOL)SENDMLIPC((HWND)(__hwndML), ML_IPC_TRACKSKINNEDPOPUPEX, (WPARAM)(MLSKINNEDPOPUP*)(&__mlspm));}
  922. #define ML_IPC_INITSKINNEDPOPUPHOOK 0x1403L // param = (WPARAM)(MLSKINNEDPOPUP)pmlSkinnedPopup (you need to fill only hwnd, hmlil, width, skinStyle, customProc, customParam). Return handle
  923. #define ML_IPC_REMOVESKINNEDPOPUPHOOK 0x1404L // param = (WPARAM)(HANDLE)hPopupHook
  924. #define MLRemoveSkinnedPopupHook(/*HWND*/ __hwndML, /*HANDLE*/__hPopupHook) \
  925. (SENDMLIPC((HWND)(__hwndML), ML_IPC_REMOVESKINNEDPOPUPHOOK, (WPARAM)(__hPopupHook)))
  926. typedef struct MLSKINNEDMINMAXINFO
  927. {
  928. SIZE min;
  929. SIZE max;
  930. } MLSKINNEDMINMAXINFO;
  931. // Send this messages directly to the skinned window
  932. #define ML_IPC_SKINNEDWND_ISSKINNED 0x0001 // param ignored
  933. #define ML_IPC_SKINNEDWND_GETTYPE 0x0002 // param ignored. return SKINNEDWND_TYPE_XXX or SKINNEDWND_TYPE_ERROR if error.
  934. #define ML_IPC_SKINNEDWND_SKINCHANGED 0x0003 // param = (WPARAM)MAKEWPARAM(NotifyChldren, bRedraw). Return TRUE if ok.
  935. #define ML_IPC_SKINNEDWND_ENABLEREFLECTION 0x0004 // param = (WPARAM)(BOOL)bEnable. Return TRUE if ok. Note: as a lot of skinned controls relay on reflection be carefull using this command
  936. #define ML_IPC_SKINNEDWND_GETPREVWNDPROC 0x0005 // param = (WPARAM)(BOOL*)pbUnicode. Return WNDPROC if ok.
  937. #define ML_IPC_SKINNEDWND_SETSTYLE 0x0006 // param = (WPARAM)(UINT)newStyle. Returns previous style.
  938. #define ML_IPC_SKINNEDWND_GETSTYLE 0x0007 // param igonred. Return current styles
  939. #define ML_IPC_SKINNEDWND_SETMINMAXINFO 0x0008 // param = (WPARAM)(MLSKINNEDMINMAXINFO*)minMax. Returns TRUE if ok.
  940. #define ML_IPC_SKINNEDWND_SKINUPDATED 0x0009 // param = (WPARAM)MAKEWPARAM(NotifyChldren, bRedraw). Return ignored. Send after ML_IPC_SKINNEDWND_SKINCHANGED processed right before redraw.
  941. // Macros
  942. #define MLSkinnedWnd_IsSkinned(/*HWND*/ hwndSkinned) \
  943. (BOOL)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDWND_ISSKINNED, (WPARAM)0)
  944. #define MLSkinnedWnd_GetType(/*HWND*/ hwndSkinned) \
  945. (UINT)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDWND_GETTYPE, (WPARAM)0)
  946. #define MLSkinnedWnd_SkinChanged(/*HWND*/ hwndSkinned, /*BOOL*/ bNotifyChildren, /*BOOL*/ bRedraw) \
  947. (BOOL)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDWND_SKINCHANGED, MAKEWPARAM( (0 != (bNotifyChildren)), (0 != (bRedraw))))
  948. #define MLSkinnedWnd_EnableReflection(/*HWND*/ hwndSkinned, /*BOOL*/ bEnable) \
  949. (BOOL)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDWND_ENABLEREFLECTION, (WPARAM)(BOOL)(bEnable))
  950. #define MLSkinnedWnd_GetPrevWndProc(/*HWND*/ hwndSkinned, /*BOOL* */ pbUnicode) \
  951. (WNDPROC)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDWND_GETPREVWNDPROC, (WPARAM)(BOOL*)(pbUnicode))
  952. #define MLSkinnedWnd_SetStyle(/*HWND*/ __hwndSkinned, /*UINT*/ __newStyles) \
  953. (UINT)SENDMLIPC((HWND)(__hwndSkinned), ML_IPC_SKINNEDWND_SETSTYLE, (WPARAM)(__newStyles))
  954. #define MLSkinnedWnd_GetStyle(/*HWND*/ __hwndSkinned) \
  955. (UINT)SENDMLIPC((HWND)(__hwndSkinned), ML_IPC_SKINNEDWND_GETSTYLE, (WPARAM)0)
  956. #define MLSkinnedWnd_SetMinMaxInfo(/*HWND*/ __hwndSkinned, /*MLSKINNEDMINMAXINFO* */ _minMax) \
  957. (UINT)SENDMLIPC((HWND)(__hwndSkinned), ML_IPC_SKINNEDWND_SETMINMAXINFO, (WPARAM)(_minMax))
  958. #define SCROLLMODE_STANDARD 0x0000
  959. #define SCROLLMODE_LISTVIEW 0x0001
  960. #define SCROLLMODE_TREEVIEW 0x0002
  961. #define SCROLLMODE_COMBOLBOX 0x0003
  962. // Send this messages directly to the skinned window
  963. #define IPC_ML_SKINNEDSCROLLWND_UPDATEBARS 0x0010 // param = (WPARAM)(BOOL)fInvalidate
  964. #define IPC_ML_SKINNEDSCROLLWND_SHOWHORZBAR 0x0011 // param = (WPARAM)(BOOL)bEnable
  965. #define IPC_ML_SKINNEDSCROLLWND_SHOWVERTBAR 0x0013 // param = (WPARAM)(BOOL)bEnable
  966. #define IPC_ML_SKINNEDSCROLLWND_SETMODE 0x0012 // param = (WPARAM)(UINT)nScrollMode
  967. #define IPC_ML_SKINNEDSCROLLWND_DISABLENOSCROLL 0x0014 // param = (WPARAM)(BOOL)bDisableNoScroll
  968. typedef struct _SBADJUSTHOVER
  969. {
  970. UINT hitTest;
  971. POINTS ptMouse;
  972. INT nResult;
  973. } SBADJUSTHOVER;
  974. #define IPC_ML_SKINNEDSCROLLWND_ADJUSTHOVER 0x0015 // param = (WPARAM)(SBADJUSTHOVER*)pAdjustData
  975. #define IPC_ML_SKINNEDSCROLLWND_GETHORZBARHIDDEN 0x0016 // param - not used, returns TRUE if horizontal scrollbar always hidden
  976. #define IPC_ML_SKINNEDSCROLLWND_GETVERTBARHIDDEN 0x0017 // param - not used, returns TRUE if vertical scrollbar always hidden
  977. #define IPC_ML_SKINNEDSCROLLWND_GETMODE 0x0018 // param - not used, returns current mode
  978. #define IPC_ML_SKINNEDSCROLLWND_GETNOSCROLLDISABLED 0x0019 // param - not used, returns TRUE if no scroll disabled.
  979. #define MLSkinnedScrollWnd_UpdateBars(/*HWND*/ hwndSkinned, /*BOOL*/ fInvalidate) \
  980. (BOOL)SENDMLIPC((HWND)(hwndSkinned), IPC_ML_SKINNEDSCROLLWND_UPDATEBARS, (WPARAM)(BOOL)(fInvalidate))
  981. #define MLSkinnedScrollWnd_ShowHorzBar(/*HWND*/ hwndSkinned, /*BOOL*/ bEnable) \
  982. (BOOL)SENDMLIPC((HWND)(hwndSkinned), IPC_ML_SKINNEDSCROLLWND_SHOWHORZBAR, (WPARAM)(BOOL)(bEnable))
  983. #define MLSkinnedScrollWnd_ShowVertBar(/*HWND*/ hwndSkinned, /*BOOL*/ bEnable) \
  984. (BOOL)SENDMLIPC((HWND)(hwndSkinned), IPC_ML_SKINNEDSCROLLWND_SHOWVERTBAR, (WPARAM)(BOOL)(bEnable))
  985. #define MLSkinnedScrollWnd_SetMode(/*HWND*/ hwndSkinned, /*UINT*/ nScrollMode) \
  986. (BOOL)SENDMLIPC((HWND)(hwndSkinned), IPC_ML_SKINNEDSCROLLWND_SETMODE, (WPARAM)(UINT)(nScrollMode))
  987. #define MLSkinnedScrollWnd_DisableNoScroll(/*HWND*/ __hwndSkinned, /*BOOL*/ __bDisable) \
  988. (BOOL)SENDMLIPC((__hwndSkinned), IPC_ML_SKINNEDSCROLLWND_DISABLENOSCROLL, (WPARAM)(__bDisable))
  989. #define MLSkinnedScrollWnd_GetHorzBarHidden(/*HWND*/ __hwndSkinned) \
  990. (BOOL)SENDMLIPC((__hwndSkinned), IPC_ML_SKINNEDSCROLLWND_GETHORZBARHIDDEN, 0)
  991. #define MLSkinnedScrollWnd_GetVertBarHidden(/*HWND*/ __hwndSkinned) \
  992. (BOOL)SENDMLIPC((__hwndSkinned), IPC_ML_SKINNEDSCROLLWND_GETVERTBARHIDDEN, 0)
  993. #define MLSkinnedScrollWnd_GetMode(/*HWND*/ __hwndSkinned) \
  994. (UINT)SENDMLIPC((__hwndSkinned), IPC_ML_SKINNEDSCROLLWND_GETMODE, 0)
  995. #define MLSkinnedScrollWnd_GetNoScrollDisabled(/*HWND*/ __hwndSkinned) \
  996. (BOOL)SENDMLIPC((__hwndSkinned), IPC_ML_SKINNEDSCROLLWND_GETNOSCROLLDISABLED, 0)
  997. // Send this messages directly to the skinned window
  998. #define ML_IPC_SKINNEDLISTVIEW_DISPLAYSORT 0x0020 // param = MAKEWPARAM(sortIndex, ascending), To hide set sortIndex to -1.
  999. #define ML_IPC_SKINNEDLISTVIEW_GETSORT 0x0021 // param not used. Return LOWORD() - index, HIWORD() - ascending
  1000. #define ML_IPC_SKINNEDLISTVIEW_SETCURRENT 0x0022 // param = (WPARAM)(INT)currentItem. if currentItem == -1 - the current item text will be removed,
  1001. // otherwise it will select the item specified (used for showing the currently playing item - 5.7+)
  1002. #define ML_IPC_SKINNEDHEADER_DISPLAYSORT 0x0030 // param = MAKEWPARAM(sortIndex, ascending)
  1003. #define ML_IPC_SKINNEDHEADER_GETSORT 0x0031 // param not used. Return LOWORD() - index, HIWORD() - ascending
  1004. #define ML_IPC_SKINNEDHEADER_SETHEIGHT 0x0032 // param = (WPARAM)(INT)newHeight. if newHeight == -1 - height will be calculated based on the font size.
  1005. #define ML_IPC_SKINNEDHEADER_SETCLOUDCOLUMN 0x0033 // param = (WPARAM)(INT)cloudColumn. sets the column which will show a cloud icon header image
  1006. #define MLSkinnedListView_DisplaySort(/*HWND*/hwndSkinned, /*WORD*/ index, /*WORD*/ascending) \
  1007. (BOOL)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDLISTVIEW_DISPLAYSORT, MAKEWPARAM((index), (ascending)))
  1008. #define MLSkinnedListView_GetSort(/*HWND*/hwndSkinned) \
  1009. (UINT)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDLISTVIEW_GETSORT, 0)
  1010. #define MLSkinnedHeader_GetSort(/*HWND*/hwndSkinned) \
  1011. (UINT)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDHEADER_GETSORT, 0)
  1012. #define MLSkinnedHeader_SetHeight(/*HWND*/hwndSkinned, /*INT*/ newHeight) \
  1013. (UINT)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDHEADER_SETHEIGHT, (WPARAM)newHeight)
  1014. #define MLSkinnedHeader_SetCloudColumn(/*HWND*/hwndSkinned, /*INT*/ cloudColumn) \
  1015. (UINT)SENDMLIPC((HWND)(hwndSkinned), ML_IPC_SKINNEDHEADER_SETCLOUDCOLUMN, (WPARAM)cloudColumn)
  1016. // Skinned divider messages
  1017. typedef void (CALLBACK *MLDIVIDERMOVED)(HWND /*hwndDivider*/, INT /*nPos*/, LPARAM /*userParam*/);
  1018. typedef struct _MLDIVIDERCALLBACK
  1019. {
  1020. MLDIVIDERMOVED fnCallback;
  1021. LPARAM userParam;
  1022. } MLDIVIDERCALLBACK;
  1023. #define ML_IPC_SKINNEDDIVIDER_SETCALLBACK 0x0010 // param = (WPARAM)(MLDIVIDERCALLBACK*)dividerCallback.
  1024. #define MLSkinnedDivider_SetCallback(/*HWND*/_hwndSkinned, /*MLDIVIDERMOVED*/ _fnCallback, /*LPARAM*/_userParam) \
  1025. { MLDIVIDERCALLBACK _cbData;\
  1026. _cbData.fnCallback = (_fnCallback);\
  1027. _cbData.userParam = (_userParam);\
  1028. (BOOL)SENDMLIPC((HWND)(_hwndSkinned), ML_IPC_SKINNEDDIVIDER_SETCALLBACK, ((WPARAM)(MLDIVIDERCALLBACK*)(&_cbData)));}
  1029. // Skinned button
  1030. #define MLBN_DROPDOWN 20
  1031. typedef struct _MLBUTTONIMAGELIST
  1032. {
  1033. HMLIMGLST hmlil;
  1034. INT normalIndex; // set index to -1 if you don't have special image for this type
  1035. INT pressedIndex;
  1036. INT hoverIndex;
  1037. INT disabledIndex;
  1038. } MLBUTTONIMAGELIST;
  1039. #define ML_IPC_SKINNEDBUTTON_SETIMAGELIST 0x0010 // param = (WPARAM)(MLBUTTONIMAGELIST*)buttonImagelist.
  1040. #define ML_IPC_SKINNEDBUTTON_GETIMAGELIST 0x0011 // param = (WPARAM)(MLBUTTONIMAGELIST*)buttonImagelist.
  1041. #define ML_IPC_SKINNEDBUTTON_SETDROPDOWNSTATE 0x0012 // param = (WPARAM)bPressed.
  1042. #define ML_IPC_SKINNEDBUTTON_GETIDEALSIZE 0x0013 // param = (WPARAN)(LPCWSTR)pszText - if pszText == NULL will use button text. Returns: HIWORD - height, LOWORD width
  1043. #define MLSkinnedButton_SetImageList(/*HWND*/__hwndSkinned, /*HMLIMGLST*/ __hmlil, /*INT*/__normalIndex, \
  1044. /*INT*/__pressedIndex, /*INT*/ __hoverIndex, /*INT*/__disabledIndex) \
  1045. { MLBUTTONIMAGELIST __buttonImagelist;\
  1046. __buttonImagelist.hmlil = (__hmlil);\
  1047. __buttonImagelist.normalIndex = (__normalIndex);\
  1048. __buttonImagelist.pressedIndex = (__pressedIndex);\
  1049. __buttonImagelist.hoverIndex = (__hoverIndex);\
  1050. __buttonImagelist.disabledIndex = (__disabledIndex);\
  1051. (BOOL)SENDMLIPC((HWND)(__hwndSkinned), ML_IPC_SKINNEDBUTTON_SETIMAGELIST, ((WPARAM)(MLBUTTONIMAGELIST*)(&__buttonImagelist)));}
  1052. #define MLSkinnedButton_GetImageList(/*HWND*/__hwndSkinned, /*MLBUTTONIMAGELIST* */ __pButtonImagelist)\
  1053. (BOOL)SENDMLIPC((HWND)(__hwndSkinned), ML_IPC_SKINNEDBUTTON_GETIMAGELIST, ((WPARAM)(MLBUTTONIMAGELIST*)(__pButtonImagelist)))
  1054. #define MLSkinnedButton_SetDropDownState(/*HWND*/__hwndSkinned, /*BOOL*/ __bPressed)\
  1055. SENDMLIPC((HWND)(__hwndSkinned), ML_IPC_SKINNEDBUTTON_SETDROPDOWNSTATE, ((WPARAM)(__bPressed)))
  1056. #define MLSkinnedButton_GetIdealSize(/*HWND*/__hwndSkinned, /*LPCWSTR*/__pszText)\
  1057. ((DWORD)SENDMLIPC((HWND)(__hwndSkinned), ML_IPC_SKINNEDBUTTON_GETIDEALSIZE, (WPARAM)(__pszText)))
  1058. // Skinned static
  1059. #define ML_IPC_SKINNEDSTATIC_GETIDEALSIZE 0x0014 // param = (WPARAN)(LPCWSTR)pszText - if pszText == NULL will use button text. Returns: HIWORD - height, LOWORD width
  1060. #define MLSkinnedStatic_GetIdealSize(/*HWND*/__hwndSkinned, /*LPCWSTR*/__pszText)\
  1061. ((DWORD)SENDMLIPC((HWND)(__hwndSkinned), ML_IPC_SKINNEDSTATIC_GETIDEALSIZE, (WPARAM)(__pszText)))
  1062. //////////////////////////////////////////////////////////////////////////////////
  1063. // WebInfo
  1064. ///
  1065. typedef struct _WEBINFOCREATE
  1066. {
  1067. HWND hwndParent; // HWND of the parent
  1068. UINT uMsgQuery; // message that WebInfo can use to query filename
  1069. INT x; // position x
  1070. INT y; // position y
  1071. INT cx; // size cx;
  1072. INT cy; // size cy ( if size cy == -1 height will be set to preffer height and cy will be modified
  1073. INT ctrlId; // ctrlId you want to use
  1074. } WEBINFOCREATE;
  1075. typedef struct _WEBINFOSHOW
  1076. {
  1077. LPCWSTR pszFileName; // File name.
  1078. UINT fFlags; // flags WIDF_XXX
  1079. } WEBINFOSHOW;
  1080. #define WISF_NORMAL 0x0000
  1081. #define WISF_FORCE 0x0001 // even if file name same as was in previous call command will be executed
  1082. #define WISF_MESSAGE 0x0100 // pszFileName contains pointer to the message that need to be displayed
  1083. // Messages
  1084. #define ML_IPC_CREATEWEBINFO 0x1410L // param = (WPARAM)(WEBINFOCREATE*)pWebInfoParam. Return HWND of the WebInfo dialog or NULL if error
  1085. /// Send this messages directly to the window
  1086. #define ML_IPC_WEBINFO_RELEASE 0x0100 // Call this in your WM_DESTROY.
  1087. #define ML_IPC_WEBINFO_SHOWINFO 0x0101 // Call this to show file info. param = (WPARAM)(WEBINFOSHOW)pWebInfoShow. Returns TRUE on ok.
  1088. ////////// FolderBrowser
  1089. #define FOLDERBROWSER_NAME L"MLFolderBrowser"
  1090. // styles
  1091. #define FBS_IGNOREHIDDEN 0x0001
  1092. #define FBS_IGNORESYSTEM 0x0002
  1093. #define FBM_FIRST 0x2100
  1094. #define FBM_GETBKCOLOR (FBM_FIRST + 0)
  1095. #define FolderBrowser_GetBkColor(hwnd) \
  1096. ((COLORREF)SNDMSG((hwnd), FBM_GETBKCOLOR, 0, 0L))
  1097. #define FBM_SETBKCOLOR (FBM_FIRST + 1)
  1098. #define FolderBrowser_SetBkColor(hwnd, clrBk) \
  1099. ((BOOL)SNDMSG((hwnd), FBM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk)))
  1100. #define FBM_GETTEXTCOLOR (FBM_FIRST + 2)
  1101. #define FolderBrowser_GetTextColor(hwnd) \
  1102. ((COLORREF)SNDMSG((hwnd), FBM_GETTEXTCOLOR, 0, 0L))
  1103. #define FBM_SETTEXTCOLOR (FBM_FIRST + 3)
  1104. #define FolderBrowser_SetTextColor(hwnd, clrText) \
  1105. ((BOOL)SNDMSG((hwnd), FBM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText)))
  1106. typedef struct _FOLDERBROWSERINFO
  1107. {
  1108. DWORD cbSize;
  1109. HWND hwndDraw;
  1110. HWND hwndActive;
  1111. size_t activeColumn;
  1112. } FOLDERBROWSERINFO;
  1113. #define FBM_GETFOLDERBROWSERINFO (FBM_FIRST + 4)
  1114. #define FolderBrowser_GetInfo(__hwnd, /*FOLDERBROWSERINFO* */__pControlInfo) \
  1115. ((BOOL)SNDMSG((__hwnd), FBM_GETFOLDERBROWSERINFO, 0, (LPARAM)(__pControlInfo)))
  1116. #define FBM_SETROOT (FBM_FIRST + 5)
  1117. #define FolderBrowser_SetRoot(__hwnd, /*LPCWSTR*/__pszRoot) \
  1118. ((BOOL)SNDMSG((__hwnd), FBM_SETROOT, 0, (LPARAM)(__pszRoot)))
  1119. #define FBM_GETROOT (FBM_FIRST + 6)
  1120. #define FolderBrowser_GetRoot(__hwnd, /*LPWSTR*/__pszBuffer, /*INT*/ __cchMax) \
  1121. ((INT)SNDMSG((__hwnd), FBM_GETROOT, (WPARAM)(__cchMax), (LPARAM)(__pszBuffer)))
  1122. typedef HANDLE (CALLBACK *FBC_FINDFIRSTFILE)(LPCWSTR /*lpFileName*/, WIN32_FIND_DATAW* /*lpFindFileData*/);
  1123. typedef BOOL (CALLBACK *FBC_FINDNEXTFILE)(HANDLE /*hFindFile*/, WIN32_FIND_DATAW* /*lpFindFileData*/);
  1124. typedef BOOL (CALLBACK *FBC_FINDCLOSE)(HANDLE /*hFindFile*/);
  1125. typedef struct _FILESYSTEMINFO
  1126. {
  1127. UINT cbSize;
  1128. FBC_FINDFIRSTFILE fnFindFirstFile;
  1129. FBC_FINDNEXTFILE fnFindNextFile;
  1130. FBC_FINDCLOSE fnFindClose;
  1131. } FILESYSTEMINFO;
  1132. #define FBM_SETFILESYSTEMINFO (FBM_FIRST + 7) // lParam = (FILESYSTEMINFO*)pFSInfo ; Set pFSInfo == NULL to use default.
  1133. #define FolderBrowser_SetFileSystemInfo(__hwnd, /*FILESYSTEMINFO* */__pFSInfo) \
  1134. ((BOOL)SNDMSG((__hwnd), FBM_SETFILESYSTEMINFO, 0, (LPARAM)(__pFSInfo)))
  1135. #define FBM_GETCURRENTPATH (FBM_FIRST + 8) // wParam - (INT) cchTextMax, lParam = (LPWSTR*)pszText.
  1136. #define FolderBrowser_GetCurrentPath(__hwnd, /*LPWSTR */ __pszText, /*INT*/ __cchTextMax) \
  1137. ((BOOL)SNDMSG((__hwnd), FBM_GETCURRENTPATH, (WPARAM)(__cchTextMax), (LPARAM)(__pszText)))
  1138. #define FBM_SETCURRENTPATH (FBM_FIRST + 9) // lParam = (LPCWSTR*)pszPath.
  1139. #define FolderBrowser_SetCurrentPath(__hwnd, /*LPCWSTR */ __pszPath, /*BOOL*/__bRedraw) \
  1140. ((BOOL)SNDMSG((__hwnd), FBM_SETCURRENTPATH, (WPARAM)(__bRedraw), (LPARAM)(__pszPath)))
  1141. #define FBM_GETFILESYSTEMINFO (FBM_FIRST + 10) // lParam = (FILESYSTEMINFO*)pFSInfo;
  1142. #define FolderBrowser_GetFileSystemInfo(__hwnd, /*FILESYSTEMINFO* */__pFSInfo) \
  1143. ((BOOL)SNDMSG((__hwnd), FBM_GETFILESYSTEMINFO, 0, (LPARAM)(__pFSInfo)))
  1144. #define EVF_NOEXTRARSPACE 0x001
  1145. #define EVF_NOEXTRALSPACE 0x002
  1146. #define EVF_NOREDRAW 0x004
  1147. #define FBM_ENSUREVISIBLE (FBM_FIRST + 11)
  1148. #define FolderBrowser_EnsureVisible(__hwnd, /*INT*/ __columnIndex, /*UINT*/ __uFlags) \
  1149. ((BOOL)SNDMSG((__hwnd), FBM_ENSUREVISIBLE, MAKEWPARAM((__columnIndex), (__uFlags)), 0L))
  1150. // Folder browser notifications
  1151. #define FBN_FIRST (0U-3000U)
  1152. #define FBN_SELCHANGED (FBN_FIRST + 1) //phdr = (NMHDR*)lParam. No return value.
  1153. ////////// FileView
  1154. typedef struct __MLFILEVIEWCREATESTRUCT
  1155. {
  1156. HWND hwndParent;
  1157. UINT fStyle;
  1158. HWND hwndInsertAfter;
  1159. INT x;
  1160. INT y;
  1161. INT cx;
  1162. INT cy;
  1163. } MLFILEVIEWCREATESTRUCT;
  1164. #define ML_IPC_CREATEFILEVIEW 0x1412L //param = (WPARAM)(MLFILEVIEWCREATESTRUCT*)pmlFileViewCreateStruct
  1165. // styles
  1166. #define FVS_VIEWMASK 0x000F
  1167. #define FVS_LISTVIEW 0x0000
  1168. #define FVS_ICONVIEW 0x0001
  1169. #define FVS_DETAILVIEW 0x0002
  1170. #define FVS_IGNOREHIDDEN 0x0010
  1171. #define FVS_HIDEEXTENSION 0x0020
  1172. #define FVS_SHOWAUDIO 0x0100
  1173. #define FVS_SHOWVIDEO 0x0200
  1174. #define FVS_SHOWPLAYLIST 0x0400
  1175. #define FVS_SHOWUNKNOWN 0x0800
  1176. #define FVS_ENQUEUE 0x1000 // will use enqueue as default command
  1177. // messages
  1178. #define MLFVM_FIRST (WM_APP + 0x0001)
  1179. #define FVM_SETROOT (MLFVM_FIRST + 0)
  1180. #define FileView_SetRoot(/*HWND*/ __hwndFV, /*LPCWSTR*/ __pszRoot)\
  1181. ((BOOL)SENDMSG((__hwndFV), FVM_SETROOT, 0, (LPARAM)(__pszRoot)))
  1182. #define FVM_GETROOT (MLFVM_FIRST + 1)
  1183. #define FileView_GetRoot(/*HWND*/ __hwndFV, /*LPCWSTR*/ __pszBuffer, /*INT*/ __cchMax)\
  1184. ((INT)SENDMSG((__hwndFV), FVM_SETROOT, (WPARAM)(__cchMax), (LPARAM)(__pszBuffer)))
  1185. #define FVM_REFRESH (MLFVM_FIRST + 2)
  1186. #define FileView_Refresh(/*HWND*/ __hwndFV, /*BOOL*/ __bIncludeFolder)\
  1187. ((BOOL)SENDMSG((__hwndFV), FVM_REFRESH, (WPARAM)(__bIncludeFolder), 0L))
  1188. #define FVM_SETSTYLE (MLFVM_FIRST + 3)
  1189. #define FileView_SetStyle(/*HWND*/ __hwndFV, /*UINT*/ _uStyle, /*UINT*/ _uStyleMask)\
  1190. ((BOOL)SENDMSG((__hwndFV), FVM_SETSTYLE, (WPARAM)(_uStyleMask), (LPARAM)(_uStyle)))
  1191. #define FVM_GETSTYLE (MLFVM_FIRST + 4)
  1192. #define FileView_GetStyle(/*HWND*/ __hwndFV)\
  1193. ((UINT)SENDMSG((__hwndFV), FVM_GETSTYLE, 0, 0L))
  1194. #define FVM_SETSORT (MLFVM_FIRST + 5)
  1195. #define FileView_SetSort(/*HWND*/ __hwndFV, /*UINT*/ __uColumn, /*BOOL*/ __bAscending)\
  1196. ((BOOL)SENDMSG((__hwndFV), FVM_SETSORT, MAKEWPARAM((__uColumn), (__bAscending)), 0L))
  1197. #define FVM_GETSORT (MLFVM_FIRST + 6) // returns MAKELONG(sortColumn, bAscending) or -1 if error.
  1198. #define FileView_GetSort(/*HWND*/ __hwndFV)\
  1199. ((DWORD)SENDMSG((__hwndFV), FVM_GETSORT, 0, 0L))
  1200. #define FVM_GETCOLUMNCOUNT (MLFVM_FIRST + 7) // wParam - not used, lParam - not used, returns column count in current view
  1201. #define FileView_GetColumnCount(/*HWND*/ __hwndFV)\
  1202. ((INT)SENDMSG((__hwndFV), FVM_GETCOLUMNCOUNT, 0, 0L))
  1203. // columns
  1204. #define FVCOLUMN_NAME 0
  1205. #define FVCOLUMN_SIZE 1
  1206. #define FVCOLUMN_TYPE 2
  1207. #define FVCOLUMN_MODIFIED 3
  1208. #define FVCOLUMN_CREATED 4
  1209. #define FVCOLUMN_EXTENSION 5
  1210. #define FVCOLUMN_ATTRIBUTES 6
  1211. #define FVCOLUMN_ARTIST 7
  1212. #define FVCOLUMN_ALBUM 8
  1213. #define FVCOLUMN_TITLE 9
  1214. #define FVCOLUMN_INMLDB 10
  1215. #define FVCOLUMN_GENRE 11
  1216. #define FVCOLUMN_COMMENT 12
  1217. #define FVCOLUMN_LENGTH 13
  1218. #define FVCOLUMN_BITRATE 14
  1219. #define FVCOLUMN_TRACK 15
  1220. #define FVCOLUMN_DISC 16
  1221. #define FVCOLUMN_YEAR 17
  1222. #define FVCOLUMN_PUBLISHER 18
  1223. #define FVCOLUMN_COMPOSER 19
  1224. #define FVCOLUMN_ALBUMARTIST 20
  1225. #define FVM_GETCOLUMNARRAY (MLFVM_FIRST + 8) // wParam - (WPARAM)iCount, lParam - (LPARAM)(UINT*)puArray, returns actually copied count.
  1226. #define FileView_GetColumnArray(/*HWND*/ __hwndFV, /*INT*/__iCount, /*UINT* */ __puArray)\
  1227. ((INT)SENDMSG((__hwndFV), FVM_GETCOLUMNARRAY, (WPARAM)(__iCount), (LPARAM)(__puArray)))
  1228. #define FVM_DELETECOLUMN (MLFVM_FIRST + 9) // wParam - (WPARAM)ufvColumn, lParam - not used, returns TRUE on success
  1229. #define FileView_DeleteColumn(/*HWND*/ __hwndFV, /*UINT*/__ufvColumn)\
  1230. ((BOOL)SENDMSG((__hwndFV), FVM_DELETECOLUMN, (WPARAM)(__ufvColumn), 0L))
  1231. #define FVCF_WIDTH 1
  1232. #define FVCF_ORDER 2
  1233. #define FVCF_WIDTHMIN 4
  1234. #define FVCF_WIDTHMAX 8
  1235. #define FVCO_DEFAULT_ORDER ((INT)0x80000000) // can be used only with FVM_INSERTCOLUMN
  1236. typedef struct _FVCOLUMN
  1237. {
  1238. UINT mask;
  1239. UINT id;
  1240. INT width;
  1241. INT order;
  1242. INT widthMin;
  1243. INT widthMax;
  1244. } FVCOLUMN;
  1245. #define FVM_INSERTCOLUMN (MLFVM_FIRST + 10) // wParam - not used, lParam - (LPARAM)(FVCOLUMN*)pfvColumn, returns column index or -1
  1246. #define FileView_InsertColumn(/*HWND*/ __hwndFV, /*FVCOLUMN* */__pfvColumn)\
  1247. ((INT)SENDMSG((__hwndFV), FVM_INSERTCOLUMN, (WPARAM)0, (LPARAM)(__pfvColumn)))
  1248. #define FVM_GETCOLUMNAME (MLFVM_FIRST + 11) // wParam - MAKEWPARAM(ufvColumn, cchTextMax), lParam - (LPARAM)(LPWSTR)pszText, returns TRUE if ok
  1249. #define FileView_GetColumnName(/*HWND*/ __hwndFV, /*UINT*/__ufvColumn, /*INT*/__cchTextMax, /*LPWSTR*/__pszText)\
  1250. ((BOOL)SENDMSG((__hwndFV), FVM_GETCOLUMNAME, MAKEWPARAM((__ufvColumn), (__cchTextMax)), (LPARAM)(__pszText)))
  1251. #define FVM_SETFILESYSTEMINFO (MLFVM_FIRST + 12) // wParam - not used,lParam = (FILESYSTEMINFO*)pFSInfo, returns TRUE on success.
  1252. #define FileView_SetFileSystemInfo(/*HWND*/ __hwndFV, /*FILESYSTEMINFO* */__pFSInfo) \
  1253. ((BOOL)SNDMSG((__hwndFV), FVM_SETFILESYSTEMINFO, 0, (LPARAM)(__pFSInfo)))
  1254. #define FVM_GETFILESYSTEMINFO (MLFVM_FIRST + 13) // wParam - not used,lParam = (FILESYSTEMINFO*)pFSInfo, returns TRUE on success.
  1255. #define FileView_GetFileSystemInfo(/*HWND*/ __hwndFV, /*FILESYSTEMINFO* */__pFSInfo) \
  1256. ((BOOL)SNDMSG((__hwndFV), FVM_GETFILESYSTEMINFO, 0, (LPARAM)(__pFSInfo)))
  1257. #define FVM_GETFILECOUNT (MLFVM_FIRST + 14) // wParam - not used,lParam = not used, returns the number of items.
  1258. #define FileView_GetFileCount(/*HWND*/ __hwndFV) \
  1259. ((INT)SNDMSG((__hwndFV), FVM_GETFILECOUNT, 0, 0L))
  1260. #define FVM_GETSELECTEDCOUNT (MLFVM_FIRST + 15) // wParam - not used,lParam = not used, Returns the number of selected items.
  1261. #define FileView_GetSelectedCount(/*HWND*/ __hwndFV) \
  1262. ((INT)SNDMSG((__hwndFV), FVM_GETSELECTEDCOUNT, 0, 0L))
  1263. #define FVNF_ALL 0x0000
  1264. #define FVNF_FOCUSED 0x0001
  1265. #define FVNF_SELECTED 0x0002
  1266. #define FVNF_CUT 0x0004
  1267. #define FVNF_DROPHILITED 0x0008
  1268. #define FVNF_PLAYABLE 0x0080
  1269. #define FVNF_ABOVE 0x0100
  1270. #define FVNF_BELOW 0x0200
  1271. #define FVNF_TOLEFT 0x0400
  1272. #define FVNF_TORIGHT 0x0800
  1273. #define FVM_GETNEXTFILE (MLFVM_FIRST + 16) // wParam - (WPARAM)(INT)iStart, lParam = (LPARAM)(UINT)uFlags, Returns the index of the next file if successful, or -1 otherwise.
  1274. #define FileView_GetNextFile(/*HWND*/ __hwndFV, /*INT*/ __iStart, /*UINT*/ __uFlags) \
  1275. ((INT)SNDMSG((__hwndFV), FVM_GETNEXTFILE, (WPARAM)(__iStart), (LPARAM)(__uFlags)))
  1276. // file states
  1277. #define FVFS_FOCUSED 0x0001 // The file has the focus, so it is surrounded by a standard focus rectangle. Although more than one file may be selected, only one file can have the focus.
  1278. #define FVFS_SELECTED 0x0002 // The file is selected.
  1279. #define FVFS_CUT 0x0004 // The file is marked for a cut-and-paste operation.
  1280. #define FVFS_DROPHILITED 0x0008 // The file is highlighted as a drag-and-drop target.
  1281. // FileView file types
  1282. #define FVFT_UNKNOWN 0
  1283. #define FVFT_AUDIO 1
  1284. #define FVFT_VIDEO 2
  1285. #define FVFT_PLAYLIST 3
  1286. #define FVFT_LAST FVFT_PLAYLIST
  1287. #define FVIF_TEXT 0x0001
  1288. #define FVIF_STATE 0x0002
  1289. #define FVIF_ATTRIBUTES 0x0004
  1290. #define FVIF_SIZE 0x0008
  1291. #define FVIF_CREATETIME 0x0010
  1292. #define FVIF_ACCESSTIME 0x0020
  1293. #define FVIF_WRITETIME 0x0040
  1294. #define FVIF_TYPE 0x0080
  1295. typedef struct __FVITEM
  1296. {
  1297. UINT mask;
  1298. UINT state;
  1299. UINT stateMask;
  1300. LPWSTR pszText; // in some case returned pszText can be pointed on internal buffer and not one that was provided
  1301. INT cchTextMax;
  1302. UINT uAttributes;
  1303. DWORD dwSizeLow;
  1304. DWORD dwSizeHigh;
  1305. FILETIME ftCreationTime;
  1306. FILETIME ftLastAccessTime;
  1307. FILETIME ftLastWriteTime;
  1308. WORD wType;
  1309. } FVITEM, *PFVITEM;
  1310. #define FVM_GETFILE (MLFVM_FIRST + 17) // wParam - (WPARAM)(INT)iFile, lParam = (LPARAM)(FVITEM*)pFile, Returns TRUE if successful, or FALSE otherwise.
  1311. #define FileView_GetFile(/*HWND*/ __hwndFV, /*INT*/ __iFile, /*PFVITEM*/ __pFile) \
  1312. ((BOOL)SNDMSG((__hwndFV), FVM_GETFILE, (WPARAM)(__iFile), (LPARAM)(__pFile)))
  1313. #define FVM_GETCURRENTPATH (MLFVM_FIRST + 18) // wParam - (WPARAM)(INT)cchPathMax, lParam = (LPARAM)(LPWSTR)pszPath, Returns TRUE if successful, or FALSE otherwise.
  1314. #define FileView_GetCurrentPath(/*HWND*/ __hwndFV, /*LPWSTR*/ __pszBuffer, /*INT*/ __cchBufferMax) \
  1315. ((BOOL)SNDMSG((__hwndFV), FVM_GETCURRENTPATH, (WPARAM)(__cchBufferMax), (LPARAM)(__pszBuffer)))
  1316. #define FVM_GETFOLDERBROWSER (MLFVM_FIRST + 19) // wParam - not used, lParam - not used, Returns HWND of the folderbrowser.
  1317. #define FileView_GetFoderBrowser(/*HWND*/ __hwndFV) \
  1318. ((HWND)SNDMSG((__hwndFV), FVM_GETFOLDERBROWSER, 0, 0L))
  1319. #define FVM_GETFOLDERSIZE (MLFVM_FIRST + 20) // wParam - (WPARAM)(BOOL)bSelectionOnly, lParam - (LPARAM)(DWORD*)pdwFoldeSizeHigh (optional), Returns dwSizeLow.
  1320. #define FileView_GetFoderSize(/*HWND*/ __hwndFV, /*BOOL*/ __bSelectionOnly, /*LPDWROD*/ __pdwFoldeSizeHigh) \
  1321. ((DWORD)SNDMSG((__hwndFV), FVM_GETFOLDERSIZE, (WPARAM)(__bSelectionOnly), (LPARAM)(__pdwFoldeSizeHigh)))
  1322. #define FVM_GETSTATUSTEXT (MLFVM_FIRST + 21) // wParam - (WPARAM)(INT)cchPathMax, lParam = (LPARAM)(LPWSTR)pszPath, Returns TRUE if successful, or FALSE otherwise.
  1323. #define FileView_GetStatusText(/*HWND*/ __hwndFV, /*LPWSTR*/ __pszText, /*INT*/ __cchTextMax) \
  1324. ((BOOL)SNDMSG((__hwndFV), FVM_GETSTATUSTEXT, (WPARAM)(__cchTextMax), (LPARAM)(__pszText)))
  1325. #define FVEF_AUDIO 0x0001
  1326. #define FVEF_VIDEO 0x0002
  1327. #define FVEF_PLAYLIST 0x0004
  1328. #define FVEF_UNKNOWN 0x0008
  1329. #define FVEF_ALLKNOWN (FVEF_AUDIO | FVEF_VIDEO| FVEF_PLAYLIST)
  1330. #define FVEF_ALL (FVEF_ALLKNOWN | FVEF_UNKNOWN)
  1331. #define FVM_ENQUEUESELECTION (MLFVM_FIRST + 22) // wParam - (WPARAM)(UINT)uEnqueueFilter, lParam - (LPARAM)(INT*)pnFocused, Returns number of files sent to playlist. pnFocused - optional (if not null will contain playlist index of focused item)
  1332. #define FileView_EnqueueSelection(/*HWND*/ __hwndFV, /*UINT*/ __uEnqueueFilter, /*PINT*/__pnFocused) \
  1333. ((BOOL)SNDMSG((__hwndFV), FVM_ENQUEUESELECTION, (WPARAM)(__uEnqueueFilter), (LPARAM)(__pnFocused)))
  1334. #define FVM_ISFILEPLAYABLE (MLFVM_FIRST + 23) // wParam - (WPARAM)(UINT)uEnqueueFilter, lParam - (LPARAM)(INT)iFile - file index, Returns TRUE if successful, or FALSE otherwise.
  1335. #define FileView_IsFilePlayable(/*HWND*/ __hwndFV, /*INT*/ __iFile, /*UINT*/ __uEnqueueFilter) \
  1336. ((BOOL)SNDMSG((__hwndFV), FVM_ISFILEPLAYABLE, (WPARAM)(__uEnqueueFilter), (LPARAM)(__iFile)))
  1337. #define FVM_SETFILESTATE (MLFVM_FIRST + 24) // wParam - (WPARAM)(INT)iFile ( if -1 applyed to all files), (LPARAM)(LPFVITEM)pFile - only stateMask and state are used, Returns TRUE if successful, or FALSE otherwise.
  1338. #define FileView_SetFileState(/*HWND*/ __hwndFV, /*INT*/ __iFile, /*UINT*/ __uMask, /*UINT*/ __uData) \
  1339. { FVITEM __fvi;\
  1340. __fvi.stateMask = __uMask;\
  1341. __fvi.state = __uData;\
  1342. SNDMSG((__hwndFV), FVM_SETFILESTATE, (WPARAM)(__iFile), (LPARAM)(LV_ITEM *)&__fvi);}
  1343. #define FVMENU_OPTIONS 0
  1344. #define FVMENU_COLUMNS 1
  1345. #define FVMENU_ARRANGEBY 2
  1346. #define FVMENU_PLAY 3
  1347. #define FVMENU_FILEVIEWCONTEXT 4
  1348. #define FVMENU_FILEOPCONTEXT 5
  1349. #define FVMENU_FILECONTEXT 6 // in getMenu will be resolved to FVMENU_FILEVIEWCONTEXT or FVMENU_FILEOPCONTEXT
  1350. #define FVMENU_VIEWMODE 7
  1351. #define IDM_COLUMN_SHOW_MIN 60000
  1352. #define IDM_COLUMN_SHOW_MAX 60099
  1353. #define IDM_COLUMN_ARRANGE_MIN 60100
  1354. #define IDM_COLUMN_ARRANGE_MAX 60199
  1355. #define FVM_GETMENU (MLFVM_FIRST + 25) // wParam - (WPARAM)(UINT)uMenuType, lParam - not used.
  1356. #define FileView_GetMenu(/*HWND*/ __hwndFV, /*UINT*/ __uMenuType) \
  1357. ((HMENU)SNDMSG((__hwndFV), FVM_GETMENU, (WPARAM)(__uMenuType), 0L))
  1358. #define FVA_PLAY 0
  1359. #define FVA_ENQUEUE 1
  1360. #define FVM_GETACTIONCMD (MLFVM_FIRST + 26) // wParam - (WPARAM)(UINT)uAction, lParam - not used. returns 0 - if no cmd, otherwise cmd id.
  1361. #define FileView_GetActionCommand(/*HWND*/ __hwndFV, /*UINT*/ __uAction) \
  1362. ((UINT)SNDMSG((__hwndFV), FVM_GETACTIONCMD, (WPARAM)(__uAction), 0L))
  1363. #define FVHT_NOWHERE 0x0001
  1364. #define FVHT_ONFILEICON 0x0002
  1365. #define FVHT_ONFILELABEL 0x0004
  1366. #define FVHT_ONFILE (FVHT_ONFILEICON | FVHT_ONFILELABEL)
  1367. #define FVHT_ABOVE 0x0008
  1368. #define FVHT_BELOW 0x0010
  1369. #define FVHT_TORIGHT 0x0020
  1370. #define FVHT_TOLEFT 0x0040
  1371. typedef struct _FVHITTEST
  1372. {
  1373. POINT pt; // The position to hit test, in fileview client coordinates .
  1374. UINT uFlags; //
  1375. INT iItem; // file index;
  1376. } FVHITTEST;
  1377. #define FVM_HITTEST (MLFVM_FIRST + 27) // wParam - not used, lParam - (LPARAM)(FVHITTEST*)pHitTest. Returns the index of the item at the specified position, if any, or -1 otherwise.
  1378. #define FileView_HitTest(/*HWND*/ __hwndFV, /*FVHITTEST* */ __pHitTest) \
  1379. ((INT)SNDMSG((__hwndFV), FVM_HITTEST, 0, (LPARAM)__pHitTest))
  1380. #define FVM_GETCOLUMNWIDTH (MLFVM_FIRST + 28) // wParam - (WPARAM)ufvColumn - column id, lParam - not used. returns column width
  1381. #define FileView_GetColumnWidth(/*HWND*/ __hwndFV, /*UINT*/__ufvColumn)\
  1382. ((BOOL)SENDMSG((__hwndFV), FVM_GETCOLUMNWIDTH, (WPARAM)(__ufvColumn), 0L))
  1383. #define FVM_SETCURRENTPATH (MLFVM_FIRST + 29)
  1384. #define FileView_SetCurrentPath(__hwnd, /*LPCWSTR */ __pszPath, /*BOOL*/__bRedraw) \
  1385. ((BOOL)SNDMSG((__hwnd), FVM_SETCURRENTPATH, (WPARAM)(__bRedraw), (LPARAM)(__pszPath)))
  1386. #define FVM_GETDIVIDERPOS (MLFVM_FIRST + 30)
  1387. #define FileView_GetDividerPos(__hwnd) \
  1388. ((INT)SNDMSG((__hwnd), FVM_GETDIVIDERPOS, 0, 0L))
  1389. #define FVRF_VALIDATE 0x0001
  1390. #define FVRF_NOREDRAW 0x0002
  1391. #define FVM_SETDIVIDERPOS (MLFVM_FIRST + 31)
  1392. #define FileView_SetDividerPos(__hwnd, /*INT*/ __nPos, /*UINT*/ __uFlags) \
  1393. ((INT)SNDMSG((__hwnd), FVM_SETDIVIDERPOS, (__nPos), (__uFlags)))
  1394. // Folder browser notifications
  1395. #define FVN_FIRST (0U-3200U)
  1396. #define FVN_FOLDERCHANGED (FVN_FIRST + 1) //phdr = (NMHDR*)lParam. No return value.
  1397. typedef struct __NMFVSTATECHANGED
  1398. {
  1399. NMHDR hdr;
  1400. INT iFrom;
  1401. INT iTo;
  1402. UINT uNewState;
  1403. UINT uOldState;
  1404. } NMFVSTATECHANGED;
  1405. #define FVN_STATECHANGED (FVN_FIRST + 2) //phdr = (NMFVSTATECHANGED*)lParam. No return value.
  1406. #define FVN_STATUSCHANGED (FVN_FIRST + 3) //phdr = (NMHDR*)lParam. No return value.
  1407. typedef struct __NMFVFILEACTIVATE
  1408. {
  1409. NMHDR hdr;
  1410. INT iFile;
  1411. UINT uNewState;
  1412. UINT uOldState;
  1413. POINT ptAction;
  1414. UINT uKeyFlags;
  1415. } NMFVFILEACTIVATE;
  1416. typedef struct __NMFVMENU
  1417. {
  1418. NMHDR hdr;
  1419. UINT uMenuType; // FVMENU_XXX
  1420. HMENU hMenu; // handle to thr menu
  1421. UINT uCommand; // FVN_MENUCOMMNAD - user selected command
  1422. POINT ptAction; // point where menu will be dispalayed
  1423. } NMFVMENU;
  1424. #define FVN_INITMENU (FVN_FIRST + 4) // phdr = (NMFVMENU*)lParam. Return TRUE to prevent menu from appearing, otherwise FALSE.
  1425. #define FVN_UNINITMENU (FVN_FIRST + 5) // phdr = (NMFVMENU*)lParam. no return value.
  1426. #define FVN_MENUCOMMAND (FVN_FIRST + 6) // phdr = (NMFVMENU*)lParam. Return TRUE to prevent command processing, otherwise FALSE.
  1427. // Fileview also implements this notifications: NM_CLICK, NM_DBLCLK, NM_RCLICK, NM_RDBLCLK. they all have phdr = (NMFVFILEACTIVATE*)lParam.
  1428. #endif // NULLOSFT_MEDIALIBRARY_IPC_EXTENSION_HEADER_0x0313
  1429. #if (defined _ML_HEADER_IMPMLEMENT && !defined _ML_HEADER_IMPMLEMENT_DONE)
  1430. #define _ML_HEADER_IMPMLEMENT_DONE
  1431. #ifdef __cplusplus
  1432. extern "C" {
  1433. #endif // __cplusplus
  1434. // {8A054D1F-E38E-4cc0-A78A-F216F059F57E}
  1435. const GUID MLIF_FILTER1_UID = { 0x8a054d1f, 0xe38e, 0x4cc0, { 0xa7, 0x8a, 0xf2, 0x16, 0xf0, 0x59, 0xf5, 0x7e } };
  1436. // {BE1A6A40-39D1-4cfb-8C33-D8988E8DD2F8}
  1437. const GUID MLIF_FILTER2_UID = { 0xbe1a6a40, 0x39d1, 0x4cfb, { 0x8c, 0x33, 0xd8, 0x98, 0x8e, 0x8d, 0xd2, 0xf8 } };
  1438. // {721E9E62-CC6D-4fd7-A6ED-DD4CD2B2612E}
  1439. const GUID MLIF_FILTER3_UID = { 0x721e9e62, 0xcc6d, 0x4fd7, { 0xa6, 0xed, 0xdd, 0x4c, 0xd2, 0xb2, 0x61, 0x2e } };
  1440. // {B6310C20-E731-44dd-83BD-FBC3349798F2}
  1441. const GUID MLIF_GRAYSCALE_UID = { 0xb6310c20, 0xe731, 0x44dd, { 0x83, 0xbd, 0xfb, 0xc3, 0x34, 0x97, 0x98, 0xf2 } };
  1442. // {526C6F4A-C979-4d6a-B8ED-1A90F5A26F7B}
  1443. const GUID MLIF_BLENDONBK_UID = { 0x526c6f4a, 0xc979, 0x4d6a, { 0xb8, 0xed, 0x1a, 0x90, 0xf5, 0xa2, 0x6f, 0x7b } };
  1444. // {E61C5E67-B2CC-4f89-9C95-40D18FCAF1F8}
  1445. const GUID MLIF_BUTTONBLEND_UID = { 0xe61c5e67, 0xb2cc, 0x4f89, { 0x9c, 0x95, 0x40, 0xd1, 0x8f, 0xca, 0xf1, 0xf8 } };
  1446. // {3619BA52-5088-4f21-9AF1-C5FCFE5AAA99}
  1447. const GUID MLIF_BUTTONBLENDPLUSCOLOR_UID = { 0x3619ba52, 0x5088, 0x4f21, { 0x9a, 0xf1, 0xc5, 0xfc, 0xfe, 0x5a, 0xaa, 0x99 } };
  1448. // {F1DD3228-7DA8-4524-B7D3-46F651BFB680}
  1449. const GUID MLIF_FILTER1_PRESERVE_ALPHA_UID = { 0xf1dd3228, 0x7da8, 0x4524, { 0xb7, 0xd3, 0x46, 0xf6, 0x51, 0xbf, 0xb6, 0x80 } };
  1450. #ifdef __cplusplus
  1451. }
  1452. #endif // __cplusplus
  1453. #endif //_ML_HEADER_IMPMLEMENT