Results 1 to 8 of 8

Thread: API to display windows messenger alert?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241

    API to display windows messenger alert?

    Is there an API or something along the lines of an API to display a windows messenger alert?

  2. #2
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Did you mean the Messenger Service on Windows..

    I guess it uses UDP and may be you can write a socket to read from that port...

    I tried and Tried and finally Gave up..
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    You need to use the NetMessageBufferSend api call. This would work only on Win NT/2000/XP.
    See this link:
    http://www.mvps.org/vbnet/code/netwo...buffersend.htm

  4. #4
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi Amitab

    Hi,

    But how do you catch it..

    (The mesenger Service which runs on the windows Nt does it for us.)

    If I wanto programatically catch the message sent.. is there any way .. to do it..?.

    Thanks,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  5. #5
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    The following code is to send messages..

    VB Code:
    1. Private Declare Function NetMessageBufferSend Lib _
    2.   "NETAPI32.DLL" (yServer As Any, yToName As Byte, _
    3.   yFromName As Any, yMsg As Byte, ByVal lSize As Long) As Long
    4. Private Const NERR_Success As Long = 0&
    5. Public Function SendMessage(RcptToUser As String, _
    6.    FromUser As String, BodyMessage As String) As Boolean
    7.  
    8.    Dim RcptTo() As Byte
    9.    Dim From() As Byte
    10.    Dim Body() As Byte
    11.  
    12.    RcptTo = RcptToUser & vbNullChar
    13.    From = FromUser & vbNullChar
    14.    Body = BodyMessage & vbNullChar
    15.  
    16.    If NetMessageBufferSend(ByVal 0&, RcptTo(0), ByVal 0&, _
    17.         Body(0), UBound(Body)) = NERR_Success Then
    18.      SendMessage = True
    19.    End If
    20.  
    21. End Function
    22. Private Sub Form_Load()
    23.     'Example created by X-MaD (x-mad@zolnetwork.com)
    24.     'Visit his website at [url]http://www.zolnetwork.com/x-mad[/url]
    25.     Dim RetVal As Boolean
    26.     RetVal = SendMessage("Utente", "FromUser", "BodyText")
    27. End Sub

    Instead for using the above code..

    Use
    VB Code:
    1. Winexec  "net send " & machineName & " " & message, 1
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    I haven't been able to do it till now. I am not even sure if the Message arrives on port 37,38,39(normal NetBios communication Ports) or 17 which I got through Newsgroups. I tried on both of them, but was unsuccessful.

  7. #7
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi,

    I will put on the Port Scaner and check which port it is using..
    I still feel its UDP.. in that case we cant..

    Regards,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  8. #8
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    I have tried that already, but then, you might get a better result.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width