|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
msn messenger instant message
I have posted before about a javascript to use, when a link is clicked on a page. it open an msn messenger message window to a certain msn user. i have seen it before on a website but never remember where it was.
i was given this last time i posted... Code:
<script language="javascript" type="text/javascript">
<!--
function msn() {
var msnControl = new ActiveXObject('Messenger.UIAutomation.1');
msnControl.AutoSignin();
msnControl.InstantMessage('someone@hotmail.com');
}
//-->
</script>
but i couldnt get it to work. it keeps saying "Automations server cant create object." thanks. regards Last edited by destravation : March 20th, 2003 at 11:45 AM. |
|
#2
|
||||
|
||||
|
I dunno...
But I sure would like to know how to have an icon in a users profile that displays their msn status. MSN profiles do it so it cant be impossible... although whether or not they are telling is another thing!
|
|
#3
|
|||
|
|||
|
I was probably the one who gave you that...
Do you allow any sort of ActiveX execution in your security settings in IE? The code requires that. Also, I've only personally tested it with Windows Messenger - which is WinXP, I'm not sure about MSN Messenger - which is for other Windows clients. And ralph, I have code to to iteratively search through your list checking for online status, but the drawback is that the user needs to be in your list first. |
|
#4
|
||||
|
||||
|
thanks. Im afraid what we are looking for is for users to be able to add people to their list depending on whether or not they are online.
|
|
#5
|
|||
|
|||
|
You can add someone to your contact list like so:
var msnControl = new ActiveXObject('Messenger.UIAutomation.1'); msnControl.AutoSignin(); msnControl.AddContact(0, "someone@hotmail.com") |
|
#6
|
||||
|
||||
|
thats great, we can use that on profiles. Basically. Imagine our profile page. A users profile will have add to msn messenger on it. What we would like to do is be able to check if that user is online. Is this possible. So we have a link saying add to list, and next to that it should say this user is online/offline? Is this possible?
|
|
#7
|
|||
|
|||
|
I have this code for determining online status:
Code:
var flag = false;
for (var i = 0; i < msnControl.MyContacts.Count; i++) {
if (msnControl.MyContacts.Item(i) == msnControl.GetContact(user, msnControl.MyServiceId)) {
flag = true;
break;
}
}
if (!flag) {
if (confirm('A Messenger user needs to be on your contact list before you can query their online status.\n\nAdd "' + user + '" to your contact list?'))
msnControl.AddContact(0, user);
}
var msnWindow = window.open('about:blank','','scrollbars=no,toolbar=no,directories=no,resizable=no,status=no,menubar =no,width=75,height=25');
msnWindow.document.write('<img src="msn' + Number(flag) + '.gif" width="16" height="16" alt="MSN"/><font face="Arial" size="2"> ' + (flag ? 'Online' : 'Offline') + '</font>');
Just a request... if you're going to use my code, I'd appreciate some credit somewhere ("thanks to jkd - www.jasonkarldavis.com"), as finding the JScript API for Messenger was no easy task... |
|
#8
|
||||
|
||||
|
thats excellent thanks. Just out of interest, is it totally impossible to go microsoft-esque (www.msnusers.com) and when you search for users it shows their online/offline status whether or not they are in your contact list?
And of course I will give you a credit, I know exactly how difficult it is to find Messenger related API's |
|
#9
|
|||
|
|||
|
Quote:
Probably, but I don't know how. |
|
#10
|
|||
|
|||
|
ahh yes jkd you were the one. I went to your site aswell. it gave me the same errors when i clicked your contact link to msn.
im using windows xp windows messenger 4.7 and all active x is allowed on my browser. im guessing the code u gave me works find for you :/ very strange. thanks for the help ill have a play with my settings in ie. |
|
#11
|
|||
|
|||
|
I am a year late
Anyone have any new news? I need to create a link in a html page or FLA doc that a user can click on to auto add my MSN username to their Messenger buddy list. Any new news on this subject from last year? Thanks Peace |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > msn messenger instant message |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|