mynetx
Skinning Contest Winner
Microsoft insider
Posts: 1175 Reputation: 33
37 / /
Joined: Jul 2007
|
RE: Help needed with showing my own element under personal message
jscript code: function setNowPlaying(enabled, type, format, title, artist, album, contentID) {
if (typeof(type) == "undefined") type = "Music";
if (typeof(format) == "undefined") format = "";
if (typeof(title) == "undefined") title = "";
if (typeof(artist) == "undefined") artist = "";
if (typeof(album) == "undefined") album = "";
if (typeof(contentID) == "undefined") contentID = "";
enabled = Math.abs(enabled);
var WM_COPYDATA = 0x4A;
var song = Interop.Allocate(512);
song.WriteString(0, "\\0" + type + "\\0" + enabled + "\\0" + format + "\\0" + title + "\\0" + artist + "\\0" + album + "\\0" + contentID + "\\0");
var copyDataStruct = Interop.Allocate(12);
copyDataStruct.WriteDWORD(0, 0x547);
copyDataStruct.WriteDWORD(4, song.Size);
copyDataStruct.WriteDWORD(8, song.DataPtr);
var hMSGRUI = 0;
do {
hMSGRUI = Interop.Call("User32", "FindWindowExW", 0, hMSGRUI, "MsnMsgrUIManager", 0);
if (hMSGRUI > 0) {
Interop.Call("User32", "SendMessageW", hMSGRUI, WM_COPYDATA, 0, copyDataStruct)
}
} while ( hMSGRUI != 0 )
}
// for showing:
>>>setNowPlaying(true, "Music", "{0} - {1}", "Break Your Heart", "Taio Cruz Fr. Ludacris", "Album Name");<<<
// for hiding:
setNowPlaying(false);
|
|