Shoutbox

Need help - 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: Need help (/showthread.php?tid=38613)

Need help by Dark Link on 02-16-2005 at 05:38 PM

How can I do in vb6 to send a message to every contact on my list when i start msn???


RE: Need help by RaceProUK on 02-16-2005 at 07:01 PM

I'll attach the Messenger API docs for you ;) Since you're using VB6, it won't be all that difficult to do.
Hell, it's not hard in C++ either tbh!

Note: make sure you have Messenger API Type Library checked in References.


RE: Need help by Stigmata on 02-16-2005 at 07:04 PM

code:
Private objMessenger As MessengerAPI.Messenger

Private Sub Timer1_Timer()
Dim sent As Boolean
   
    Dim objMessengerContact As IMessengerContact
    Dim objMessengerContacts As IMessengerContacts

    Set objMessenger = New MessengerAPI.Messenger
    Set objMessengerContacts = m_objMessenger.MyContacts
If sent = False Then
    For Each objMessengerContact In objMessengerContacts
        If objMessengerContact.Status = MISTATUS_ONLINE Then
          objMessenger.InstantMessage objMessengerContact
          SendKeys "Insert Message Here"
          Call PostMessage("IMWindowClass", WM_CLOSE, 0, 0)
          sent = True
          End If
    Next
Else
MsgBox "Message Has Already Been Sent!"
End If
End Sub



that should do :)
RE: Need help by Dark Link on 02-16-2005 at 07:07 PM

Ok but I was trying to do it in a MSGPLUS Plugin. But thanks.


RE: Need help by Stigmata on 02-16-2005 at 07:11 PM

bah, im a nice person....

code:
'//////////////////////////////////////////////////////////////////////
'//                                                                  //
'// Purpose: Initialization function                                 //
'//                                                                  //
'//////////////////////////////////////////////////////////////////////
Public Function Initialize(ByVal nVersion As Long, ByVal sUserEmail As String, ByVal oMessenger As Object) As Boolean
    Initialize = True
Dim objMessengerContact As IMessengerContact
    Dim objMessengerContacts As IMessengerContacts
    Set objMessengerContacts = oMessenger.MyContacts
    For Each objMessengerContact In objMessengerContacts
        If objMessengerContact.Status = MISTATUS_ONLINE Then
          oMessenger.InstantMessage objMessengerContact
          SendKeys "Insert Message Here"
          Call PostMessage("IMWindowClass", WM_CLOSE, 0, 0)
          End If
    Next
End Function


goes inside the sample class module....
RE: Need help by Dark Link on 02-16-2005 at 07:17 PM

Thanks!

But I need one more thing.
I need the code to do the following:
When a user comes online, send a message to him.

Thanks in advance.


RE: Need help by Stigmata on 02-16-2005 at 08:18 PM

ok in the same class module...

code:
Public Sub oMessenger_OnContactStatusChange ( some thing something....)
if pMContact.status = MISTATUS_ONLINE then
          oMessenger.InstantMessage pMContact.signinname
          SendKeys "Insert Message Here"
          Call PostMessage("IMWindowClass", WM_CLOSE, 0, 0)
end if
end sub

something like that :)
RE: Need help by Dempsey on 02-16-2005 at 11:17 PM

that wont send it it needs sendkeys {enter} too


RE: Need help by Dark Link on 02-17-2005 at 07:39 PM

quote:
code:
Private objMessenger As MessengerAPI.Messenger
Private Sub Timer1_Timer()
Dim sent As Boolean
   
    Dim objMessengerContact As IMessengerContact
    Dim objMessengerContacts As IMessengerContacts

    Set objMessenger = New MessengerAPI.Messenger
    Set objMessengerContacts = m_objMessenger.MyContacts
If sent = False Then
    For Each objMessengerContact In objMessengerContacts
        If objMessengerContact.Status = MISTATUS_ONLINE Then
          objMessenger.InstantMessage objMessengerContact
          SendKeys "Insert Message Here"
          Call PostMessage("IMWindowClass", WM_CLOSE, 0, 0)
          sent = True
          End If
    Next
Else
MsgBox "Message Has Already Been Sent!"
End If
End Sub


When I try to put it it says 'User-defined type not defined!'
What do I do??

It says it in
code:
        Dim objMessengerContact As IMessengerContact
        Dim objMessengerContacts As IMessengerContacts

RE: Need help by Plik on 02-17-2005 at 07:47 PM

stick this above the initialise function.

code:
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

private const WM_USER = &10


RE: Need help by Dark Link on 02-17-2005 at 07:50 PM

Its saying the same


RE: Need help by Mike on 02-17-2005 at 07:59 PM

Did you selected the messenger api refernce?


RE: Need help by TGG on 02-17-2005 at 08:11 PM

Click project>References  and then choose Messenger API Type Library


RE: Need help by Dark Link on 02-20-2005 at 07:23 PM

quote:
that wont send it it needs sendkeys {enter} too
How do I do that?