OnEvent_MyDisplayPictureChange Event Handler |
Author: |
Message: |
mynetx
Skinning Contest Winner
Microsoft insider
Posts: 1175 Reputation: 33
37 / /
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.
|
|
08-20-2007 01:14 PM |
|
|
MeEtc
Patchou's look-alike
In the Shadow Gallery once again
Posts: 2200 Reputation: 60
38 / /
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);
}
}
I cannot hear you. There is a banana in my ear.
|
|
08-20-2007 01:43 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
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"
|
|
08-20-2007 01:46 PM |
|
|
mynetx
Skinning Contest Winner
Microsoft insider
Posts: 1175 Reputation: 33
37 / /
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.
|
|
08-20-2007 01:47 PM |
|
|
Patchou
Messenger Plus! Creator
Posts: 8607 Reputation: 201
43 / /
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.
|
|
08-20-2007 02:19 PM |
|
|
XP1
Junior Member
Posts: 28
Joined: Nov 2004
|
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 |
|
|
mynetx
Skinning Contest Winner
Microsoft insider
Posts: 1175 Reputation: 33
37 / /
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.
|
|
01-19-2009 04:02 PM |
|
|
CookieRevised
Elite Member
Posts: 15517 Reputation: 173
– / /
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 |
|
|
XP1
Junior Member
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 |
|
|
mynetx
Skinning Contest Winner
Microsoft insider
Posts: 1175 Reputation: 33
37 / /
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.
Attachment: OnEvent_MyDisplayPictureChange-Demo-1.0.1.plsc (3.34 KB)
This file has been downloaded 109 time(s).
|
|
01-20-2009 09:18 AM |
|
|
|