Shoutbox

Messanger API - 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)
+----- Thread: Messanger API (/showthread.php?tid=67443)

Messanger API by Plan-1130 on 10-18-2006 at 01:17 PM

Does anyone know how to call the Messenger API from within a script, i can work out how to call it from a dll file, but is there any way to call it from within a script without the use of a dll file?

I mean in Visual Basic you can call Messenger API Type Library, but I'm not a real expert with JScript...


RE: Messanger API by Deco on 10-18-2006 at 01:37 PM

Hi

I think it would be easier to make a dll in VB that used the api and then call your own dll in jscript.

But I'd wait for Cookie or Shondoit or CLoudy to reply because they rock and I'm just another Noob :)

I'm trying the same stuff in case you want to share info I'm messing with the messenger api in vb.

PM me your MSN If you want.

Have fun


RE: Messanger API by Shondoit on 10-18-2006 at 02:12 PM

Why would you want to use the messenger API?

You can change virtually everything from inside the script...
Like Messenger.MyName changes your nickname, etc
(You can find all information in the Scripting documentation)

If you really need to use the API, you can indeed make a dll in VB or an ActiveX and call it from the script

Edit: added link to scripting doc


RE: Messanger API by Plan-1130 on 10-18-2006 at 02:15 PM

certain things can only be done with the messenger API, like adding and deleting contacts, and writing a dll or activex it exactly what i try not to...


RE: Messanger API by Shondoit on 10-18-2006 at 02:22 PM

I don't know any way how to use the API without putting it in a dll or ActiveX... :S

I don't think there is a way to do that... but perhaps someone else knows...

Edit: @Deco, if you have a different question than the one the topicstarter has, please open another thread, and since it's a question about the API you should post it in the plug-in forum...
And you can do this very easy with a script....


RE: Messanger API by deAd on 10-18-2006 at 09:39 PM

The API can be used with the ActiveXControl object.

code:
var MessengerAPI = new ActiveXObject("Messenger.UIAutomation.1");

This might not work on all machines, and some features (like groups) will not be accessible/may crash wlm.

This will also cause Windows Messenger to run in the background.
RE: Messanger API by Spunky on 10-18-2006 at 09:46 PM

quote:
Originally posted by deAd
The API can be used with the ActiveXControl object.

code:
var MessengerAPI = new ActiveXObject("Messenger.UIAutomation.1");

This might not work on all machines, and some features (like groups) will not be accessible/may crash wlm.

This will also cause Windows Messenger to run in the background.

I've been working in VB6 all night figuring out the API commands so I could write a DLL to use or something. That seems likes a good solution that you posted, but why does it make Messenger run in the background?
RE: Messanger API by matty on 10-18-2006 at 09:56 PM

quote:
Originally posted by SpunkyLoveMuff
quote:
Originally posted by deAd
The API can be used with the ActiveXControl object.

code:
var MessengerAPI = new ActiveXObject("Messenger.UIAutomation.1");

This might not work on all machines, and some features (like groups) will not be accessible/may crash wlm.

This will also cause Windows Messenger to run in the background.

I've been working in VB6 all night figuring out the API commands so I could write a DLL to use or something. That seems likes a good solution that you posted, but why does it make Messenger run in the background?
It is a bug in Windows XP where the API, if Windows Messenger is installed, is run because natively Windows XP uses the API for certain features like Remote Assistance.
RE: Messanger API by Deco on 10-18-2006 at 10:52 PM

Matty,

How would I use th API after that? Just call it's functions or do I need to declare stuff ..?

Thanks


RE: Messanger API by matty on 10-18-2006 at 11:00 PM

quote:
Originally posted by Deco
Matty,

How would I use th API after that? Just call it's functions or do I need to declare stuff ..?

Thanks
Normally calling the functions like you would in Visual Basic. So the Variable declared there is MessengerAPI, so to open a conversation window you do

code:
MessengerAPI.InstantMessage('johndoe@hotmail.com');

RE: RE: Messanger API by CookieRevised on 10-18-2006 at 11:06 PM

quote:
Originally posted by deAd
The API can be used with the ActiveXControl object.

code:
var MessengerAPI = new ActiveXObject("Messenger.UIAutomation.1");

This might not work on all machines, and some features (like groups) will not be accessible/may crash wlm.
Never use the ".1", ".2" or whatever as a reference. This is part of the reason why it doesn't work on some machines. Those identify the versions so to speak, of the activex objects. Specifiying them will cause Windows quite often to not find the proper 'versions'.

see CookieRevised's reply to [Question] Any way I can get a Winsock ActiveXObject working ?

Also note that each time you use 'ActiveXObject("Messenger.UIAutomation")' a new object is created which will lead to out of memory problems, and maybe even crashes, etc very rapidly.

Hence, I suggest to not use this in scripts...

related:

