Ejemplo n.º 1
0
		public MouseGlobalHook()
		{
			if (MouseGlobalHook.hHook == 0)
			{
				MouseGlobalHook.m_MouseHookProcedure = new MouseGlobalHook.HookProc(MouseHookProc);
				MouseGlobalHook.hHook = MouseGlobalHook.SetWindowsHookEx(14, MouseGlobalHook.m_MouseHookProcedure, Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0);
				if (MouseGlobalHook.hHook == 0)
				{
					MessageBox.Show("SetWindowsHookEx Failed");
				}
			}
		}
Ejemplo n.º 2
0
 public MouseGlobalHook()
 {
     if (MouseGlobalHook.hHook == 0)
     {
         MouseGlobalHook.m_MouseHookProcedure = new MouseGlobalHook.HookProc(MouseHookProc);
         MouseGlobalHook.hHook = MouseGlobalHook.SetWindowsHookEx(14, MouseGlobalHook.m_MouseHookProcedure, Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0);
         if (MouseGlobalHook.hHook == 0)
         {
             MessageBox.Show("SetWindowsHookEx Failed");
         }
     }
 }
Ejemplo n.º 3
0
 public static extern int SetWindowsHookEx(int idHook, MouseGlobalHook.HookProc lpfn, IntPtr hInstance, int threadId);