using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace NexusPowerCommand { public class win32api { #region win32api defined [DllImport("user32.dll")] private static extern bool LockWorkStation(); #endregion #region win32api wrappers public static bool LockScreen() { return win32api.LockWorkStation(); } #endregion } }