Exemple #1
0
        //// overload for use with LowLevelKeyboardProc
        //[DllImport("user32.dll")]
        //static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, [In]KBDLLHOOKSTRUCT lParam);

        //// overload for use with LowLevelMouseProc
        //[DllImport("user32.dll")]
        //static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, [In]MSLLHOOKSTRUCT lParam);

        public TPCIcon()
        {
            Version version = Environment.OSVersion.Version;

            int versionMajor = version.Major;
            int versionMinor = version.Minor;

            keyClickCounter    = 0;
            TouchScreenSupport = (versionMajor >= 7) || (versionMajor == 6 && versionMinor >= 2);
            Point pt = System.Windows.Forms.Cursor.Position;

            Array.Sort(ignoreKeys);
            Program.LoadProgramSettings();
            TrayIcon            = new NotifyIcon();
            delayInMilliSeconds = 500;  // DEFAULT_VALUE
            that = this;
        }
Exemple #2
0
        static void Main()
        {
            try
            {
                string assemblyLocation = System.Reflection.Assembly.GetEntryAssembly().Location;
                FirstRun = false;

                int runningInstances = System.Diagnostics.Process.GetProcessesByName(
                    System.IO.Path.GetFileNameWithoutExtension(assemblyLocation)).Length;

                if (runningInstances > 1)
                {
                    MessageBox.Show(Strings.TouchpadPeaceInstanceFound);
                    return;
                }

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                LoadProgramSettings();
            }
            catch (Exception)
            {
            }

            try
            {
                if (FirstRun)
                {
                    ContextMenus.OnHelp_Click(null, null);
                }

                using (TPCIcon tpcIcon = new TPCIcon())
                {
                    tpcIcon.Display();
                    AppDomain.CurrentDomain.ProcessExit += OnProcessExitRequest;
                    Application.Run();
                }
            }
            catch (Exception)
            {
            }
        }
Exemple #3
0
 public ContextMenus(TPCIcon tpcIcon)
 {
     this.tpcIcon = tpcIcon;
 }