Exemplo n.º 1
0
        private void cmdEnableKeys_Click(object sender, EventArgs e)
        {
            //MoveCursor();
            //System.Diagnostics.Process calc = System.Diagnostics.Process.Start("calc");
            if (this.cmdEnableKeys.TabIndex == 3)
            {
                Jiggler.Jiggle(0, 0);
            }
            else
            {
                if (this.zig)
                {
                    Jiggler.Jiggle(4, 4);
                }
                else // zag
                {
                    // I really don't know why this needs to be less to stay in the same
                    // place; if I was likely to use it again, then I'd worry.
                    Jiggler.Jiggle(-4, -4);
                }
            }

            this.zig = !this.zig;

            timer.Enabled = true;

            cmdEnableKeys.Hide();
            cmdDisableKeys.Show();
        }
Exemplo n.º 2
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            // jiggle
            if (cmdEnableKeys.TabIndex == 3)
            {
                Jiggler.Jiggle(0, 0);
            }
            else
            {
                if (this.zig)
                {
                    Jiggler.Jiggle(4, 4);
                }
                else // zag
                {
                    // I really don't know why this needs to be less to stay in the same
                    // place; if I was likely to use it again, then I'd worry.
                    Jiggler.Jiggle(-4, -4);
                }
            }
            this.zig = !this.zig;

            //IntPtr calculatorHandle = NativeMethods.FindWindow(null, "Calculator");

            //// Verify that Calculator is a running process.
            //if (calculatorHandle == IntPtr.Zero)
            //{
            //    Console.WriteLine("Calculator is not running.");
            //    return;
            //}

            //// Make Calculator the foreground application and send it
            //// a set of calculations.
            //NativeMethods.SetForegroundWindow(calculatorHandle);
            //SendKeys.SendWait("1");
            //SendKeys.SendWait("+");
            //SendKeys.SendWait("1");
            //SendKeys.SendWait("=");
        }