mirror of
https://github.com/flashwave/topmostfriend.git
synced 2024-11-22 01:48:43 +00:00
v1.5.1 - 2021-02-04
This commit is contained in:
parent
5a51414469
commit
103d3d4bff
2 changed files with 39 additions and 35 deletions
|
@ -237,46 +237,50 @@ namespace TopMostFriend {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RefreshWindowList() {
|
private static void RefreshWindowList() {
|
||||||
IEnumerable<WindowInfo> windows = WindowInfo.GetAllWindows();
|
|
||||||
List<ToolStripItem> items = new List<ToolStripItem>();
|
List<ToolStripItem> items = new List<ToolStripItem>();
|
||||||
Process lastProc = null;
|
|
||||||
bool procSeparator = Settings.Get(PROCESS_SEPARATOR_SETTING, false);
|
|
||||||
bool showEmptyTitles = Settings.Get(SHOW_EMPTY_WINDOW_SETTING, false);
|
|
||||||
bool listSelf = Settings.Get(LIST_SELF_SETTING, Debugger.IsAttached);
|
|
||||||
|
|
||||||
foreach(WindowInfo window in windows) {
|
if(Settings.Get(SHOW_WINDOW_LIST, true)) {
|
||||||
if(!listSelf && window.IsOwnWindow)
|
IEnumerable<WindowInfo> windows = WindowInfo.GetAllWindows();
|
||||||
continue;
|
Process lastProc = null;
|
||||||
|
bool procSeparator = Settings.Get(PROCESS_SEPARATOR_SETTING, false);
|
||||||
|
bool showEmptyTitles = Settings.Get(SHOW_EMPTY_WINDOW_SETTING, false);
|
||||||
|
bool listSelf = Settings.Get(LIST_SELF_SETTING, Debugger.IsAttached);
|
||||||
|
|
||||||
if(procSeparator && lastProc != window.Owner) {
|
foreach(WindowInfo window in windows) {
|
||||||
if(lastProc != null)
|
if(!listSelf && window.IsOwnWindow)
|
||||||
items.Add(new ToolStripSeparator());
|
continue;
|
||||||
lastProc = window.Owner;
|
|
||||||
|
if(procSeparator && lastProc != window.Owner) {
|
||||||
|
if(lastProc != null)
|
||||||
|
items.Add(new ToolStripSeparator());
|
||||||
|
lastProc = window.Owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
string title = window.Title;
|
||||||
|
|
||||||
|
// i think it's a fair assumption that any visible window worth a damn has a window title
|
||||||
|
if(!showEmptyTitles && string.IsNullOrEmpty(title))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Skip items in the blacklist
|
||||||
|
if(CheckBlacklistedTitles(title))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
items.Add(new ToolStripMenuItem(title, window.IconBitmap, new EventHandler((s, e) => {
|
||||||
|
if(Settings.Get(SHIFT_CLICK_BLACKLIST, true) && Control.ModifierKeys.HasFlag(Keys.Shift)) {
|
||||||
|
AddBlacklistedTitle(title);
|
||||||
|
SaveBlacklistedTitles();
|
||||||
|
} else if(!window.ToggleTopMost())
|
||||||
|
TopMostFailed(window);
|
||||||
|
})) {
|
||||||
|
CheckOnClick = true,
|
||||||
|
Checked = window.IsTopMost,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
string title = window.Title;
|
items.AddRange(ListActionItems);
|
||||||
|
|
||||||
// i think it's a fair assumption that any visible window worth a damn has a window title
|
|
||||||
if(!showEmptyTitles && string.IsNullOrEmpty(title))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Skip items in the blacklist
|
|
||||||
if(CheckBlacklistedTitles(title))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
items.Add(new ToolStripMenuItem(title, window.IconBitmap, new EventHandler((s, e) => {
|
|
||||||
if(Settings.Get(SHIFT_CLICK_BLACKLIST, true) && Control.ModifierKeys.HasFlag(Keys.Shift)) {
|
|
||||||
AddBlacklistedTitle(title);
|
|
||||||
SaveBlacklistedTitles();
|
|
||||||
} else if(!window.ToggleTopMost())
|
|
||||||
TopMostFailed(window);
|
|
||||||
})) {
|
|
||||||
CheckOnClick = true,
|
|
||||||
Checked = window.IsTopMost,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
items.AddRange(ListActionItems);
|
|
||||||
items.AddRange(AppActionItems);
|
items.AddRange(AppActionItems);
|
||||||
|
|
||||||
CtxMenu.Items.Clear();
|
CtxMenu.Items.Clear();
|
||||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("1.5.0.0")]
|
[assembly: AssemblyVersion("1.5.1.0")]
|
||||||
[assembly: AssemblyFileVersion("1.5.0.0")]
|
[assembly: AssemblyFileVersion("1.5.1.0")]
|
||||||
|
|
Loading…
Reference in a new issue