What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Block Command - Messenger API

Block Command - Messenger API
Author: Message:
michael_m91
Full Member
***


Posts: 371
Reputation: 1
33 / Male / –
Joined: Jan 2004
O.P. Block Command - Messenger API
How do you use the block command with Plugins.
not like sresult = "/block"

i wan't to use the Messenger API

[Image: Email.JPG]
09-15-2004 04:58 AM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Block Command - Messenger API
Take a look at the attached file.

.zip File Attachment: MessengerAPI.zip (355.64 KB)
This file has been downloaded 171 time(s).
[Image: spartaafk.png]
09-15-2004 11:26 AM
Profile PM Web Find Quote Report
michael_m91
Full Member
***


Posts: 371
Reputation: 1
33 / Male / –
Joined: Jan 2004
O.P. RE: Block Command - Messenger API
quote:
Originally posted by raceprouk
Take a look at the attached file.
Thankyou but i've looked at it a few times i just wan't someone to help me with this one.

[Image: Email.JPG]
09-15-2004 12:30 PM
Profile E-Mail PM Web Find Quote Report
Millenium_edition
Veteran Member
*****

Avatar

Posts: 1787
Reputation: 57
Joined: Apr 2003
RE: Block Command - Messenger API
quote:
Originally posted by raceprouk
Take a look at the attached file.

and if you can't look at the attached file we can't help you. we're not code bitches :)
09-15-2004 12:33 PM
Profile E-Mail PM Find Quote Report
michael_m91
Full Member
***


Posts: 371
Reputation: 1
33 / Male / –
Joined: Jan 2004
O.P. RE: Block Command - Messenger API
quote:
Originally posted by Millenium_edition
quote:
Originally posted by raceprouk
Take a look at the attached file.

and if you can't look at the attached file we can't help you. we're not code bitches :)

Alright... I just am having troubles understanding this one btw

Edit by michael_m91:
code:
Public WithEvents MsgrUIA As MessengerAPI.Messenger
Public MsgrContact As MessengerAPI.IMessengerContact

Private Sub btnBlocked_Click()
    On Error Resume Next
    Dim strSigninName As String
    Dim strServiceID As String
    'Get selected contact
    strSigninName = ListContact.SelectedItem.SubItems(2)
    strServiceID = ListContact.SelectedItem.SubItems(5)
    Set MsgrContact = Nothing
    Set MsgrContact = MsgrUIA.GetContact(strSigninName, strServiceID)
    ErrorTrap ("GetContact")    'Error handling routine
    If MsgrContact.Blocked = True Then
        MsgrContact.Blocked = False
        MsgBox("Contact: " & CStr(MsgrContact.SigninName) & " is now Unblocked")
    Else
        MsgrContact.Blocked = True
        MsgBox("Contact: " & CStr(MsgrContact.SigninName) & " is now Blocked")
    End If
    ErrorTrap ("Contact.Blocked")    'Error handling routine
    populateListView    'Refresh contact list
End Sub

I don't understand how to name what contact I wan't to block.

This post was edited on 09-15-2004 at 01:06 PM by michael_m91.

[Image: Email.JPG]
09-15-2004 12:42 PM
Profile E-Mail PM Web Find Quote Report
Millenium_edition
Veteran Member
*****

Avatar

Posts: 1787
Reputation: 57
Joined: Apr 2003
RE: Block Command - Messenger API
code:
Private WithEvents objMessenger As MessengerAPI.Messenger

Private Sub Form_Load()
Set objMessenger = new MessengerAPI.Messenger
End Sub
should get you started. then you can use this to block someone
code:
Private Sub BlockContact (ByVal strContact As String)
objMessenger.GetContact(strContact, objMessenger.Services.PrimaryService).Blocked = True
End Sub
09-15-2004 12:53 PM
Profile E-Mail PM Find Quote Report
michael_m91
Full Member
***


Posts: 371
Reputation: 1
33 / Male / –
Joined: Jan 2004
O.P. RE: RE: Block Command - Messenger API
quote:
Originally posted by Millenium_edition
code:
Private WithEvents objMessenger As MessengerAPI.Messenger

Private Sub Form_Load()
Set objMessenger = new MessengerAPI.Messenger
End Sub
should get you started. then you can use this to block someone
code:
Private Sub BlockContact (ByVal strContact As String)
objMessenger.GetContact(strContact, objMessenger.Services.PrimaryService).Blocked = True
End Sub


Do I specify which contact with "ctrContact" and how do I specify which contact (Friendly Name? Service Id? what?)

This objmessenger isnt in the Messenger API right? It's prat of the plugin making stuff.

[Image: Email.JPG]
09-15-2004 01:10 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Block Command - Messenger API
quote:
Originally posted by michael_m91
I don't understand how to name what contact I wan't to block.
Even without understanding the exact meaning of things you can easly figure that out:

MsgBox("Contact: " & CStr(MsgrContact.SigninName) & " is now unblocked")

this shows something like: "Contact: contacts name is now unblocked"... this means that Contacts name = MsgrContact.SigninName

Now step back in the source. Where is MsgrContact.SigninName defined? here:

Set MsgrContact = MsgrUIA.GetContact(strSigninName, strServiceID)

So what is strSigninName? Just simple step back:

strSigninName = ListContact.SelectedItem.SubItems(2)

There you have it: ListContact.SelectedItem., a listcontrol and together with btnBlocked_Click() I see that this code is a sub for when you click on a button on a form with a listcontrol which contains the contactnames/mails.


All in all, this is basic programming stuff and actually very easy to understand if you can program a very small bit. If you can't (and you can't reconize what a variable, object and/or property is), then I suggest you to first learn easier and basic programming stuff, before attempting doing stuff with API's, objects, protocol-handling, etc...

This post was edited on 09-15-2004 at 01:24 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-15-2004 01:20 PM
Profile PM Find Quote Report
Millenium_edition
Veteran Member
*****

Avatar

Posts: 1787
Reputation: 57
Joined: Apr 2003
RE: Block Command - Messenger API
it's the messengerapi library, and in strContact you place the obvious, the e-mail address.
09-15-2004 01:21 PM
Profile E-Mail PM Find Quote Report
michael_m91
Full Member
***


Posts: 371
Reputation: 1
33 / Male / –
Joined: Jan 2004
O.P. RE: Block Command - Messenger API
code:
Public WithEvents MsgrUIA As MessengerAPI.Messenger
Public MsgrContact As MessengerAPI.IMessengerContact

Private Sub btnBlocked_Click()
    On Error Resume Next
    Dim strSigninName As String
    Dim strServiceID As String
    'Get selected contact
    strSigninName = ListContact.SelectedItem.SubItems(2)
    strServiceID = ListContact.SelectedItem.SubItems(5)
    Set MsgrContact = Nothing
    Set MsgrContact = MsgrUIA.GetContact(strSigninName, strServiceID)
    ErrorTrap ("GetContact")    'Error handling routine
    If MsgrContact.Blocked = True Then
        MsgrContact.Blocked = False
        MsgBox ("Contact: " & CStr(MsgrContact.SigninName) & " is now Unblocked")
    Else
        MsgrContact.Blocked = True
        MsgBox ("Contact: " & CStr(MsgrContact.SigninName) & " is now Blocked")
    End If
    ErrorTrap ("Contact.Blocked")   'Error handling routine
    populateListView    'Refresh contact list
End Sub


The following are what my code complains about

[Image: Email.JPG]
09-16-2004 12:35 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On