Page 1 of 2

*Msn* Listbox With Msn Contacts!

Posted: Wed Dec 16, 2009 5:30 pm
by hiyadutch
first go to Reference and click Messanger API

the at the top of you're code
Code: Select all
Imports MessengerAPI
and under public class
Code: Select all
Dim msn As New MessengerAPI.Messenger
then make
-2 buttons (button1 for select chat) and button 2 for refresh
-listbox1 (All online Contacts!)
-textbox1 (selectd contact!)

ok double click on the form_load then put in
Code: Select all
  Dim cons As IMessengerContacts
        Dim con As IMessengerContact
        listbox1.Items.Clear()
        cons = msn.MyContacts
        For Each con In cons
            If con.Status <> MISTATUS.MISTATUS_OFFLINE Then
                listbox1.Items.Add(con.SigninName)
            End If
        Next
and in listbox1
Code: Select all
textbox1.Text = listbox1.Text
and in button1
Code: Select all
   msn.InstantMessage(textbox1.Text)
and in button2
Code: Select all
 Me.Refresh()
that was it:P

Re: *Msn* Listbox With Msn Contacts!

Posted: Mon Dec 28, 2009 1:52 am
by RunarM
Cool ^^
I've added some more features:
Image

The X [simple]:
Code: Select all
        Me.Close()
The Online/Offline Button:
Code: Select all
        If msn.MyStatus = MISTATUS.MISTATUS_ONLINE Then
            Button4.Text = "Offline"
            msn.MyStatus = MISTATUS.MISTATUS_INVISIBLE
        Else
            Button4.Text = "Online"
            msn.MyStatus = MISTATUS.MISTATUS_ONLINE
        End If
Form1:
Code: Select all
        If msn.MyStatus = MISTATUS.MISTATUS_ONLINE Then
            Button4.Text = "Offline"
        Else
            Button4.Text = "Online"
        End If
        Dim cons As IMessengerContacts
        Dim con As IMessengerContact
        ListBox1.Items.Clear()
        cons = msn.MyContacts
        For Each con In cons
            If con.Status <> MISTATUS.MISTATUS_OFFLINE Then
                ListBox1.Items.Add(con.SigninName)
            End If
        Next
Public Class Form1:
Code: Select all
    Dim displayname As New MessengerAPI.Messenger
    Public WithEvents msn As New Messenger 
Get Current Name Button:
Code: Select all
        Lblcurrent.Text = displayname.myfriendlyname 
Set New name Button:
Code: Select all
         displayname.optionsPage(0, MessengerAPI.MOPTIONPAGE.MOPT_GENERAL_PAGE)
        SendKeys.Send(TxtNew.Text)
        SendKeys.Send("{Enter}") 
THIS IS FOR THE RIGHT PART:
Name the Get Current Name Button "btnCurrent"
Name the Set New name Button "btnNew"
Name the Textbox above "TxtNew"
Name the Info About Name label "Lblcurrent"


Ye, i think thats it.


Download my software <3: [You need WinRar to open it!!!]

Re: *Msn* Listbox With Msn Contacts!

Posted: Mon Dec 28, 2009 1:02 pm
by Nery
I have some problems with the Messenger APIs, I can't use them, I never could, I tried to do enumerous things for MSN and I always had the same troubles in Messenger APIs, I must have some compatibility problems or something since I have Windows 7...

Great tutorial though...

Re: *Msn* Listbox With Msn Contacts!

Posted: Fri Jan 01, 2010 8:31 pm
by RunarM
I don't think its because you have have Windows 7, cause thats why i am using.
Have you tried to reinstall windows messager, well if that doesnt work then i can't help you :/

Re: *Msn* Listbox With Msn Contacts!

Posted: Sat Jan 02, 2010 2:14 pm
by Lewis
Yeah msn API dont work for me, and im using windows XP

Re: *Msn* Listbox With Msn Contacts!

Posted: Wed Jan 06, 2010 4:50 pm
by Usman55
Hello Everyone!
This program is very nice but I don't use MSN lol!
Thanks anyways!

Re: *Msn* Listbox With Msn Contacts!

Posted: Thu Jan 14, 2010 10:27 am
by Nery
Well I reinstalled MSN multiple times but it still doesn't work.
I give up, dam you Microsoft!!!!!

Re: *Msn* Listbox With Msn Contacts!

Posted: Thu Jan 14, 2010 5:31 pm
by Lewis
This would be good aswell

Re: *Msn* Listbox With Msn Contacts!

Posted: Fri Jan 15, 2010 2:43 am
by Esky
Cheers mate works fine here :D

Re: *Msn* Listbox With Msn Contacts!

Posted: Sat Mar 20, 2010 2:17 pm
by upperdrag
THANK YOU