public sealed class MouseMonitor : NativeWindow,
IDisposable
Public NotInheritable Class MouseMonitor
Inherits NativeWindow
Implements IDisposable
Dim instance As MouseMonitor
public ref class MouseMonitor sealed : public NativeWindow,
IDisposable
[<SealedAttribute>]
type MouseMonitor =
class
inherit NativeWindow
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Public NotInheritable Class Form1 : Inherits Form
Friend WithEvents MouseMon As New MouseMonitor(Me)
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As EventArgs) _
Handles MyBase.Shown
Me.MouseMon.WorkingArea = SystemInformation.VirtualScreen
Me.MouseMon.SuppressMouseButtonUpEventWhenDoubleClick = False
Me.MouseMon.Enabled = True
End Sub
''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Handles the <see cref="MouseMonitor.MouseMove"/> event of the <see cref="MouseMon"/> instance.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="sender">
''' The source of the event.
''' </param>
'''
''' <param name="e">
''' The <see cref="MouseMoveEventArgs"/> instance containing the event data.
''' </param>
''' ----------------------------------------------------------------------------------------------------
Private Sub MouseMon_MouseMove(ByVal sender As Object, ByVal e As MouseMoveEventArgs) _
Handles MouseMon.MouseMove
Console.WriteLine(String.Format("Mouse moved to: {0}", e.Position.ToString()))
End Sub
''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Handles the <see cref="MouseMonitor.MouseButtonClick"/> event of the <see cref="MouseMon"/> instance.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="sender">
''' The source of the event.
''' </param>
'''
''' <param name="e">
''' The <see cref="MouseButtonClickEventArgs"/> instance containing the event data.
''' </param>
''' ----------------------------------------------------------------------------------------------------
Private Sub MouseMon_MouseButtonClick(ByVal sender As Object, ByVal e As MouseButtonClickEventArgs) _
Handles MouseMon.MouseButtonClick
Console.WriteLine(String.Format("Mouse Button Click: {0,-10} at: {1}", e.MouseButton.ToString(), e.DeviceInfo.Position.ToString()))
End Sub
''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Handles the <see cref="MouseMonitor.MouseButtonDoubleClick"/> event of the <see cref="MouseMon"/> instance.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="sender">
''' The source of the event.
''' </param>
'''
''' <param name="e">
''' The <see cref="MouseButtonDoubleClickEventArgs"/> instance containing the event data.
''' </param>
''' ----------------------------------------------------------------------------------------------------
Private Sub MouseMon_MouseButtonDoubleClick(ByVal sender As Object, ByVal e As MouseButtonDoubleClickEventArgs) _
Handles MouseMon.MouseButtonDoubleClick
Console.WriteLine(String.Format("Mouse Button Double-Click: {0,-5} at: {1}", e.MouseButton.ToString(), e.DeviceInfo.Position.ToString()))
End Sub
''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Handles the <see cref="MouseMonitor.MouseWheelScroll"/> event of the <see cref="MouseMon"/> instance.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="sender">
''' The source of the event.
''' </param>
'''
''' <param name="e">
''' The <see cref="MouseWheelScrollEventArgs"/> instance containing the event data.
''' </param>
''' ----------------------------------------------------------------------------------------------------
Private Sub MouseMon_MouseWheelScroll(ByVal sender As Object, ByVal e As MouseWheelScrollEventArgs) _
Handles MouseMon.MouseWheelScroll
Console.WriteLine(String.Format("Mouse wheel scrolled to: {0}", e.WheelDirection.ToString()))
End Sub
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
MouseMonitor | Initializes a new instance of the MouseMonitor class. Caling this constructor causes to registers the raw input devices for the calling window. |
DeviceCount | Gets the amount of mouse devices. |
Enabled | Gets or sets a value that determines whether the mouselogger is enabled. |
Handle | Gets the handle for the window that owns this MouseMonitor instance. |
OwnerWindow | Gets the window that owns this MouseMonitor instance. |
SuppressMouseButtonUpEventWhenDoubleClick | ** ONLY FOR TESTING PURPOSES ** Gets or sets a value indicating whether to suppress the last MouseUp event of when a double-click occurs. If this value is set to , the application will send the events in this order for a Double-Click: MouseDown, MouseUp, MouseDown, MouseDoubleClick If this value is set to , the application will send the events in this order for a Double-Click: MouseDown, MouseUp, MouseDown, MouseUp, MouseDoubleClick |
WorkingArea | Gets or sets the screen's working area on which to notify about mouse events. The events fired by this MouseMonitor will be restricted to the bounds of the specified rectangle. |
AssignHandle | Assigns a handle to this window. (Inherited from NativeWindow) |
CreateHandle | Creates a window and its handle with the specified creation parameters. (Inherited from NativeWindow) |
CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject) |
DefWndProc | Invokes the default window procedure associated with this window. (Inherited from NativeWindow) |
DestroyHandle | Destroys the window and its handle. (Inherited from NativeWindow) |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject) |
ReleaseHandle | Releases the handle associated with this window. (Inherited from NativeWindow) |
ToString | Returns a string that represents the current object. (Inherited from Object) |
MouseButtonClick | Occurs when a mouse button is clicked. |
MouseButtonDoubleClick | Occurs when a mouse button is clicked twice producing a double-click. |
MouseMove | Occurs when the mouse moves. |
MouseWheelScroll | Occurs when the mouse wheel scrolls up or down. |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |