Shoutbox

SetNewName() but remember?! - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: SetNewName() but remember?! (/showthread.php?tid=59279)

SetNewName() but remember?! by liamcrayden on 05-11-2006 at 09:50 AM

I would like to be able to use the SetNewName() function to change a contacts display name, but would like to be able to change it back to the original name at a later point.

Is there any way to 'remember' the display name of the contact before it gets changed? i.e store it in a variable somewhere for later use. Another issue would be whether the contact had multi-formatting in their name and how this could be handled.

I'm new to this but willing to learn. Thanks in advance.


RE: SetNewName() but remember?! by CookieRevised on 05-11-2006 at 11:25 AM

You can't change a contacts display name. Only contacts can change their own name...

SetNewName() is meant to set your nick name, not your contact's.

-------

If you mean their "custom name" then there isn't a function/method to catch that.

Well there is, as "custom names" are stored in the registry, but it would require to calculate the contact hash to be able to retrieve it from the registry as contact emails are encrypted:
HKCU\Software\Patchou\MsgPlus2\<your_.NET_passport>\Contacts\<encrypted_contact's_.NET_Passport>\CustomName

In theory you could set the custom name in the same way, but then you would need also a way to update the display in the contact list.


RE: SetNewName() but remember?! by J-Thread on 05-11-2006 at 01:48 PM

I think he means the name of the user that is using his plugin, not of one of his contacts.

You should first get the Nickname, and I don't remember if that is easy to do, but I think it should. Well somebody else can probably answer that...


RE: SetNewName() but remember?! by Mnjul on 05-11-2006 at 02:57 PM

It's easy once you use Messenger API and retrieve the interface correctly in your Initialize() function (the iMessengerObj parameter, suppose you use C++) :)


RE: SetNewName() but remember?! by RaceProUK on 05-11-2006 at 07:18 PM

quote:
Originally posted by J-Thread
You should first get the Nickname, and I don't remember if that is easy to do
code:
BSTR oldName;
msnApi->get_MyFriendlyName(&oldName);
As you can see, it's really difficult :P

Edit: It's even harder in VB ;P
code:
Dim oldName As String
oldName = MSNAPI.MyFriendlyName

RE: RE: SetNewName() but remember?! by CookieRevised on 05-12-2006 at 03:27 AM

quote:
Originally posted by J-Thread
I think he means the name of the user that is using his plugin, not of one of his contacts.
quote:
Originally posted by liamcrayden
(...) to change a contacts display name

---------------------

You can not change the name of a contact (retrieving is the easy part; setting it is impossible).

Hence my post about the "custom display name" as that is the only thing you could change regarding your contacts.

If it is your own name, not your contact's, then setting it is as easy as retrieving it (see Mnjul's and Raceprouk's post)