http://forum.mess.be/index.php?s=73b0a25dcb617f93...5b&showtopic=19108
http://forum.mess.be/index.php?showtopic=55 (<= SpunkyLoveMuff, read this also)
http://forums.fanatic.net.nz/index.php?showtopic=5799
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=478



quote:
Originally posted by SpunkyLoveMuff
I've been working in VB6 all night figuring out the API commands so I could write a DLL to use or something. That seems likes a good solution that you posted, but why does it make Messenger run in the background?
If you want to use a DLL, you don't need what has been posted before. See forums like MSNFanatic for more info on how to create a DLL which references the Messenger API.

Or you can also find a lot of examples in the plugins section on this forums.

Also, in VB6, you can use the object browser to get all the available objects, properties, functions, etc at your disposal (after you have created a reference  to the Messenger API).
RE: RE: RE: Messanger API by deAd on 10-18-2006 at 11:16 PM

quote:
Originally posted by CookieRevised
quote:
Originally posted by deAd
The API can be used with the ActiveXControl object.

code:
var MessengerAPI = new ActiveXObject("Messenger.UIAutomation.1");

This might not work on all machines, and some features (like groups) will not be accessible/may crash wlm.
Never use the ".1", ".2" or whatever as a reference. This is part of the reason why it doesn't work on some machines. Those identify the versions so to speak, of the activex objects. Specifiying them will cause Windows quite often to not find the proper 'versions'.
I am aware of that, but I do not know of another working ID...so I posted that and a warning ...
RE: RE: RE: RE: Messanger API by CookieRevised on 10-18-2006 at 11:21 PM

quote:
Originally posted by deAd
quote:
Originally posted by CookieRevised
quote:
Originally posted by deAd
The API can be used with the ActiveXControl object.

code:
var MessengerAPI = new ActiveXObject("Messenger.UIAutomation.1");

This might not work on all machines, and some features (like groups) will not be accessible/may crash wlm.
Never use the ".1", ".2" or whatever as a reference. This is part of the reason why it doesn't work on some machines. Those identify the versions so to speak, of the activex objects. Specifiying them will cause Windows quite often to not find the proper 'versions'.
I am aware of that, but I do not know of another working ID...so I posted that and a warning ...

The working* id is without the ".1". See link** in previous post why

* though I wouldn't call it 'working'. See also previous post

** CookieRevised's reply to [Question] Any way I can get a Winsock ActiveXObject working ?
RE: Messanger API by Deco on 10-18-2006 at 11:26 PM

Just one more silly question I promise :)

IS this all the decumentation on messengerAPi or is there anything else?

Documentation I found

Thanks


RE: Messanger API by CookieRevised on 10-18-2006 at 11:39 PM

quote:
Originally posted by Matty
quote:
Originally posted by SpunkyLoveMuff
why does it make Messenger run in the background?
It is a bug in Windows XP where the API, if Windows Messenger is installed, is run because natively Windows XP uses the API for certain features like Remote Assistance.

Its not really a bug though, its more how it is designed...

For a very detailed explanation, see:
http://www.fanatic.net.nz/2006/03/22/msn-messenge...api-confusion.html

quote:
Originally posted by Deco
Just one more silly question I promise :)

IS this all the decumentation on messengerAPi or is there anything else?

Documentation I found
Not a silly question though...

The link you provided is a part of the documentation, the main link is this one.

Go to there you'll also see that this documentation is very old and actually meant for Windows Messenger, not MSN Messenger, let alone for Windows Live Messenger.

That same documentation is also available as a chm file though (somewhere, don't have the link at hand).

But many things stated there still apply or can be taken as basis. More details and practical examples can be found on various forums (msnfanatic, mess.be, this one, etc).




* for SpunkyLoveMuff and others who want to make a DLL which references the Messenger API, see sites as MSNFanatic, mess.be, etc. eg:

More (unofficial) info and examples on the Messenger API:
http://www.fanatic.net.nz/2003/05/31/introduction...-type-library.html
http://www.fanatic.net.nz/2004/08/02/display-picture-api.html
http://www.fanatic.net.nz/2005/10/10/accessing-an...-contact-list.html



* Related API docs (official):
Windows Live Messenger development
Messenger Activity Add-In API documentation 1
Messenger Activity Add-In API documentation 2
Yahoo Messenger API documentation




RE: Messanger API by Deco on 10-18-2006 at 11:45 PM

You're my hero Cookie.

Much love.


RE: Messanger API by Plan-1130 on 10-19-2006 at 02:32 PM

quote:
Originally posted by Matty
MessengerAPI.InstantMessage('johndoe@hotmail.com');
but what if a function returns an object? in vb this would be
code:
Dim contact As IMessengerContact
contact = MessengerAPI.GetContact("email")


RE: Messanger API by Shondoit on 10-19-2006 at 02:59 PM

Just the same, only it's

code:
var Contact = MessengerAPI.GetContact("email")