private void OnCheckedChangedAutoRun(object sender, EventArgs e) { if (m_bLoadingSettings) { return; } bool bRequested = m_cbAutoRun.Checked; bool bCurrent = ShellUtil.GetStartWithWindows(AppDefs.AutoRunName); if (bRequested != bCurrent) { string strPath = WinUtil.GetExecutable().Trim(); if (strPath.StartsWith("\"") == false) { strPath = "\"" + strPath + "\""; } ShellUtil.SetStartWithWindows(AppDefs.AutoRunName, strPath, bRequested); bool bNew = ShellUtil.GetStartWithWindows(AppDefs.AutoRunName); if (bNew != bRequested) { m_cbAutoRun.Checked = bNew; } } }
private void LoadIntegrationOptions() { Keys kAT = (Keys)Program.Config.Integration.HotKeyGlobalAutoType; m_hkGlobalAutoType.HotKey = (kAT & Keys.KeyCode); m_hkGlobalAutoType.HotKeyModifiers = (kAT & Keys.Modifiers); m_hkGlobalAutoType.RenderHotKey(); m_kPrevATHKKey = (m_hkGlobalAutoType.HotKey | m_hkGlobalAutoType.HotKeyModifiers); Keys kATS = (Keys)Program.Config.Integration.HotKeySelectedAutoType; m_hkSelectedAutoType.HotKey = (kATS & Keys.KeyCode); m_hkSelectedAutoType.HotKeyModifiers = (kATS & Keys.Modifiers); m_hkSelectedAutoType.RenderHotKey(); m_kPrevATSHKKey = (m_hkSelectedAutoType.HotKey | m_hkSelectedAutoType.HotKeyModifiers); Keys kSW = (Keys)Program.Config.Integration.HotKeyShowWindow; m_hkShowWindow.HotKey = (kSW & Keys.KeyCode); m_hkShowWindow.HotKeyModifiers = (kSW & Keys.Modifiers); m_hkShowWindow.RenderHotKey(); m_kPrevSWHKKey = (m_hkShowWindow.HotKey | m_hkShowWindow.HotKeyModifiers); m_cbAutoRun.Checked = ShellUtil.GetStartWithWindows(AppDefs.AutoRunName); m_cbSingleClickTrayAction.Checked = Program.Config.UI.TrayIcon.SingleClickDefault; string strOverride = Program.Config.Integration.UrlOverride; m_cbUrlOverride.Checked = (strOverride.Length > 0); m_tbUrlOverride.Text = strOverride; }
private void LoadIntegrationOptions() { Keys kAT = (Keys)Program.Config.Integration.HotKeyGlobalAutoType; m_hkGlobalAutoType.HotKey = (kAT & Keys.KeyCode); m_hkGlobalAutoType.HotKeyModifiers = (kAT & Keys.Modifiers); m_hkGlobalAutoType.RenderHotKey(); m_kPrevATHKKey = (m_hkGlobalAutoType.HotKey | m_hkGlobalAutoType.HotKeyModifiers); if (AppConfigEx.IsOptionEnforced(Program.Config.Integration, "HotKeyGlobalAutoType")) { m_hkGlobalAutoType.Enabled = false; } Keys kATS = (Keys)Program.Config.Integration.HotKeySelectedAutoType; m_hkSelectedAutoType.HotKey = (kATS & Keys.KeyCode); m_hkSelectedAutoType.HotKeyModifiers = (kATS & Keys.Modifiers); m_hkSelectedAutoType.RenderHotKey(); m_kPrevATSHKKey = (m_hkSelectedAutoType.HotKey | m_hkSelectedAutoType.HotKeyModifiers); if (AppConfigEx.IsOptionEnforced(Program.Config.Integration, "HotKeySelectedAutoType")) { m_hkSelectedAutoType.Enabled = false; } Keys kSW = (Keys)Program.Config.Integration.HotKeyShowWindow; m_hkShowWindow.HotKey = (kSW & Keys.KeyCode); m_hkShowWindow.HotKeyModifiers = (kSW & Keys.Modifiers); m_hkShowWindow.RenderHotKey(); m_kPrevSWHKKey = (m_hkShowWindow.HotKey | m_hkShowWindow.HotKeyModifiers); if (AppConfigEx.IsOptionEnforced(Program.Config.Integration, "HotKeyShowWindow")) { m_hkShowWindow.Enabled = false; } m_cbAutoRun.Checked = ShellUtil.GetStartWithWindows(AppDefs.AutoRunName); m_cbSingleClickTrayAction.Checked = Program.Config.UI.TrayIcon.SingleClickDefault; if (AppConfigEx.IsOptionEnforced(Program.Config.UI.TrayIcon, "SingleClickDefault")) { m_cbSingleClickTrayAction.Enabled = false; } string strOverride = Program.Config.Integration.UrlOverride; m_cbUrlOverride.Checked = (strOverride.Length > 0); m_tbUrlOverride.Text = strOverride; if (AppConfigEx.IsOptionEnforced(Program.Config.Integration, "UrlOverride")) { m_cbUrlOverride.Enabled = false; } if (AppConfigEx.IsOptionEnforced(Program.Config.Integration, "UrlSchemeOverrides")) { m_btnSchemeOverrides.Enabled = false; } }