我有一个单页Winforms应用程序的示例代码
我想在控制台应用程序中重用它
示例代码:
Protected Overrides Sub WndProc(ByRef msg As Message)
If (msg.Msg = SGFPMMessages.DEV_AUTOONEVENT) Then
If (msg.WParam.ToInt32() = SGFPMAutoOnEvent.FINGER_ON) Then
StatusBar.Text = "Device Message: Finger On"
ElseIf (msg.WParam.ToInt32() = SGFPMAutoOnEvent.FINGER_OFF) Then
StatusBar.Text = "Device Message: Finger Off"
End If
End If
MyBase.WndProc(msg)
End Sub
我的尝试:
Imports System.Windows.Forms
Sub WndProc(ByRef msg As Message)
If (msg.Msg = SGFPMMessages.DEV_AUTOONEVENT) Then
If (msg.WParam.ToInt32() = SGFPMAutoOnEvent.FINGER_ON) Then
Console.Title = "Device Message: Finger On"
ElseIf (msg.WParam.ToInt32() = SGFPMAutoOnEvent.FINGER_OFF) Then
Console.Title = "Device Message: Finger Off"
End If
End If
//MyBase.WndProc(msg)
End Sub