private void FormMain_Load(object sender, EventArgs e) { _dropFileHandler = new DropFileHandler(this); _systemMenu = new SystemMenu(this); // add an item to the system menu _systemMenu.AppendSeparator(); _systemMenu.AppendMenu(_InstallSysMenuId, "Add to Folder Context Menu"); _systemMenu.AppendMenu(_AboutSysMenuId, "About FindFiles..."); _systemMenu.SysCommandEvent += new SystemMenu.SysCommandEventHandler(_systemMenu_SysCommandEvent); // accept path as command line arg string[] args = Environment.GetCommandLineArgs(); if (args.Length > 1) { textPath.Text = args[1]; } // restore previous settings try { RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\BrettRobichaud\FindFiles"); _includeAttributes = (FileAttributes)key.GetValue("IncludedAttributes", 32759); _excludeAttributes = (FileAttributes)key.GetValue("ExcludedAttributes", 0); } catch { } }
public RightClickTitleBarDialog(Form frm) { this.form = frm; try { m_SystemMenu = SystemMenu.FromForm(frm); m_SystemMenu.AppendSeparator(); if (FrameworkParams.isSupportDeveloper) m_SystemMenu.AppendMenu(m_FormInfo, MENU_TITLE_FORM_INFO_TEXT); if (this is IFormRefresh) { m_SystemMenu.AppendMenu(m_RefreshForm, MENU_TITLE_FORM_REFRESH_TEXT); } if (this is IFormFURL) { m_SystemMenu.AppendMenu(m_FURL, MENU_TITLE_FORM_FURL_TEXT); } m_SystemMenu.AppendSeparator(); } catch (NoSystemMenuException /* err */ ) { // Do some error handling } }
public MainWindow() { InitializeComponent(); // Locate startLabel to the center of the screen UpdateStartLabel(); sMenu = SystemMenu.FromForm(this); sMenu.AppendSeparator(); sMenu.AppendMenu(11, "Показать меню"); sMenu.AppendMenu(22, "Скрыть меню"); }
private void Form1_Load(object sender, EventArgs e) { m_customMenu = SystemMenu.FromForm(this); m_customMenu.AppendSeparator(); m_customMenu.AppendMenu(ABOUTMENU, "About Wechoid..."); RemoveContextMenu(this); // Apply skin Telerik.WinControls.Themes.DesertTheme thm = new Telerik.WinControls.Themes.DesertTheme(); ThemeResolutionService.ApplyThemeToControlTree(this, "Desert"); About1.showAbout(); }
void ResetMenuStates(bool doReset) { try { if (doReset) { SystemMenu.ResetSystemMenu(this); } m_SystemMenu = SystemMenu.FromForm(this); m_SystemMenu.AppendSeparator(); //TODO: позволяет переключится в full screen только после пересоздания формы m_SystemMenu.AppendMenu(m_SeparateWindow, "Allow full screen (and show the form in task bar)", this.ShowInTaskbar ? ItemFlags.mfChecked : ItemFlags.mfUnchecked); m_SystemMenu.AppendMenu(m_TopMode, "Keep the form \"On Top\" mode", this.TopMost ? ItemFlags.mfChecked : ItemFlags.mfUnchecked); m_SystemMenu.AppendMenu(m_StretchVideoToFit, "Stretch Video to Fit", this.StretchVideoToFit ? ItemFlags.mfChecked : ItemFlags.mfUnchecked); // m_SystemMenu.InsertSeparator(0); // m_SystemMenu.InsertMenu(0, m_TopMode, "Enable \"On Top\" mode", (this.TopMostManualExplicit ? ItemFlags.mfChecked : ItemFlags.mfUnchecked)); } catch (NoSystemMenuException /* err */) { // Do some error handling } }
private void Window_SourceInitialized(object sender, EventArgs e) { IntPtr windowHandle = (new WindowInteropHelper(this)).Handle; HwndSource src = HwndSource.FromHwnd(windowHandle); src.AddHook(new HwndSourceHook(WndProc)); try { m_SystemMenu = SystemMenu.FromWPFForm(this); m_SystemMenu.AppendSeparator(); m_SystemMenu.AppendMenu(m_UrlID, "Copy Current URL"); } catch (NoSystemMenuException) { } }
private void frmMain_Load(object sender, System.EventArgs e) { try { m_SystemMenu = SystemMenu.FromForm(this); // Add a separator ... m_SystemMenu.AppendSeparator(); // ... and an "About" entry m_SystemMenu.AppendMenu(m_AboutID, "About this..."); // And a "Reset" item on top m_SystemMenu.InsertSeparator(0); m_SystemMenu.InsertMenu(0, m_ResetID, "Reset Systemmenu"); } catch (NoSystemMenuException /* err */) { // Do some error handling } }