開放処理とかまったくやってないです。手抜き。GetAttributeByNameを使う方法だとうまくいかないので、GetAttributeCountExで数を取得して、GetAttributeByIndexExで取得する感じですしおすし。
開放処理とかまったくやってないです。手抜き。GetAttributeByNameを使う方法だとうまくいかないので、GetAttributeCountExで数を取得して、GetAttributeByIndexExで取得する感じですしおすし。
#define IID_IWMMetadataEditor "{96406bd9-2b2b-11d3-b36b-00c04f6108ff}" #define IID_IWMMetadataEditor2 "{203cffe3-2e18-4fdf-b59d-6e71530534cf}" #define IID_IWMHeaderInfo "{96406bda-2b2b-11d3-b36b-00c04f6108ff}" #define IID_IWMHeaderInfo2 "{15cf9781-454e-482e-b393-85fae487a810}" #define IID_IWMHeaderInfo3 "{15CC68E3-27CC-4ecd-B222-3F5D02D80BD5}" #define IID_IWMImageInfo "{9F0AA3B6-7267-4D89-88F2-BA915AA5C4C6}" #usecom IWMMetadataEditor IID_IWMMetadataEditor #comfunc IWMMetadataEditor_Open 3 wptr #usecom IWMHeaderInfo3 IID_IWMHeaderInfo3 #comfunc IWMHeaderInfo3_GetAttributeByName 5 sptr, wstr, sptr, sptr, sptr #comfunc IWMHeaderInfo3_GetAttributeCountEx 17 sptr, sptr #comfunc IWMHeaderInfo3_GetAttributeByIndexEx 19 sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr #uselib "Wmvcore.dll" #func WMCreateEditor "WMCreateEditor" sptr pEditor = 0 WMCreateEditor varptr(pEditor) newcom pWMEdit, IID_IWMMetadataEditor, -1, pEditor dialog "mp3;*.wma", 16 IWMMetadataEditor_Open pWMEdit, refstr if stat != 0 : dialog "失敗" : end querycom pHeaderInfo, pWMEdit, IID_IWMHeaderInfo cAttributes = 0 IWMHeaderInfo3_GetAttributeCountEx pHeaderInfo, 0xFFFF, varptr(cAttributes) repeat cAttributes sdim szName, 1024 + 2 NameLen = 1024 Type = 0 LangIndex = 0 DataLength = 0 IWMHeaderInfo3_GetAttributeByIndexEx pHeaderInfo, 0, cnt, varptr(szName), varptr(NameLen), varptr(Type), varptr(LangIndex), 0, varptr(DataLength) if cnvwtos(szName) == "WM/Picture"{ sdim buf, DataLength IWMHeaderInfo3_GetAttributeByIndexEx pHeaderInfo, 0, cnt, varptr(szName), varptr(NameLen), varptr(Type), varptr(LangIndex), varptr(buf), varptr(DataLength) size = lpeek(buf, 9) ptr = lpeek(buf, 13) dupptr img, ptr, size, 2 memfile img, 0, size picload "MEM:test.jpg" } loop