Change taskbar title to "Ctrl+L To Unlock"

This commit is contained in:
Will Hilton 2017-08-16 22:33:31 -04:00
parent 51475c94ea
commit 3ce55837fc
No known key found for this signature in database
GPG key ID: 9609B8A5928BA6B9
4 changed files with 27 additions and 3 deletions

View file

@ -18,6 +18,7 @@ namespace InvisibleLockscreen
Based on: Based on:
Screensaver.cs © Rei Miyasaka 2006 rei@thefraser.com"; Screensaver.cs © Rei Miyasaka 2006 rei@thefraser.com";
this.WindowTitle = InvisbleLockScreen.Properties.Resources.WindowTitle;
} }
[STAThread] [STAThread]

View file

@ -69,5 +69,14 @@ namespace InvisbleLockScreen.Properties {
return ((System.Drawing.Icon)(obj)); return ((System.Drawing.Icon)(obj));
} }
} }
/// <summary>
/// Looks up a localized string similar to Ctrl+L To Unlock.
/// </summary>
internal static string WindowTitle {
get {
return ResourceManager.GetString("WindowTitle", resourceCulture);
}
}
} }
} }

View file

@ -121,4 +121,7 @@
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\blank_screen.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\blank_screen.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="WindowTitle" xml:space="preserve">
<value>Ctrl+L To Unlock</value>
</data>
</root> </root>

View file

@ -493,6 +493,17 @@ namespace Screensavers
previewShutdownEvent.WaitOne(); previewShutdownEvent.WaitOne();
} }
string windowTitle = "";
/// <summary>
/// Gets or sets text to be displayed in the taskbar window title.
/// </summary>
public string WindowTitle
{
get { return windowTitle; }
set { windowTitle = value; }
}
private void RunNormal() private void RunNormal()
{ {
Cursor.Hide(); Cursor.Hide();
@ -521,7 +532,7 @@ namespace Screensavers
primary.TopMost = true; primary.TopMost = true;
#endif #endif
primary.FormBorderStyle = FormBorderStyle.None; primary.FormBorderStyle = FormBorderStyle.None;
primary.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; primary.Text = WindowTitle;
primary.Icon = InvisbleLockScreen.Properties.Resources.icon; primary.Icon = InvisbleLockScreen.Properties.Resources.icon;
foreach (Screen screen in Screen.AllScreens) foreach (Screen screen in Screen.AllScreens)
@ -575,7 +586,7 @@ namespace Screensavers
#endif #endif
form.FormBorderStyle = FormBorderStyle.None; form.FormBorderStyle = FormBorderStyle.None;
form.StartPosition = FormStartPosition.Manual; form.StartPosition = FormStartPosition.Manual;
form.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; form.Text = WindowTitle;
form.Icon = InvisbleLockScreen.Properties.Resources.icon; form.Icon = InvisbleLockScreen.Properties.Resources.icon;
windows = new WindowCollection(new Window[] { new Window(this, form) }); windows = new WindowCollection(new Window[] { new Window(this, form) });
@ -597,7 +608,7 @@ namespace Screensavers
{ {
Form form = new Form(); Form form = new Form();
form.FormBorderStyle = FormBorderStyle.FixedSingle; form.FormBorderStyle = FormBorderStyle.FixedSingle;
form.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; form.Text = WindowTitle;
form.Icon = InvisbleLockScreen.Properties.Resources.icon; form.Icon = InvisbleLockScreen.Properties.Resources.icon;
form.StartPosition = FormStartPosition.CenterScreen; form.StartPosition = FormStartPosition.CenterScreen;
form.BackColor = Color.Black; form.BackColor = Color.Black;