you need to do something like this:
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Const WM_COMMAND = &H111
Private Sub Form_Load()
Dim classstring as string
Dim hwndKazaa as long
classstring = "KaZaA" & vbNullString
hwndkazaa = FindWindow(classstring, vbNullString)
If hwndkazaa > 0 Then
Call SendMessage(hwndkazaa, WM_COMMAND, 32891, vbNullString)
End If
End Sub
This would send the 'disconnect' message to Kazaa - the 32891 in the SendMessage command is the decimal equivalent of the 0x807B shown on http://kazaasearch.narod.ru/KazaaCommands.htm.
Bookmarks