VB.Net by API/System.Windows.Forms/IMessageFilter
Версия от 16:40, 26 мая 2010; (обсуждение)
Implements IMessageFilter
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
Imports System.Math
public class MessageFilter
public Shared Sub Main
Application.Run(New Form1)
End Sub
End class
Public Class Form1
Public Class NoLeftDownMessageFilter
Implements IMessageFilter
Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements IMessageFilter.PreFilterMessage
Const WM_LBUTTONDOWN As Long = &H201
Return (m.Msg = WM_LBUTTONDOWN)
End Function
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim no_left_down_message_filter As New NoLeftDownMessageFilter
Application.AddMessageFilter(no_left_down_message_filter)
End Sub
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
Application.UseWaitCursor = Not Application.UseWaitCursor
End Sub
End Class
<Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()> _
Partial Public Class Form1
Inherits System.Windows.Forms.Form
"Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ruponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.SuspendLayout()
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Text = "UseMessageFilter"
Me.ResumeLayout(False)
End Sub
End Class