Help needed with showing my own element under personal message |
Author: |
Message: |
sayed
Junior Member
Posts: 17
Joined: Jan 2010
|
O.P. Help needed with showing my own element under personal message
Hello all,
I need help with showing my own element under the personal message,
like this image:
I want to put my own text, how ??
Please help me fast.
And thanks in advance
|
|
02-12-2011 12:28 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Help needed with showing my own element under personal message
Do you mean you want to show the current song you playing? Or you just want to add some text?
|
|
02-12-2011 12:38 PM |
|
|
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);
|
|
02-12-2011 12:40 PM |
|
|
sayed
Junior Member
Posts: 17
Joined: Jan 2010
|
O.P. RE: Help needed with showing my own element under personal message
quote: Originally posted by matty
Do you mean you want to show the current song you playing? Or you just want to add some text?
No, I want to put my own text using code...
quote: Originally posted by mynetx
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);
I don't want to show the song I'm playing...
|
|
02-12-2011 12:45 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
RE: Help needed with showing my own element under personal message
If you just want to show text, can't you just use the personal message box?
|
|
02-12-2011 12:47 PM |
|
|
sayed
Junior Member
Posts: 17
Joined: Jan 2010
|
O.P. RE: Help needed with showing my own element under personal message
quote: Originally posted by whiz
If you just want to show text, can't you just use the personal message box?
No, I wanna show a text from code under the personal message as I said before..
|
|
02-12-2011 12:52 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Help needed with showing my own element under personal message
So you are trying to create a brand new element on the contact list window? Not possible.
|
|
02-12-2011 01:00 PM |
|
|
sayed
Junior Member
Posts: 17
Joined: Jan 2010
|
O.P. RE: Help needed with showing my own element under personal message
quote: Originally posted by matty
So you are trying to create a brand new element on the contact list window? Not possible.
Yes, but why not? How that script in the picture does ?!!
|
|
02-12-2011 01:02 PM |
|
|
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
quote: Originally posted by sayed
How that script in the picture does ?
The script shows a currently playing song, with a function similar to mine above. So, it is not inserting a new field.
|
|
02-12-2011 01:03 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Help needed with showing my own element under personal message
Well that script isn't adding anything new. They have the user's Nick Name, the user's Personal Message and the user's Media Message... no new elements are being added.
|
|
02-12-2011 01:05 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|