0
我正在爲我的一個軟件(音頻播放器)編寫一個eventghost的小插件。 EventGhost可以發送SendMessage或PostMessage消息來控制其他應用程序。我如何在VB.NET應用程序中接收這些消息?有任何想法嗎?謝謝!如何在VB.NET中接收PostMessage/SendMessage?
我正在爲我的一個軟件(音頻播放器)編寫一個eventghost的小插件。 EventGhost可以發送SendMessage或PostMessage消息來控制其他應用程序。我如何在VB.NET應用程序中接收這些消息?有任何想法嗎?謝謝!如何在VB.NET中接收PostMessage/SendMessage?
OK,我發現我自己:
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