我有以下代码,我需要知道按钮的名称,因为该按钮是唯一能够执行任务的按钮。
Class MessageFilter
Implements IMessageFilter
Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements System.Windows.Forms.IMessageFilter.PreFilterMessage
If Form1.SavingData Then
Const WM_KEYDOWN As Integer = &H100
'Const WM_MOUSELEAVE As Integer = &H2A3
Const WM_MOUSE_LEFT_CLICK As Integer = &H201
Select Case m.Msg
Case WM_KEYDOWN, WM_MOUSE_LEFT_CLICK
' Do something to indicate the user is still active.
Form1.SavingData = False
Exit Select
End Select
' Returning true means that this message should stop here,
' we aren't actually filtering messages, so we need to return false.
End If
Return False
End Function
End Class
https://stackoverflow.com/questions/44415644
复制相似问题