using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
using MouseHook;
namespace KeyboardTracker
{
public partial class mainForm : Form
{
public mainForm()
{
InitializeComponent();
EventThief et = new EventThief();
// This is where I can't get any further - how do I translate the 'with' operator ? It says et.LEFT_UP is a short so I can't set it to true :(
et.LEFT_UP = true;
}
private TracerClass MyMouseHunter = new TracerClass();
//* Tracking the system wide mouse events
private void MyMouseHunter_OnSystemMouseMove()
{
//* Choose anything you want to trace when your mouse moves
//* You can trace the X and Y coordinate of your mouse position in the window
//* Or the Window handle (hWnd) { of the window under your mouse
//* Or the Window title (Caption) { under your mouse.
//lblWindowTitle.Caption = MyMouseHunter.CoordinateX & "," & MyMouseHunter.CoordinateY
//lblWindowTitle.Caption = MyMouseHunter.WindowHandleUnderMouse
this.Text = MyMouseHunter.WindowTextUnderMouse;
Console.WriteLine("Moving...");
}
private void MyMouseHunter_OnSystemMouseLeftDown()
{
Console.WriteLine("Left Down");
}
private void MyMouseHunter_OnSystemMouseLeftUp()
{
Console.WriteLine("Left Up");
}
private void MyMouseHunter_OnSystemMouseRightDown()
{
Console.WriteLine("Right Down");
}
private void MyMouseHunter_OnSystemMouseRightUp()
{
Console.WriteLine("Right Up");
}
private void MyMouseHunter_OnSystemMouseMiddleDown()
{
Console.WriteLine("Middle Down");
}
private void MyMouseHunter_OnSystemMouseMiddleUp()
{
Console.WriteLine("Middle Up");
}
private void MyMouseHunter_OnSystemMouseWheel()
{
Console.WriteLine("Wheel...");
}
}
}