What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » OnEvent_MyDisplayPictureChange Event Handler

OnEvent_MyDisplayPictureChange Event Handler
Author: Message:
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
36 / Male / Flag
Joined: Jul 2007
O.P. OnEvent_MyDisplayPictureChange Event Handler
Does anybody know an event handler for this, or is the only way to detect a display picture change a Timer while comparing the current picture file size with a copy created on last run of Timer?

Thank you for your replies,
mynetx

This post was edited on 08-20-2007 at 01:18 PM by mynetx.
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
08-20-2007 01:14 PM
Profile E-Mail PM Web Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: OnEvent_MyDisplayPictureChange Event Handler
code:
function getdp(){
   try{ return Messenger.MyDisplayPicture; }
   catch(e){ return ''; }
}

function OnEvent_Timer(id){
   if (id == 'dp'){
      if(getdp() != <variable for DP location>){
         <variable for DP location> = getdp();
         <other code for DP change>
      }
      MsgPlus.AddTimer('dp', 30000);
   }
}
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
08-20-2007 01:43 PM
Profile PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: OnEvent_MyDisplayPictureChange Event Handler
The file size would be an inacurrate way of doing things... Just been looking to see if the Messenger.MyDisplayPicture uses distinguishable filenames, but it says not to store them for future use so I don't think thats reliable either
<Eljay> "Problems encountered: shit blew up" :zippy:
08-20-2007 01:46 PM
Profile PM Find Quote Report
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
36 / Male / Flag
Joined: Jul 2007
O.P. RE: OnEvent_MyDisplayPictureChange Event Handler
@MeEtc:
This is exactly what I'm doing right now, but I was wondering if there were an easier solution, maybe using some kind of event handler for display picture changing.

@SpunkyLoveMuff:
The file names are the originals from Messenger. Even if the picture is updated by the user (or by another script), the file name won't change, whereas if you compare the bytes, it is very unlikely that two different images have the same size.

/edit:
It was very strange for me to find event handlers for just every kind of user information change, but not for the display picture... *-)

This post was edited on 08-20-2007 at 01:52 PM by mynetx.
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
08-20-2007 01:47 PM
Profile E-Mail PM Web Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: OnEvent_MyDisplayPictureChange Event Handler
I'm sorry, I cannot provide an event handler for this right now... when I can add one, I will.
[Image: signature2.gif]
08-20-2007 02:19 PM
Profile PM Web Find Quote Report
XP1
Junior Member
**

Avatar

Posts: 28
Joined: Nov 2004
Huh?  RE: RE: OnEvent_MyDisplayPictureChange Event Handler
quote:
Originally posted by Patchou
I'm sorry, I cannot provide an event handler for this right now... when I can add one, I will.
Now that the new Messenger Plus! Live for WLM 2009 is almost finalized, is Patchou ready for adding this?

Sorry for bumping, but I would really like an OnEvent_MyDisplayPictureChange event handler.

I don't want this tread to be forgotten.
Patchou, can you put this feature on your to-do list so you won't forget? :)
01-19-2009 07:23 AM
Profile E-Mail PM Web Find Quote Report
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
36 / Male / Flag
Joined: Jul 2007
O.P. RE: OnEvent_MyDisplayPictureChange Event Handler
quote:
Originally posted by XP1
can you put this feature on your to-do list so you won't forget?
XP1,

I've put my suggestion on an internal list now, so that it won't be forgotten. Thanks for reminding!
Remember though that it might still not be possible to add the Event Handler, depending on the internal APIs and possible hooks. :)
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
01-19-2009 04:02 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: OnEvent_MyDisplayPictureChange Event Handler
quote:
Originally posted by mynetx
@SpunkyLoveMuff:
The file names are the originals from Messenger. Even if the picture is updated by the user (or by another script), the file name won't change, whereas if you compare the bytes, it is very unlikely that two different images have the same size.
Dunno if I understood you correctly, but the chance that two different DPs have the same filesize IS likely. So, this is not a good way to see if there is another DP.

The only foolproof method you have and need to implement is comparing the file hash with the hash of the previous DP (of that _same_ user; important!). In essence, comparing the file byte per byte...

A faster method would be to check the filechange date and time. Though this isn't as accurate as comparing byte per byte by the use of a hash (the datetime can be changed by the user using 3rd party software and other Windows APIs), it is maybe accurate enough in most cases.

;)

This post was edited on 01-19-2009 at 08:50 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-19-2009 08:46 PM
Profile PM Find Quote Report
XP1
Junior Member
**

Avatar

Posts: 28
Joined: Nov 2004
RE: RE: OnEvent_MyDisplayPictureChange Event Handler
quote:
Originally posted by mynetx
XP1,

I've put my suggestion on an internal list now, so that it won't be forgotten. Thanks for reminding!
Thanks.

quote:
Originally posted by CookieRevised
A faster method would be to check the filechange date and time. Though this isn't as accurate as comparing byte per byte by the use of a hash (the datetime can be changed by the user using 3rd party software and other Windows APIs), it is maybe accurate enough in most cases.
Yeah, this won't be accurate when someone zips up display pictures into an archive that strips away the date and time information. Thus, when the archive is extracted, all of the dates / times are re-set to the same current date / time (or pre-defined date / time set at archive creation).

Using file hashes is probably the best way to go.

This post was edited on 01-20-2009 at 01:15 AM by XP1.
01-20-2009 01:09 AM
Profile E-Mail PM Web Find Quote Report
mynetx
Skinning Contest Winner
*****

Avatar
Microsoft insider

Posts: 1175
Reputation: 33
36 / Male / Flag
Joined: Jul 2007
O.P. RE: OnEvent_MyDisplayPictureChange Event Handler
I have thrown together a small demo script providing you the event handler OnEvent_MyDisplayPictureChange. Read the _main.js inside the script pack; it contains commented code so you see what it does. It works with the MD5 hash of the display picture.

.plsc File Attachment: OnEvent_MyDisplayPictureChange-Demo-1.0.1.plsc (3.34 KB)
This file has been downloaded 92 time(s).
mynetx - Microsoft, enhanced.

You have a problem or issue with Windows, Internet
Explorer or Office?
Send a tweet!
01-20-2009 09:18 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On