コード例 #1
0
ファイル: globalMouseHook.cs プロジェクト: bangush/csharp
        /// <summary>
        /// Installs the global hook
        /// </summary>
        public void hook()
        {
            IntPtr hInstance = LoadLibrary("User32");

            MouseHookProcedure = new mouseHookProc(hookProc);
            hhook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProcedure, hInstance, 0);
        }
コード例 #2
0
        public MouseHook(MouseCallback mouseCallback)
        {
            this.mouseHookProcDel = mouseEventCall;
            this.mouseCallback    = mouseCallback;

            Hook();
        }
コード例 #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //lastMovement = DateTime.Now.AddDays(-1);

            notifyIcon1.Text = Application.ProductName;
            labelStatus.Text = "";
            lastMovement     = DateTime.Now;
            pos_last         = Cursor.Position;

            labelStatus.Text = lastMovement.ToLongDateString();

            comboBox1.SelectedIndex = cornerIndex;
            LoadSettings();
            comboBox1.SelectedIndex    = cornerIndex;
            textBoxMaxIdleSeconds.Text = maxIdleSeconds.ToString();

            this.Icon        = Properties.Resources.mouse_on;
            notifyIcon1.Icon = Properties.Resources.mouse_on;

            hookProcDelegate = hookProc;
            hook();
        }
コード例 #4
0
 static extern IntPtr SetWindowsHookEx(int idHook, mouseHookProc callback, IntPtr hInstance, uint threadId);
コード例 #5
0
ファイル: Win32.cs プロジェクト: benneeh/wScreenshot
 public static extern IntPtr SetWindowsHookEx(int idHook, mouseHookProc callback, IntPtr hInstance, uint threadId);
コード例 #6
0
ファイル: globalMouseHook.cs プロジェクト: Hagser/csharp
 /// <summary>
 /// Installs the global hook
 /// </summary>
 public void hook()
 {
     IntPtr hInstance = LoadLibrary("User32");
     MouseHookProcedure = new mouseHookProc(hookProc);
     hhook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProcedure, hInstance, 0);
 }
コード例 #7
0
 private void FormFocus_Load(object sender, EventArgs e)
 {
     hookProcDelegate = hookProc;
     hook();
 }