Skip to content

Commit 3ce5583

Browse files
committed
Change taskbar title to "Ctrl+L To Unlock"
1 parent 51475c9 commit 3ce5583

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

InvisibleLockScreenSaver.cs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public TransparentLockSaver()
1818
1919
Based on:
2020
Screensaver.cs © Rei Miyasaka 2006 rei@thefraser.com";
21+
this.WindowTitle = InvisbleLockScreen.Properties.Resources.WindowTitle;
2122
}
2223

2324
[STAThread]

Properties/Resources.Designer.cs

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Properties/Resources.resx

+3
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,7 @@
121121
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
122122
<value>..\blank_screen.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
123123
</data>
124+
<data name="WindowTitle" xml:space="preserve">
125+
<value>Ctrl+L To Unlock</value>
126+
</data>
124127
</root>

Screensaver.cs

+14-3
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,17 @@ private void RunPreview()
493493
previewShutdownEvent.WaitOne();
494494
}
495495

496+
string windowTitle = "";
497+
498+
/// <summary>
499+
/// Gets or sets text to be displayed in the taskbar window title.
500+
/// </summary>
501+
public string WindowTitle
502+
{
503+
get { return windowTitle; }
504+
set { windowTitle = value; }
505+
}
506+
496507
private void RunNormal()
497508
{
498509
Cursor.Hide();
@@ -521,7 +532,7 @@ private void RunNormalMultipleWindows()
521532
primary.TopMost = true;
522533
#endif
523534
primary.FormBorderStyle = FormBorderStyle.None;
524-
primary.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
535+
primary.Text = WindowTitle;
525536
primary.Icon = InvisbleLockScreen.Properties.Resources.icon;
526537

527538
foreach (Screen screen in Screen.AllScreens)
@@ -575,7 +586,7 @@ private void RunNormalSingleWindow()
575586
#endif
576587
form.FormBorderStyle = FormBorderStyle.None;
577588
form.StartPosition = FormStartPosition.Manual;
578-
form.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
589+
form.Text = WindowTitle;
579590
form.Icon = InvisbleLockScreen.Properties.Resources.icon;
580591

581592
windows = new WindowCollection(new Window[] { new Window(this, form) });
@@ -597,7 +608,7 @@ private void RunWindowed()
597608
{
598609
Form form = new Form();
599610
form.FormBorderStyle = FormBorderStyle.FixedSingle;
600-
form.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
611+
form.Text = WindowTitle;
601612
form.Icon = InvisbleLockScreen.Properties.Resources.icon;
602613
form.StartPosition = FormStartPosition.CenterScreen;
603614
form.BackColor = Color.Black;

0 commit comments

Comments
 (0)