Hey right i really need to know how to use these MSN API's or what ever they is. but i cant find info on them anywhere so i found this silly little program which can both send text and send a file.
So i thought *maybe* if i open the file in a txt format then id be able to work a API out... but i was badly wrong heres some of the stuff i got which i thought may help....
C:\Program Files\Messenger\msmsgs.exe dunno what thats got todo with it :\
C:\WINDOWS\System32\scrrun.dll just thought id add all DLL's
Thats all i could find what i think might have somthing todo with it :\ also there was alot of "RegOpen", "RegClose" ....etc could that have anything todo with it?
Can someone tell me why that just gives me a bad feeling? I'd advise everyone to just ignore whatever that thing is. I've never seen anything good come from such files...
I'm baaaack... VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too
nooo the file is really ok but its abit of a pain but your ok if you dont open it as a EXE File as im sure you all know.
im sorry i had to use this file i couldnt find another one which could both send a String and a File... but really its ok and if you did open it all i had todo was restart my computer and then deleted it but i promise its 100% safe
but still if your a little unsure about "text files" then you dont have to download ive copy pasted everything i think has somthing todo wit the API im looking for
please help
thanx
I am attaching the msn protocol, read it and you can figure out how to do whatever it is you wanna do. By the way what are you trying to do with msn and api calls?
hey thanx i had ago playing with it a few days ago but looks abit above me but ill have another go.
Well there a few things really first i was thinking about a kind of fileserver where users of my web site could Email me which file they want using there Hotmail address then i could check using a Email program and then send them the file they asked for. also all the other stuff like away bots and a bot which stores all my ACSII Art and what ever else i can come up with
go to project/references
tick the "Messenger Type Library"
if its not there browse for the MSN executable... thats it
u can see all the objects/methods/events/properties by hitting F2 (Object browser)
i was mucking around with it and this worked... kinda
Code:
Dim msnTest As New MsgrObject
Dim msnApp As IMessengerApp2
Dim msnIMWindow As IMessengerIMWindow
Dim msnSvc As IMsgrService
Dim msnUsers As IMsgrUsers
Dim msnUser As IMsgrUser
Private Sub Form_Load()
On Error Resume Next
Set msnApp = CreateObject("Messenger.MessengerApp")
'Check if logged on
If msnTest.Services.PrimaryService.Status = MSS_NOT_LOGGED_ON Then
msnTest.Logon "[email protected]", "(passwdhidden)", msnSvc
Do While (msnTest.Services.PrimaryService.Status <> MSS_LOGGED_ON) Or (msnTest.UnreadEmail(msnInbox) = -1) Or (msnTest.LocalState = MSTATE_ONLINE)
DoEvents
Loop
End If
'Display info
'Dunno why but if the program has to log msn on it always
'exits the loop too early and reports the wrong info
Debug.Print msnTest.LocalFriendlyName
Debug.Print msnTest.Services.PrimaryService.FriendlyName
Debug.Print msnTest.Services.PrimaryService.ServiceName
If (msnTest.LocalState = MSTATE_AWAY) Then
Debug.Print "IM AWAY"
ElseIf (msnTest.LocalState = MSTATE_ONLINE) Then
Debug.Print "IM ONLINE"
End If
Debug.Print msnTest.UnreadEmail(MFOLDER_INBOX)
Set msnUsers = msnTest.List(MLIST_ALLOW)
For Each msnUser In msnUsers
Debug.Print msnUser.EmailAddress
Debug.Print msnUser.FriendlyName
Debug.Print msnUser.LogonName
If (msnUser.State = MSTATE_ONLINE) Or (msnUser.State = MSTATE_AWAY) Then
'Send online ppl an instant message
'dunno why but getting an error message here
'thus the on error resume next
Set msnIMWindow = msnApp.LaunchIMUI(msnUser)
msnIMWindow.SendText "HHHHEEEEELLLOOOOO BUUDDDYYYYY!!!!"
End If
Next
'Sends that silly "xxxxx wants to talk to you" email
msnTest.Services.PrimaryService.SendInviteMail "(hidden)@hotmail.com", 0, 0, 0
End Sub
if anyone gets it to work better ... tell me... i wanna know
I'm running xp with windows messenger so it is hard for me to say why it is doing that, when you re-installed msn did you download the newest version and are you running messenger when you include it in your reference, thats what I did without mishap.
Add a command button named cmdSend and a textbox named
txtMessage, I also reformatted the code because when I pasted
it, the form loaded in as a module.
Dim msnTest As New MsgrObject
Dim msnApp As IMessengerApp2
Dim msnIMWindow As IMessengerIMWindow
Dim msnSvc As IMsgrService
Dim msnUsers As IMsgrUsers
Dim msnUser As IMsgrUser
'Changed this to a command button instead of a form load event
Private Sub cmdSend_Click()
On Error Resume Next
Set msnApp = CreateObject("Messenger.MessengerApp")
'Check if logged on
If msnTest.Services.PrimaryService.Status = MSS_NOT_LOGGED_ON Then
Do While (msnTest.Services.PrimaryService.Status <> MSS_LOGGED_ON) Or (msnTest.UnreadEmail(msnInbox) = -1) Or (msnTest.LocalState = MSTATE_ONLINE)
DoEvents
Loop
End If
'Display info
'Dunno why but if the program has to log msn on it always
'exits the loop too early and reports the wrong info
Debug.Print msnTest.LocalFriendlyName
Debug.Print msnTest.Services.PrimaryService.FriendlyName
Debug.Print msnTest.Services.PrimaryService.ServiceName
If (msnTest.LocalState = MSTATE_AWAY) Then
Debug.Print "IM AWAY"
ElseIf (msnTest.LocalState = MSTATE_ONLINE) Then
Debug.Print "IM ONLINE"
End If
Debug.Print msnTest.UnreadEmail(MFOLDER_INBOX)
Set msnUsers = msnTest.List(MLIST_ALLOW)
If (msnUser.State = MSTATE_ONLINE) Or (msnUser.State = MSTATE_AWAY) Then
'Send online ppl an instant message
'dunno why but getting an error message here
'thus the on error resume next
Set msnIMWindow = msnApp.LaunchIMUI(msnUser)
'Changed this line to a textbox instead of a preset message
msnIMWindow.SendText txtMessage.Text
End If
Next
'Sends that silly "xxxxx wants to talk to you" email
msnTest.Services.PrimaryService.SendInviteMail "(hidden)@hotmail.com", 0, 0, 0
Sorry been drinking tonight and hit the wrong button, look at my other post and you will see why I said that. It's not my code I just changed it a tiny bit, but thanks. Ok when vb gives you that error it should have a popup with the option Debug. Hit debug and vb should highlight the bit of code causing the error. Then hit stop and copy that line of code and post it here, maybe we can figure out why it is causing an error.