archive
/
usb-lockdown
Archived
1
Fork 0

added some code that will kill displayfusion eventually

This commit is contained in:
theorangeone97 2014-08-18 12:51:18 +01:00
parent 34da26901a
commit 8b3907d43d
1 changed files with 23 additions and 4 deletions

View File

@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Diagnostics;
namespace USB_Lockdown namespace USB_Lockdown
{ {
public partial class lockScreen : Form public partial class lockScreen : Form
@ -26,24 +26,43 @@ namespace USB_Lockdown
} }
private void setupWindow() private void setupWindow()
{ {
this.StartPosition = FormStartPosition.CenterScreen; this.StartPosition = FormStartPosition.CenterScreen;
this.Height = SystemInformation.VirtualScreen.Height; this.Height = SystemInformation.VirtualScreen.Height;
this.Width = SystemInformation.VirtualScreen.Width; this.Width = SystemInformation.VirtualScreen.Width;
this.WindowState = FormWindowState.Maximized;
this.BackColor = Color.Black; this.BackColor = Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
SetForegroundWindow(this.Handle); SetForegroundWindow(this.Handle);
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
foregroundTimer.Start();
Taskbar.Hide();
problemWindows(true);
} }
private void onClosing(object sender, FormClosingEventArgs e) private void onClosing(object sender, FormClosingEventArgs e)
{ {
if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; } //disables alt+F4 Taskbar.Show();
return;
//if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; } //disables alt+F4
} }
private void keepForeground(object sender, EventArgs e) { SetForegroundWindow(this.Handle); } private void keepForeground(object sender, EventArgs e) { SetForegroundWindow(this.Handle); }
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void problemWindows(bool state)
{
if (state)
{
//Process[] processList = Process.GetProcessesByName("displayfusion");
//button1.Text = (processList[0].);
}
}
} }
} }