begin work: base version 0993 move original program for orgnization golang work snapshot decompiled code it builds! (but doesnt run) source code bump library stash decompile 0.1.2, make it build
108 lines
2.2 KiB
C#
108 lines
2.2 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace ControlApp;
|
|
|
|
public class Blank : Form
|
|
{
|
|
private int count;
|
|
|
|
private int whatlock;
|
|
|
|
private Timer tmr;
|
|
|
|
private LockMouse lockMouse;
|
|
|
|
private LockKeyboard LockKeyboard;
|
|
|
|
private IContainer components;
|
|
|
|
public Blank(int what)
|
|
{
|
|
tmr = new Timer();
|
|
tmr.Interval = (int)TimeSpan.FromSeconds(10.0).TotalMilliseconds;
|
|
tmr.Tick += closewindow;
|
|
lockMouse = new LockMouse();
|
|
LockKeyboard = new LockKeyboard();
|
|
whatlock = what;
|
|
InitializeComponent();
|
|
count = 1;
|
|
}
|
|
|
|
public void closewindow(object sender, EventArgs e)
|
|
{
|
|
count--;
|
|
if (count == 0)
|
|
{
|
|
if (whatlock == 1)
|
|
{
|
|
lockMouse.Unlock();
|
|
}
|
|
else if (whatlock == 2)
|
|
{
|
|
lockMouse.Unlock();
|
|
LockKeyboard.Unlock();
|
|
}
|
|
Close();
|
|
}
|
|
}
|
|
|
|
public void add_time(int what)
|
|
{
|
|
if (whatlock < what)
|
|
{
|
|
whatlock = what;
|
|
}
|
|
count++;
|
|
}
|
|
|
|
private void Blank_Load(object sender, EventArgs e)
|
|
{
|
|
base.Opacity = 0.001;
|
|
base.StartPosition = FormStartPosition.CenterScreen;
|
|
Screen[] my = Screen.AllScreens;
|
|
base.Size = my[0].Bounds.Size;
|
|
base.FormBorderStyle = FormBorderStyle.None;
|
|
base.TopMost = true;
|
|
base.Visible = true;
|
|
if (whatlock == 1)
|
|
{
|
|
lockMouse.Lock();
|
|
}
|
|
else if (whatlock == 2)
|
|
{
|
|
lockMouse.Lock();
|
|
LockKeyboard.Lock();
|
|
}
|
|
tmr.Start();
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing && components != null)
|
|
{
|
|
components.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
base.SuspendLayout();
|
|
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 15f);
|
|
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
base.ClientSize = new System.Drawing.Size(800, 450);
|
|
base.ControlBox = false;
|
|
this.Cursor = System.Windows.Forms.Cursors.No;
|
|
base.Name = "Blank";
|
|
base.Opacity = 0.001;
|
|
base.ShowInTaskbar = false;
|
|
this.Text = "Blank";
|
|
base.TopMost = true;
|
|
base.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
|
base.Load += new System.EventHandler(Blank_Load);
|
|
base.ResumeLayout(false);
|
|
}
|
|
}
|