-
Notifications
You must be signed in to change notification settings - Fork 186
Expand file tree
/
Copy pathFlashIconPlugin.cs
More file actions
57 lines (45 loc) · 1.37 KB
/
FlashIconPlugin.cs
File metadata and controls
57 lines (45 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Windows.Forms;
using LogExpert;
[assembly: SupportedOSPlatform("windows")]
namespace FlashIconHighlighter;
internal class FlashIconPlugin : IKeywordAction
{
#region Properties
public string Text => GetName();
#endregion
#region IKeywordAction Member
public void Execute (string keyword, string param, ILogExpertCallback callback, ILogLineColumnizer columnizer)
{
var openForms = Application.OpenForms;
foreach (Form form in openForms)
{
if (form.TopLevel && form.Name.Equals("LogTabWindow", StringComparison.OrdinalIgnoreCase) && form.Text.Contains(callback.GetFileName(), StringComparison.Ordinal))
{
form.BeginInvoke(FlashWindow, [form]);
}
}
}
private void FlashWindow (Form form)
{
FLASHWINFO fw = new()
{
cbSize = Convert.ToUInt32(Marshal.SizeOf(typeof(FLASHWINFO))),
hwnd = form.Handle,
dwFlags = 14,
uCount = 0
};
Win32Stuff.FlashWindowEx(ref fw);
}
public string GetDescription ()
{
return "Let the taskbar icon flash ";
}
public string GetName ()
{
return "Flash Icon";
}
#endregion
}