Пример #1
0
        private void RegistShortCut(ShortcutData sc)
        {
            KeysConverter keyConv = new KeysConverter();

            sc.AppKeyID = GlobalAddAtom("GlobalHotKey " + sc.AppKey);
            RegisterHotKey(this.Handle, sc.AppKeyID, MOD_ALT | MOD_SHIFT, (int)keyConv.ConvertFromString(sc.AppKey));
        }
Пример #2
0
        private void ExecShortCut(ShortcutData sc)
        {
            var dirPath = Environment.ExpandEnvironmentVariables(sc.AppPath);

            if (sc.AppName != "")
            {
                string StartFileName = "";
                StartFileName = FormCommonMethod.GetLatestVersionName(dirPath, sc.AppName);
                string path = Path.Combine(dirPath, StartFileName);
                if (File.Exists(path))
                {
                    System.Diagnostics.Process.Start(path);
                }
            }
            else
            {
                if (Directory.Exists(dirPath))
                {
                    System.Diagnostics.Process.Start(dirPath);
                }
            }
        }