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 { } }
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(); }
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 } }
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 } }