diff --git a/trunk/ProcessHacker/Forms/HackerWindow.cs b/trunk/ProcessHacker/Forms/HackerWindow.cs index fdb6f315d..393be5ab9 100644 --- a/trunk/ProcessHacker/Forms/HackerWindow.cs +++ b/trunk/ProcessHacker/Forms/HackerWindow.cs @@ -3122,7 +3122,7 @@ namespace ProcessHacker private void HackerWindow_Load(object sender, EventArgs e) { - Program.UpdateWindow(this); + Program.UpdateWindowMenu(windowMenuItem, this); this.ApplyFont(Properties.Settings.Default.Font); this.BeginInvoke(new MethodInvoker(this.LoadApplyCommandLineArgs)); } diff --git a/trunk/ProcessHacker/Forms/MemoryEditor.cs b/trunk/ProcessHacker/Forms/MemoryEditor.cs index cd02a1d9d..4528723e6 100644 --- a/trunk/ProcessHacker/Forms/MemoryEditor.cs +++ b/trunk/ProcessHacker/Forms/MemoryEditor.cs @@ -107,7 +107,7 @@ namespace ProcessHacker private void MemoryEditor_Load(object sender, EventArgs e) { - Program.UpdateWindow(this); + Program.UpdateWindowMenu(windowMenuItem, this); this.Size = Properties.Settings.Default.MemoryWindowSize; this.SetPhParent(false); @@ -146,16 +146,6 @@ namespace ProcessHacker } } - public MenuItem WindowMenuItem - { - get { return windowMenuItem; } - } - - public wyDay.Controls.VistaMenu VistaMenu - { - get { return vistaMenu; } - } - public void Select(long start, long length) { hexBoxMemory.Select(start, length); diff --git a/trunk/ProcessHacker/Forms/ProcessWindow.cs b/trunk/ProcessHacker/Forms/ProcessWindow.cs index 19cad02c4..f7b36864f 100644 --- a/trunk/ProcessHacker/Forms/ProcessWindow.cs +++ b/trunk/ProcessHacker/Forms/ProcessWindow.cs @@ -108,21 +108,11 @@ namespace ProcessHacker Utils.FitRectangle(new Rectangle(location, this.Size), this).Location; // Update the Window menu. - Program.UpdateWindow(this); + Program.UpdateWindowMenu(windowMenuItem, this); SymbolProviderExtensions.ShowWarning(this, false); } - public MenuItem WindowMenuItem - { - get { return windowMenuItem; } - } - - public wyDay.Controls.VistaMenu VistaMenu - { - get { return vistaMenu; } - } - public ListView ThreadListView { get { return listThreads.List; } diff --git a/trunk/ProcessHacker/Forms/ResultsWindow.cs b/trunk/ProcessHacker/Forms/ResultsWindow.cs index fcf1d8827..206e34f2e 100644 --- a/trunk/ProcessHacker/Forms/ResultsWindow.cs +++ b/trunk/ProcessHacker/Forms/ResultsWindow.cs @@ -75,7 +75,7 @@ namespace ProcessHacker private void ResultsWindow_Load(object sender, EventArgs e) { - Program.UpdateWindow(this); + Program.UpdateWindowMenu(windowMenuItem, this); listResults.ContextMenu = listResults.GetCopyMenu(listResults_RetrieveVirtualItem); @@ -95,16 +95,6 @@ namespace ProcessHacker Properties.Settings.Default.ResultsListViewColumns = ColumnSettings.SaveSettings(listResults); } - public MenuItem WindowMenuItem - { - get { return windowMenuItem; } - } - - public wyDay.Controls.VistaMenu VistaMenu - { - get { return vistaMenu; } - } - public ListView ResultsList { get { return listResults; } diff --git a/trunk/ProcessHacker/Program/Program.cs b/trunk/ProcessHacker/Program/Program.cs index 96be937b1..f57c0c945 100644 --- a/trunk/ProcessHacker/Program/Program.cs +++ b/trunk/ProcessHacker/Program/Program.cs @@ -1165,44 +1165,24 @@ namespace ProcessHacker f.Activate(); } - public static void UpdateWindow(Form f) + public static void UpdateWindowMenu(Menu windowMenuItem, Form f) { - if (f.InvokeRequired) - { - f.BeginInvoke(new UpdateWindowAction(UpdateWindow), f); + WeakReference