''Answering Machine
'Imports System.Net
'Imports SKYPE4COMLib

Public Class SkypeMachine

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        For Each u As SKYPE4COMLib.User In AxSkype1.Friends
            ComboBox1.Items.Add(u.Handle)
        Next

        '        'Answering Machine
        '        If chkAutoAnswer.Checked = True Then
        '            Dim Skype = New SKYPE4COMLib.Skype
        '            Skype.Attach()
        '            AddHandler Skype.MessageStatus, AddressOf Skype_messagestatus
        '        End If
        '    End Sub

        'Public Sub Skype_messagestatus(ByVal msg As ChatMessage, ByVal status As TChatMessageStatus)
        '    If status = TChatMessageStatus.cmsReceived Then
        '        msg.Chat.SendMessage(TextBox2.Text)
        '    End If
    End Sub

    Private Sub btnCall_Click(sender As Object, e As EventArgs) Handles btnCall.Click
        Try
            AxSkype1.PlaceCall(ComboBox1.Text)
            btnCall.Visible = False
            btnEndCall.Visible = True
        Catch ex As Exception

        End Try
    End Sub

    Private Sub btnEndCall_Click(sender As Object, e As EventArgs) Handles btnEndCall.Click
        Try
            AxSkype1.ActiveCalls.Item(1).Finish()
            btnCall.Visible = True
            btnEndCall.Visible = False
        Catch ex As Exception

        End Try
    End Sub

    Private Sub btnMessage_Click(sender As Object, e As EventArgs) Handles btnMessage.Click
        Try
            AxSkype1.SendMessage(ComboBox1.Text, TextBox1.Text)
            If chkAutoClean.Checked = True Then : TextBox1.Text = "" : End If
        Catch ex As Exception

        End Try

    End Sub

    Private Sub btnStop_Click(sender As Object, e As EventArgs) Handles btnStop.Click
        Try
            Timer1.Stop()
            btnSpam.Visible = True
            btnStop.Visible = False
            btnCall.Enabled = True
            btnMessage.Enabled = True
            BtnMsgAll.Enabled = True
        Catch ex As Exception

        End Try
    End Sub

    Private Sub btnSpam_Click(sender As Object, e As EventArgs) Handles btnSpam.Click
        Try
            Timer1.Start()
            btnSpam.Visible = False
            btnStop.Visible = True
            btnCall.Enabled = False
            btnMessage.Enabled = False
            BtnMsgAll.Enabled = False
        Catch ex As Exception

        End Try

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Try
            AxSkype1.SendMessage(ComboBox1.Text, TextBox1.Text)
        Catch ex As Exception

        End Try
    End Sub

    Private Sub BtnMsgAll_Click(sender As Object, e As EventArgs) Handles BtnMsgAll.Click
        For Each u As SKYPE4COMLib.User In AxSkype1.Friends
            Try
                AxSkype1.SendMessage(u.Handle, TextBox1.Text)
            Catch ex As Exception

            End Try
        Next
    End Sub

    Private Sub btnStatusOnline_Click(sender As Object, e As EventArgs) Handles btnStatusOnline.Click
        AxSkype1.ChangeUserStatus(SKYPE4COMLib.TUserStatus.cusOnline)
    End Sub

    Private Sub btnStatusAway_Click(sender As Object, e As EventArgs) Handles btnStatusAway.Click
        AxSkype1.ChangeUserStatus(SKYPE4COMLib.TUserStatus.cusAway)
    End Sub

    Private Sub btnStatusDoNotDsrb_Click(sender As Object, e As EventArgs) Handles btnStatusDoNotDsrb.Click
        AxSkype1.ChangeUserStatus(SKYPE4COMLib.TUserStatus.cusDoNotDisturb)
    End Sub

    Private Sub btnStatusInvisible_Click(sender As Object, e As EventArgs) Handles btnStatusInvisible.Click
        AxSkype1.ChangeUserStatus(SKYPE4COMLib.TUserStatus.cusInvisible)
    End Sub

    Private Sub btnStatusSpam_Click(sender As Object, e As EventArgs) Handles btnStatusSpam.Click
        Timer2.Start()
        btnStatusSpam.Visible = False
        btnStatusStop.Visible = True
    End Sub

    Private Sub btnStatusStop_Click(sender As Object, e As EventArgs) Handles btnStatusStop.Click
        Timer2.Stop()
        btnStatusSpam.Visible = True
        btnStatusStop.Visible = False
    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
        AxSkype1.ChangeUserStatus(SKYPE4COMLib.TUserStatus.cusOnline)
        AxSkype1.ChangeUserStatus(SKYPE4COMLib.TUserStatus.cusAway)
        AxSkype1.ChangeUserStatus(SKYPE4COMLib.TUserStatus.cusDoNotDisturb)
        AxSkype1.ChangeUserStatus(SKYPE4COMLib.TUserStatus.cusInvisible)
    End Sub

    Private Sub mnuHelpDeveloper_Click(sender As Object, e As EventArgs) Handles mnuHelpDeveloper.Click
        MsgBox("Juyoung Lee  5/10/14")
    End Sub
End Class