using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace LockWindows
{
public partial class FormLock : Form
{
public FormLock()
{
InitializeComponent();
}
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern void LockWorkStation();
private void button1_Click(object sender, EventArgs e)
{
LockWorkStation(); // Menu + L
}
}
}