views:

23

answers:

1

Hi,

I am trying to write a small plugin for eventghost for one of my software (audio player). EventGhost can send SendMessage or PostMessage messages to control other apps. How can I receive such messages in a VB.NET app? Any Ideas? Thanks!

A: 

OK, I found out by myself:

Public Class Form1
    Private Const WM_COMMAND As Integer = &H111

    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        'Show the Message "OK" if someone sends a message with WParam 2:
        If (m.Msg = WM_COMMAND AndAlso m.WParam = CType(2, IntPtr)) Then
            MsgBox("OK")
        End If
        MyBase.WndProc(m)
    End Sub

End Class
qxxx