*Msn* Listbox With Msn Contacts!

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
13 posts Page 1 of 2
User avatar
hiyadutch
New Member
New Member
Posts: 18
Joined: Thu Dec 10, 2009 8:45 pm

*Msn* Listbox With Msn Contacts!
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
User avatar
RunarM
Hardcore Programmer
Hardcore Programmer
Posts: 508
Joined: Wed Nov 18, 2009 11:33 pm

Re: *Msn* Listbox With Msn Contacts!
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!!!]
You do not have the required permissions to view the files attached to this post.
Just another day in my life.
http://www.codexvideos.com
User avatar
Nery
Co-Admin Moderator
Co-Admin Moderator
Posts: 1117
Joined: Mon Sep 07, 2009 8:11 pm

Re: *Msn* Listbox With Msn Contacts!
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...
User avatar
RunarM
Hardcore Programmer
Hardcore Programmer
Posts: 508
Joined: Wed Nov 18, 2009 11:33 pm

Re: *Msn* Listbox With Msn Contacts!
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 :/
Just another day in my life.
http://www.codexvideos.com
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: *Msn* Listbox With Msn Contacts!
Lewis
Yeah msn API dont work for me, and im using windows XP
Image
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Hello Everyone!
This program is very nice but I don't use MSN lol!
Thanks anyways!
Image
User avatar
Nery
Co-Admin Moderator
Co-Admin Moderator
Posts: 1117
Joined: Mon Sep 07, 2009 8:11 pm

Re: *Msn* Listbox With Msn Contacts!
Nery
Well I reinstalled MSN multiple times but it still doesn't work.
I give up, dam you Microsoft!!!!!
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: *Msn* Listbox With Msn Contacts!
Lewis
This would be good aswell
Image
User avatar
Esky
VIP - Donator
VIP - Donator
Posts: 86
Joined: Tue Dec 22, 2009 11:36 am

Re: *Msn* Listbox With Msn Contacts!
Esky
Cheers mate works fine here :D
Current Project: Server Browser - Beta & Text based MMORPG
Image
User avatar
upperdrag
Excellent Poster
Excellent Poster
Posts: 321
Joined: Fri Mar 12, 2010 12:05 pm

THANK YOU
13 posts Page 1 of 2
Return to “Tutorials”