Prev Previous Post   Next Post Next
Old 15th January 2011, 01:01   #1
Ravenhearty
Junior Member
 
Join Date: Jan 2011
Posts: 1
C# Get playing title

Greetings fellow developers, I'm making a small C# lib that queries Winamp for the currently playing song. So far I've written methods to get SampleRate, Bitrate, Channels, Position and Length of the playing song.

My problem is I cannot seem to make the IPC_GET_PLAYING_TITLE message to work.

My PInvoke of SendMessage:
code:
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);



And this is how I send the data and decode the result:
code:
public static string GetTitle()
{
IntPtr result = SendMessage(GetWinampHandle(), WM_WA_IPC, IntPtr.Zero, IPC_GET_PLAYING_TITLE);
string title = Marshal.PtrToStringUni(result);
return title;
}



The resulting string is always empty ( "" ). The SDK doesn't say if this message can be sent from external apps, its located in a section that says it can only be used by plugins, but a few other messages in the same section just above the IPC_GET_PLAYING_TITLE explicitly say that they can be used outside of Winamp.

Any help, thought or comments are welcomed thank you.
Ravenhearty is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump