Shoutbox

How To Call The MSN API using VB - 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: How To Call The MSN API using VB (/showthread.php?tid=28476)

How To Call The MSN API using VB by TheCodeSmith on 07-11-2004 at 01:54 AM

Right, i've tried to set this up plenty of times in the past but now i always have problems.

I know it's possible to access the MSN api library directly from VB6 code, to change status/nick etc.

I have code from years ago that was compatible with <MSN6 versions, but nothing compatible with 6.2.

Could someone be so kind to post directions on how to include this in a VB project? I'll use VB.Net if i need to.

Thanks in advance.
~ TheCodeSmith


RE: How To Call The MSN API using VB by dotNorma on 07-11-2004 at 01:58 AM

Erm.......

Go to Project > References > Messenger API Type Library

code:
Private WithEvents MSN As Messenger
Private Sub Form_Load()
Set MSN = New Messenger
End Sub


Then you can do stuff like...

code:
msgbox MSN.MyFreindlyName


to test it.
RE: How To Call The MSN API using VB by matty on 07-11-2004 at 01:59 AM

quote:
Originally posted by NoName
Erm.......

Go to Project > References > Messenger API Type Library

code:
Private WithEvents MSN As Messenger
Private Sub Form_Load()
Set MSN = New Messenger
End Sub


Just remember tho, by doing this on Windows XP you are running Windows Messenger to use the api.
RE: How To Call The MSN API using VB by TheCodeSmith on 07-11-2004 at 02:08 AM

quote:
Originally posted by NoName
Go to Project > References > Messenger API Type Library
That's where my problem lies, when i tick the item, i get an "Error in loading DLL" message. Thanks matty, i now realise this is because i've removed windows messenger (including directory) and i use MSN Messenger 6.2 instead, i never liked Windows Messenger, or understood the need for two identical chat programs that conflict against each other.

Is there a way to do this, but with MSN 6.2 API's instead?
RE: How To Call The MSN API using VB by matty on 07-11-2004 at 02:16 AM

quote:
Originally posted by TheCodeSmith
quote:
Originally posted by NoName
Go to Project > References > Messenger API Type Library
That's where my problem lies, when i tick the item, i get an "Error in loading DLL" message. Thanks matty, i now realise this is because i've removed windows messenger (including directory) and i use MSN Messenger 6.2 instead, i never liked Windows Messenger, or understood the need for two identical chat programs that conflict against each other.

Is there a way to do this, but with MSN 6.2 API's instead?
Look back at your other thread
http://shoutbox.menthix.net/showthread.php?tid=28...d=275694#pid275694

I posted a huge reply.

Cheers

[Edit]
As long as the O/S is Windows XP or higher then you need to use the Windows Messenger API. There is no way around it that I know. (Obviously there is tho because look at Patchou :)). But on other O/S you can use the 6.2 Api.
RE: How To Call The MSN API using VB by TheCodeSmith on 07-11-2004 at 03:05 AM

quote:
Originally posted by Matty.
As long as the O/S is Windows XP or higher then you need to use the Windows Messenger API. There is no way around it that I know. (Obviously there is tho because look at Patchou :)). But on other O/S you can use the 6.2 Api.
Thanks for helping me.

So if i were to use the Windows Messenger API (as i'm running XP) - people would have to be using Windows Messenger to get it working, right? So it would be incompatible with MSN 6.2?
RE: How To Call The MSN API using VB by matty on 07-11-2004 at 03:09 AM

In a sense yes, but on the other hand no. It wont be incompatible with MSN Messenger just some of the features of the API in Windows Messenger are not available so there could be problems that way. Stick to the code i put in the other thread and you will be fine.


RE: How To Call The MSN API using VB by Millenium_edition on 07-11-2004 at 08:57 AM

Installing WM isn't the only solution. There are plenty of other solutions, but none of them is guaranteed to work.


RE: How To Call The MSN API using VB by CookieRevised on 07-11-2004 at 09:52 AM

[SMALL NOTE]

quote:
Originally posted by TheCodeSmith
two identical chat programs that conflict against each other.
Windows Messenger and MSN Messenger are not identical. There are things that MSN Messenger can do and Windows Messenger not, AND vice versa (more)! Also, they do not conflict with eachother; you can run them with no problem side by side.
Also: Disabling Windows Messenger in the wrong way and in the proper way

RE: How To Call The MSN API using VB by Dempsey on 07-11-2004 at 11:23 AM

quote:
Originally posted by NoName

Go to Project > References > Messenger API Type Library
code:
Private WithEvents MSN As Messenger
Private Sub Form_Load()
Set MSN = New Messenger
End Sub


But you shouldn't do that in a Plus! plugin as it can make Messenger crash.  You should used the Messenger object passed in Initalize

RE: How To Call The MSN API using VB by TheCodeSmith on 07-11-2004 at 12:37 PM

I've seen somewhere else that people have previously thought that MSN 6.2 didn't have any API available. Until they managed to manually extract the latest DLL's from the msnmsgs.exe of MSN Messenger 6.2, allowing them to use all the functions of the new version.

Anyone heard/seen how you'd do this? I think it mentioned a ResHacker or something like it.


RE: RE: How To Call The MSN API using VB by fas on 07-11-2004 at 01:04 PM

quote:
Go to Project > References > Messenger API Type Library


Em, where can I get this lib? I don't find it...
RE: How To Call The MSN API using VB by matty on 07-11-2004 at 01:33 PM

quote:
Originally posted by fas
Em, where can I get this lib? I don't find it...
Do you have Windows Messenger installed?
RE: How To Call The MSN API using VB by fas on 07-11-2004 at 03:08 PM

Sure, MSN Messenger 6.2.0137.


RE: How To Call The MSN API using VB by CookieRevised on 07-11-2004 at 03:23 PM

quote:
Originally posted by Matty.
quote:
Originally posted by fas
Em, where can I get this lib? I don't find it...
Do you have Windows Messenger installed?
quote:
Originally posted by fas
Sure, MSN Messenger 6.2.0137.
That's not Windows Messenger.

Windows Messenger and MSN Messenger are two different programs...

RE: How To Call The MSN API using VB by fas on 07-11-2004 at 04:22 PM

quote:
* They both support instant messaging, voice calls, and files transfers, but Windows Messenger additionally supports video calls, application sharing, shared whiteboard, and Remote Assistance.

Okay, I have MSN, but it supports whiteboard, remote assistance, ...

Anyway, I'm installing now. I remember times i had problems with uninstalling it...

So may somebody tell me what is better? MSN Messenger or Windows Messenge? Msn look better ;)
RE: RE: How To Call The MSN API using VB by CookieRevised on 07-11-2004 at 04:28 PM

quote:
Originally posted by fas
quote:
* They both support instant messaging, voice calls, and files transfers, but Windows Messenger additionally supports video calls, application sharing, shared whiteboard, and Remote Assistance.
Okay, I have MSN, but it supports whiteboard, remote assistance, ...
No it does not without Windows Messenger! MSN Messenger needs Windows Messenger to be installed in order to use those functions from Windows Messenger... (see point 1 in my post in that thread)

Also many plugins need the API from Windows Messenger to function...

quote:
Originally posted by fas
Anyway, I'm installing now. I remember times i had problems with uninstalling it...
Because, you are not supposed to uninstall it...

quote:
Originally posted by fas
So may somebody tell me what is better? MSN Messenger or Windows Messenge? Msn look better ;)
Everybody will say something different. It is up to your personal taste for the looks, and up to the functions that you use and up to the type of connection that you use... (see point 1 in my post in that thread)

PS: read this post also, it might interest you:
http://shoutbox.menthix.net/showthread.php?tid=26...d=258821#pid258821
RE: How To Call The MSN API using VB by fas on 07-11-2004 at 04:59 PM

Cool, thanks for helping! Unfortunately i still don't know how to send an instant message to a user by using the Messenger Api Type Lib or a different easy way. Does somebody know, how?

Another thing I'd like to know is: I wanted to add a Menu/Control to the Chat-Window. Therefore I'd need a notification everytime a chat-window opens. How to? :S

Sorry for my millions of questions, I assure it's just in the first few days till I got into this theme (A).

Have a nice day!


Got it...