-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelpForm.cs
More file actions
94 lines (89 loc) · 4.98 KB
/
HelpForm.cs
File metadata and controls
94 lines (89 loc) · 4.98 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
namespace CapsNumTray;
/// <summary>
/// Resizable, scrollable help window matching the AHK help dialog.
/// </summary>
internal sealed class HelpForm : Form
{
private readonly TextBox _textBox;
private const string HelpText =
"CAPSNUMTRAY \u2014 Caps/Num/Scroll Lock Tray Indicators\r\n" +
"\r\n" +
"CapsNumTray adds independent system tray icons that show the current state of your " +
"Caps Lock, Num Lock, and Scroll Lock keys. Left-click to toggle, right-click for options.\r\n" +
"\r\n" +
"Bright icon = key is ON\r\n" +
"Dim icon = key is OFF\r\n" +
"\r\n" +
"\u2500\u2500\u2500 BASIC USAGE \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n" +
"\r\n" +
"\u2022 Left-click any tray icon to toggle that key.\r\n" +
"\u2022 Right-click any icon for a menu with toggle, visibility, settings, and exit.\r\n" +
"\r\n" +
"\u2500\u2500\u2500 SETTINGS \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n" +
"\r\n" +
"Show Caps/Num/Scroll Lock icon: Choose which icons appear in the tray. " +
"Scroll Lock is hidden by default. At least one must remain visible.\r\n" +
"\r\n" +
"Show OSD tooltip on toggle: A small floating tooltip appears briefly showing " +
"the new state after toggling.\r\n" +
"\r\n" +
"Beep on toggle: Plays a short tone when you toggle a key. Higher pitch = ON, " +
"lower pitch = OFF.\r\n" +
"\r\n" +
"Run at Windows startup: Creates a shortcut in your Startup folder so CapsNumTray " +
"launches automatically at login.\r\n" +
"\r\n" +
"All settings are saved to CapsNumTray.ini and persist across restarts.\r\n" +
"\r\n" +
"\u2500\u2500\u2500 TRAY ICONS \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n" +
"\r\n" +
"Icons are embedded in the application. When running from source, icons are loaded " +
"from the icons/ folder. Light-theme OFF variants are used automatically when Windows " +
"is set to a light taskbar theme. If all else fails, Windows built-in system icons are " +
"used as a fallback.\r\n" +
"\r\n" +
"\u2500\u2500\u2500 TECHNICAL NOTES \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n" +
"\r\n" +
"CapsNumTray uses the Win32 Shell_NotifyIconW API directly to support multiple " +
"independent tray icons. A low-level keyboard hook detects toggle key changes instantly. " +
"A configurable polling timer (disabled by default, adjustable in Settings) acts as a " +
"failsafe for external changes (RDP, other apps). If the low-level keyboard hook ever " +
"fails to install, polling auto-enables at 10 seconds so the tray stays in sync. " +
"Icons are automatically re-added if Explorer restarts, and tray state resyncs on " +
"resume from sleep and on RDP reconnect.\r\n" +
"\r\n" +
"Fallback poll interval: Controls how often the app checks key states independently " +
"of the keyboard hook. Range: 0 (disabled, the default) to 300 seconds (5 minutes). " +
"The keyboard hook handles normal key presses instantly, so this is only needed as a " +
"safety net for scenarios the hook can't see.";
public HelpForm()
{
Text = "CapsNumTray v" + TrayApplication.Version + " \u2014 Help";
TopMost = true;
BackColor = System.Drawing.Color.White;
StartPosition = FormStartPosition.CenterScreen;
AutoScaleMode = AutoScaleMode.Dpi;
MinimumSize = new System.Drawing.Size(400, 300);
ClientSize = new System.Drawing.Size(460, 420);
_textBox = new TextBox
{
Multiline = true,
ReadOnly = true,
ScrollBars = ScrollBars.Vertical,
BorderStyle = BorderStyle.None,
Text = HelpText,
Location = new(10, 10),
Size = new(ClientSize.Width - 20, ClientSize.Height - 20),
Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right,
};
Controls.Add(_textBox);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
_textBox.Dispose();
}
base.Dispose(disposing);
}
}