Thu Sep 23 2004
I don't know whom this would benefit but someone building a blog posting tool for the desktop, but anyway here's the code that I converted from the jscript example that comes with the Windows Media Player bloggingpowertoy :
System;
Microsoft.Win32;
MediaPlayerInfo
{
GetCurrentlyPlayingMedia(){
RegistryKey regKey = Registry.CurrentUser;
regKey = regKey.OpenSubKey();
displayString = ;
hasMetadata = ;
trackInfo = ;
{
trackInfo = regKey.GetValue().ToString();
(trackInfo.Length != 0){
hasMetadata = ;
displayString += trackInfo + ;
}
}{
{
trackInfo = ;
trackInfo = regKey.GetValue().ToString();
(trackInfo.Length != 0){
hasMetadata = ;
displayString += trackInfo + ;
}
}{}
}
{
trackInfo = ;
trackInfo = regKey.GetValue().ToString();
(trackInfo.Length != 0){
hasMetadata = ;
displayString += + trackInfo + ;
}
}{}
{
trackInfo = ;
trackInfo = regKey.GetValue().ToString();
(trackInfo.Length != 0){
hasMetadata = ;
displayString += + trackInfo;
}
} {}
{
trackInfo = ;
trackInfo = regKey.GetValue().ToString();
(trackInfo.Length != 0){
hasMetadata = ;
displayString += + trackInfo;
}
}{}
(!hasMetadata){
displayString += ;
}
displayString += ;
displayString;
}
}It could probably stand to be a bit more flexible - ie user-defined by a template like w.bloggar, but for the basics it works great! Oh yeah, and let's not forget the output: