|
|
Hi, I'm writing a background plug-in for WMP and I'm wondering if it's possible to retrieve the currently selected media item(s) in the Media Library, probably as IWMPMedia objects. I haven't found any information about this, but maybe there's an undocumented way?
I'm also wondering if there's a way (again, probably undocumented) to programmatically show WMP's Advanced Tag Editor-dialog for a given IWMPMedia object.
Greetings
Tim De Baets
|
|
hi,
try :attributeCount() with :getAttributeName() / getItemInfo()
greetings by OHR Jimmy
*** snip *** /* Xbase++ (Clipper) code for WMP 9/10 !!! only work if "media" is load in Playlist and "playing" !!! */
nCount := oWMP:currentPlaylist:count // are there some item in Playlist IF nCount > 0 // get current item (SDK 9/10) oItem := oWMP:controls:currentitem() // get number of attribute jMax := oItem:attributeCount() FOR j = 0 TO jMax-1 // 1st get name cName := oItem:getAttributeName(j) // now use the name to get value info cValue := oItem:getItemInfo(cName) // display it ? cName , cValue NEXT ENDIF *** eof ***
|
|
Thanks for the information, Jimmy, but as it's already pointed out in the code, that will only work to get info about the currently playing media item in WMP. Getting the media item(s) that are selected in the Media Library listview is something completely different. I would really like to know how to do this, because I want to make my plug-in add a custom menu-item to the right-click menu of the Media Library listview. Adding such a menu item isn't very hard, you just need to install a WH_CALLWNDPROC hook in WMP with SetWindowsHookEx, and use InsertMenuItem when the hook procedure receives a WM_INITMENUPOPUP message. But of course, I can't add any decent functionality to the custom menu item unless the plug-in knows what media items 'belong' to the right-click menu, i.e. what items are selected in the Media Library listview.
Greetings
Tim De Baets
On 19 jun, 21:56, "AUGE_OHR" <AUGE_OHR_NOSP...[ at ]CSI.COM> wrote:
[Quoted Text] > hi, > > try :attributeCount() with :getAttributeName() / getItemInfo() > > greetings by OHR > Jimmy > > *** snip *** > /* > Xbase++ (Clipper) code for WMP 9/10 > !!! only work if "media" is load in Playlist and "playing" !!! > */ > > nCount := oWMP:currentPlaylist:count > // are there some item in Playlist > IF nCount > 0 > // get current item (SDK 9/10) > oItem := oWMP:controls:currentitem() > // get number of attribute > jMax := oItem:attributeCount() > FOR j = 0 TO jMax-1 > // 1st get name > cName := oItem:getAttributeName(j) > // now use the name to get value info > cValue := oItem:getItemInfo(cName) > // display it > ? cName , cValue > NEXT > ENDIF > *** eof ***
|
|
Thanks for the information, Jimmy, but as it's already pointed out in the code, that will only work to get info about the currently playing media item in WMP. Getting the media item(s) that are selected in the Media Library listview is something completely different. I would really like to know how to do this, because I want to make my plug-in add a custom menu-item to the right-click menu of the Media Library listview. Adding such a menu item isn't very hard, you just need to install a WH_CALLWNDPROC hook in WMP with SetWindowsHookEx, and use InsertMenuItem when the hook procedure receives a WM_INITMENUPOPUP message. But of course, I can't add any decent functionality to the custom menu item unless the plug-in knows what media items 'belong' to the right-click menu, i.e. what items are selected in the Media Library listview.
Greetings
Tim De Baets
On 19 jun, 21:56, "AUGE_OHR" <AUGE_OHR_NOSP...[ at ]CSI.COM> wrote:
[Quoted Text] > hi, > > try :attributeCount() with :getAttributeName() / getItemInfo() > > greetings by OHR > Jimmy > > *** snip *** > /* > Xbase++ (Clipper) code for WMP 9/10 > !!! only work if "media" is load in Playlist and "playing" !!! > */ > > nCount := oWMP:currentPlaylist:count > // are there some item in Playlist > IF nCount > 0 > // get current item (SDK 9/10) > oItem := oWMP:controls:currentitem() > // get number of attribute > jMax := oItem:attributeCount() > FOR j = 0 TO jMax-1 > // 1st get name > cName := oItem:getAttributeName(j) > // now use the name to get value info > cValue := oItem:getItemInfo(cName) > // display it > ? cName , cValue > NEXT > ENDIF > *** eof ***
|
|
hi,
[Quoted Text] > Thanks for the information, Jimmy, but as it's already pointed out in > the code, that will only work to get info about the currently playing > media item in WMP. Getting the media item(s) that are selected in the > Media Library listview is something completely different.
look at IWMPMedia object and you will find the same Methode and Properties.
greetings by OHR Jimmy
|
|
Then what methods or properties should I use? Believe me, I have searched long enough and there doesn't seem to be a documented way of getting the selected items in WMP's Media Library. Besides that, I don't even know which IWMPMedia objects I should query; that's exactly my problem: I need to know which IWMPMedia objects are currently selected in the Media Library listview.
Greetings
Tim De Baets
On 21 jun, 08:00, "AUGE_OHR" <AUGE_OHR_NOSP...[ at ]CSI.COM> wrote:
[Quoted Text] > hi, > > > Thanks for the information, Jimmy, but as it's already pointed out in > > the code, that will only work to get info about the currently playing > > media item in WMP. Getting the media item(s) that are selected in the > > Media Library listview is something completely different. > > look at IWMPMedia object and you will find the same Methode > and Properties. > > greetings by OHR > Jimmy
|
|
inline --
<tdebaets[ at ]gmail.com> wrote in message news:1182384406.769684.160710[ at ]c77g2000hse.googlegroups.com...
[Quoted Text] > Thanks for the information, Jimmy, but as it's already pointed out in > the code, that will only work to get info about the currently playing > media item in WMP. Getting the media item(s) that are selected in the > Media Library listview is something completely different. I would > really like to know how to do this, because I want to make my plug-in > add a custom menu-item to the right-click menu of the Media Library > listview. Adding such a menu item isn't very hard, you just need to > install a WH_CALLWNDPROC hook in WMP with SetWindowsHookEx, and use > InsertMenuItem when the hook procedure receives a WM_INITMENUPOPUP > message. But of course, I can't add any decent functionality to the > custom menu item unless the plug-in knows what media items 'belong' to > the right-click menu, i.e. what items are selected in the Media > Library listview.
I did an application a while back that nneded to know some of the same type information. This was using WMP10 which had the listview that would display all of the albums, artists, genres, etc. And deleting one of some type of them never generated a delete event. The other two did. So, in desparation, I ended up injecting a hook like you did. I monitored the listview selection changed message and when the count declined by one, I generated my own delete event.
As long as you have a hook running, you can derive your own listview class and subclass the WMP listview.
As far as I could tell, there is no way to monitor the WMP user interface with the interfaces given.
Mike P
> Greetings > > Tim De Baets > > > On 19 jun, 21:56, "AUGE_OHR" <AUGE_OHR_NOSP...[ at ]CSI.COM> wrote: >> hi, >> >> try :attributeCount() with :getAttributeName() / getItemInfo() >> >> greetings by OHR >> Jimmy >> >> *** snip *** >> /* >> Xbase++ (Clipper) code for WMP 9/10 >> !!! only work if "media" is load in Playlist and "playing" !!! >> */ >> >> nCount := oWMP:currentPlaylist:count >> // are there some item in Playlist >> IF nCount > 0 >> // get current item (SDK 9/10) >> oItem := oWMP:controls:currentitem() >> // get number of attribute >> jMax := oItem:attributeCount() >> FOR j = 0 TO jMax-1 >> // 1st get name >> cName := oItem:getAttributeName(j) >> // now use the name to get value info >> cValue := oItem:getItemInfo(cName) >> // display it >> ? cName , cValue >> NEXT >> ENDIF >> *** eof *** >
|
|
|