Need help |
Author: |
Message: |
Dark Link
Junior Member
Posts: 24
Joined: Dec 2004
|
O.P. Need help
How can I do in vb6 to send a message to every contact on my list when i start msn???
|
|
02-16-2005 05:38 PM |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
Joined: Oct 2003
|
RE: Need help
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.
Attachment: MessengerAPI.zip (355.64 KB)
This file has been downloaded 162 time(s).
This post was edited on 02-16-2005 at 07:02 PM by RaceProUK.
|
|
02-16-2005 07:01 PM |
|
|
Stigmata
Veteran Member
Posts: 3520 Reputation: 45
21 / /
Joined: Jul 2003
|
RE: Need help
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
This post was edited on 02-16-2005 at 07:10 PM by Stigmata.
|
|
02-16-2005 07:04 PM |
|
|
Dark Link
Junior Member
Posts: 24
Joined: Dec 2004
|
O.P. RE: Need help
Ok but I was trying to do it in a MSGPLUS Plugin. But thanks.
|
|
02-16-2005 07:07 PM |
|
|
Stigmata
Veteran Member
Posts: 3520 Reputation: 45
21 / /
Joined: Jul 2003
|
RE: Need help
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....
This post was edited on 02-16-2005 at 07:16 PM by Stigmata.
|
|
02-16-2005 07:11 PM |
|
|
Dark Link
Junior Member
Posts: 24
Joined: Dec 2004
|
O.P. RE: Need help
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.
|
|
02-16-2005 07:17 PM |
|
|
Stigmata
Veteran Member
Posts: 3520 Reputation: 45
21 / /
Joined: Jul 2003
|
RE: Need help
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
|
|
02-16-2005 08:18 PM |
|
|
Dempsey
Scripting Contest Winner
http://AdamDempsey.net
Posts: 2395 Reputation: 53
38 / /
Joined: Jul 2003
|
RE: Need help
that wont send it it needs sendkeys {enter} too
|
|
02-16-2005 11:17 PM |
|
|
Dark Link
Junior Member
Posts: 24
Joined: Dec 2004
|
O.P. RE: Need help
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
This post was edited on 02-17-2005 at 08:15 PM by WDZ.
|
|
02-17-2005 07:39 PM |
|
|
Plik
Veteran Member
Posts: 1489 Reputation: 46
35 / / –
Joined: Jun 2004
|
RE: Need help
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
|
|
02-17-2005 07:47 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|