I did in my Form1 top :
using Gma.UserActivityMonitor;
Then declared :
Gma.UserActivityMonitor.GlobalEventProvider actHook = new GlobalEventProvider();
Then in the Load event i did :
actHook.MouseClick += actHook_MouseClick;
Then in the bottom :
private void actHook_MouseClick(object sender, MouseEventArgs e)
{
if (e.Clicks > 0)
{
MessageBox.Show("hi");
}
}
But once i run my application after a second before anything loaded i'm getting an exception on the file : HookManager.Callbacks.cs
On line:
throw new Win32Exception(errorCode);
The exception : The specified module could not be found
System.ComponentModel.Win32Exception was unhandled
HResult=-2147467259
Message=The specified module could not be found
Source=ScreenVideoRecorder
ErrorCode=-2147467259
NativeErrorCode=126
StackTrace:
at Gma.UserActivityMonitor.HookManager.EnsureSubscribedToGlobalMouseEvents() in d:\C-Sharp\ScreenVideoRecorder\ScreenVideoRecorderWorkingVersion\HookManager.Callbacks.cs:line 236
at Gma.UserActivityMonitor.HookManager.add_MouseClick(MouseEventHandler value) in d:\C-Sharp\ScreenVideoRecorder\ScreenVideoRecorderWorkingVersion\HookManager.cs:line 69
at Gma.UserActivityMonitor.GlobalEventProvider.add_MouseClick(MouseEventHandler value) in d:\C-Sharp\ScreenVideoRecorder\ScreenVideoRecorderWorkingVersion\GlobalEventProvider.cs:line 71
at ScreenVideoRecorder.Form1.Form1_Load(Object sender, EventArgs e) in d:\C-Sharp\ScreenVideoRecorder\ScreenVideoRecorderWorkingVersion\Form1.cs:line 47
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException:
What or which module couldn't be found ?
I downloaded the source code of Version 2. And added all the files .cs from the : Gma.UserActivityMonitor directory on hard disk.
I'm not getting errors that something is missing so what can it be ?