Shoutbox

Messenger 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)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: Messenger API (/showthread.php?tid=24760)

Messenger API by _BassReFLeX_ on 05-04-2004 at 03:17 PM

Hi. Can anyone help me. How do I detect if user is signed in msn. I've tried :: CODE ::  If messenger.signout = true then ::CODE:: but it isn't working. It shouldn't in fact :P. If anyone could help me, I would apprecciate a lot !

Thnx !!


RE: Messenger API by Stigmata on 05-04-2004 at 03:35 PM

you would need to be connected using the protocal, i dont think it is possible with simple api calls :s


RE: Messenger API by RaceProUK on 05-04-2004 at 10:12 PM

Wouldn't it be possible to use the IMessenger(C++)/OMessenger(VB) object that Plus! exposes to do that?


RE: Messenger API by dotNorma on 05-04-2004 at 10:48 PM

You can try it this way , this doesn't require you to use Messenger Plus! to do it.

1. Make sure you have set the following references :

Messenger API Type Library

2. Make sure you have added the following to your code.

Public WithEvents ________ As Messenger
Where the blank is , put your own variable (I use MSN)

3. Make sure in Form_Load() You have....

Set ______ As Messenger
In the blank you should put the same variable as above.

4. You can do

If ____ .MyStatus = MISTATUS_OFFLINE Then
*Something*
Else
*Something*
End If


So if they are offline (not connected) it will do something , if they are any other status (online/away/busy/ext) they have to be connected :)

If you ever need any help in Visual Basics feel free to Private Message me. :-)


RE: Messenger API by jokinau on 05-05-2004 at 01:49 PM

NoName, amazing, REALLY!! didn't know that! :D

But anyway, if I really understood what _BassReFLeX_ meant, you determine whether _BassReFLeX_ is online, and I guess he/she wants to know whether his/her contacts are online!

Is that right _BassReFLeX_?? :$ And if it is not, how could we do that, NoName?

TIA(Y)


RE: Messenger API by _BassReFLeX_ on 05-05-2004 at 03:07 PM

What I want: When my app starts (it doesnt have to do with MsgPlus! or any .dll or any plugin. it's simple .exe) i want it to check if anyone is signed in to messengers so it could continue it's job (because it has to do with msn ) if not then, nothing can be done since my app has to do only with msn.

to: NoName :: THanks for that information. Haven't tried that yet. I knew about MISTATUS_INVISIBLE but i wanted it " MISTATUS_SIGNEDIN :P ... you know what i mean. However, i'll get back to work. thnx guys


RE: Messenger API by Sk3tch on 05-05-2004 at 03:21 PM

MISTATUS_INVISIBLE and MISTATUS_OFFLINE are different, Offline as NoName said is if they are offline (not connected) and Invisible is your messenger status as offline wether your setting or viewing it.
So you could use MISTATUS_OFFLINE like the example NoName gave to detect weather you are connected which you could then see if you messenger is running.


RE: Messenger API by RaceProUK on 05-05-2004 at 03:44 PM

If you want to check the online/offline status of your contacts, there is the MyContacts property made available by the Messenger object. MSN Fanatic has some useful information you can use.

The page is quite easy to follow. Basically, if you want to look at the status of your contacts, the page I've linked to above almost does it all for you. In other words, the following loop can be used:

code:
For index = 0 To <contact-list-object>.Count
    <contact-object> = <contact-list-object>.Item(index)
    'Do what you need to here
Next index
Just replace <contact-list-object> with the IMessengerContacts variable, and <contact-object> with the name of your IMessengerContact variable (which should both be declared before the loop). The variable index should be declared an Integer for efficiency.

Hope this helps.
RE: Messenger API by dotNorma on 05-05-2004 at 11:27 PM

quote:
Originally posted by _BassReFLeX_
to: NoName :: THanks for that information. Haven't tried that yet. I knew about MISTATUS_INVISIBLE but i wanted it " MISTATUS_SIGNEDIN ... you know what i mean. However, i'll get back to work. thnx guys

Hey , but MISTATUS_OFFLINE means that the user is not connected to MSN Messenger. So you say if they are not connect to MSN Messenger do nothing else (Because else they have to be connected right?) do the stuff :)

The code I said earlier should work fine.
RE: Messenger API by _BassReFLeX_ on 05-07-2004 at 07:15 PM

oh thanks guys. Btw i forgot to tell that i've just solved the problem with MISTATUS_OFFLINE .. thanks a lot however..