Media PSM |
Author: |
Message: |
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
O.P. Media PSM
I did a search for this and kind of found what I was looking for, but this is on kind of a different slant...
I'm looking for a way to set the Media PSM (I know it's only read-only) for my script. I heard someone made a DLL that can be used to do it. Does anyone know where I can get this and instructions on how to use it? If not does anybody know another way to do it?
Maybe it should be a read-write property in the next version of plus!
<Eljay> "Problems encountered: shit blew up"
|
|
09-06-2006 05:08 PM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
RE: Media PSM
quote: Originally posted by SpunkyLoveMuff
I did a search for this and kind of found what I was looking for, but this is on kind of a different slant...
I'm looking for a way to set the Media PSM (I know it's only read-only) for my script. I heard someone made a DLL that can be used to do it. Does anyone know where I can get this and instructions on how to use it? If not does anybody know another way to do it?
Maybe it should be a read-write property in the next version of plus!
Have a look at the xPSM script and the AppMon+. They both use the same dll so having a look at the code may make it easy for you .
I Got it i guess
code: new ActiveXObject('felipe.sarabia').SetMusicInfo('', '', '', 'Music/Games/Office', '', 'Set PSM');
You need to change Set PSM to what you want after the icon and chose any one from Music/Games/Office and also let those '' be as it is . Make sure you have the DLL with you .
This post was edited on 09-06-2006 at 05:24 PM by Felu.
|
|
09-06-2006 05:13 PM |
|
|
Zeh
Full Member
DC 4 EVER!
Posts: 136 Reputation: 1
36 / / –
Joined: Aug 2006
|
RE: Media PSM
Was going to say the same thing about teh AppMon+.
| Windows Live Messenger Beta Tester | Windows Live Mail Beta Tester |
|
|
09-06-2006 05:17 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
O.P. RE: Media PSM
Yeah, thanks -!Felu!- It works great Thanks also to the author of the dll file as well, obviosuly
<Eljay> "Problems encountered: shit blew up"
|
|
09-06-2006 06:42 PM |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
Joined: Mar 2004
|
RE: Media PSM
or an even better way which doesnt require dlls or com objects code: /*
Function by -dt- (Matt Labrum) (Converted from http://forums.fanatic.net.nz/index.php?showtopic=11311&st=0# )
Void setNowPlaying( boolean enabled, [String type [, String format [, String title [, String artist [, String album [, String contentID ]]]]]] );
if enabled is true the now playing will show, if its false then the personal message will show.
type is the type of image you want to display. Either Music, Office or Games.
format is the format of the song eg {0} by {1} which would show title by artist.
format can also be a message eg "moo goes the cow"
Examples:
setNowPlaying(true, "Music", "{0} - {1}", "dt", "dt's band", "dt's album");
or setting it to a Game icon and displaying a message
setNowPlaying(true, "Games", "yay playing warcraft");
or set it to the office icon
Playing(true, "Office", "yay using word ");
setNow
and turning it off
setNowPlaying(false);
*/
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;
//reference
var song = Interop.Allocate(512);
//change the Music thing to Games or Office or
song.WriteString(0, "\\0" + type + "\\0" + enabled + "\\0" + format +"\\0" + title +"\\0" + artist + "\\0" + album + "\\0" + contentID + "\\0");
//write our copyDataStruct Structure
var copyDataStruct = Interop.Allocate(12);
copyDataStruct.WriteDWORD(0, 0x547); //dwData
copyDataStruct.WriteDWORD(4, song.Size); //cbData
copyDataStruct.WriteDWORD(8, song.DataPtr); //lpData
//Send it to all open messengers
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);
}
Happy Birthday, WDZ
|
|
09-06-2006 10:42 PM |
|
|
CookieRevised
Elite Member
Posts: 15517 Reputation: 173
– / /
Joined: Jul 2003
Status: Away
|
RE: RE: Media PSM
code: // Send ONLY to this messenger
// if you need to find any other window, replace "MsnMsgrUIManager" with the class of
// the window you need, and change the SendMessageW interop call to the function you want.
var tIDCurrent = Interop.Call('Kernel32', 'GetCurrentThreadId');
var hWnd = 0;
while (hWnd = Interop.Call('User32', 'FindWindowExW', 0, hWnd, 'MsnMsgrUIManager', 0))
if (Interop.Call('User32', 'GetWindowThreadProcessId', hWnd, 0) === tIDCurrent) {
Interop.Call('User32', 'SendMessageW', hWnd, WM_COPYDATA, 0, copyDataStruct);
break;
}
This post was edited on 09-06-2006 at 11:49 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
|
|
09-06-2006 11:41 PM |
|
|
|
|