VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



To auto respond to an MSN Instant Message

by ?oothR¨?koo? (2 Submissions)
Category: Internet/HTML
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 5th April 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

To auto respond to an MSN Instant Message

Rate To auto respond to an MSN Instant Message




'-------------------------USE-----------------------
'-----------------------FREELY----------------------
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Sub ReleaseCapture Lib "user32" ()
Dim WithEvents respond As MsgrObject
Dim MsnApp As IMessengerApp


Private Sub Command1_Click()
Unload frmRespond
End Sub

Private Sub Form_Load()
Set respond = New MsgrObject 'declaring the messenger object
 Set MsnApp = CreateObject("messenger.messengerapp") 'declaring the messenger object
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim lngReturnValue As Long 'for the form to move by dragging
   If Button = 1 Then
      Call ReleaseCapture
      lngReturnValue = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
  End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set respond = Nothing ' after use it will delete the declared method
End Sub

Private Sub lblInfo_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim lngReturnValue As Long
   If Button = 1 Then
      Call ReleaseCapture
      lngReturnValue = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
  End If
End Sub

Private Sub lblTitleBar_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim lngReturnValue As Long
   If Button = 1 Then
      Call ReleaseCapture
      lngReturnValue = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
  End If
End Sub

Private Sub respond_OnLogoff()
frmstop.Show ' detects if u log off and will shutdown the program
End Sub

Private Sub respond_OnTextReceived(ByVal pIMSession As Messenger.IMsgrIMSession, ByVal pSourceUser As Messenger.IMsgrUser, ByVal bstrMsgHeader As String, ByVal bstrMsgText As String, pfEnableDefault As Boolean)
If Check1.Value = 1 Then
MsnApp.LaunchIMUI pSourceUser ' launches a im window to the person that trying to contact u
MsnApp.IMWindows.Item(0).SendText (Text1.Text) 'away message details
End If
End Sub



Download this snippet    Add to My Saved Code

To auto respond to an MSN Instant Message Comments

No comments have been posted about To auto respond to an MSN Instant Message. Why not be the first to post a comment about To auto respond to an MSN Instant Message.

Post your comment

Subject:
Message:
0/1000 characters