mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Added option to lock screen https://github.com/seerge/g-helper/issues/2352
This commit is contained in:
@@ -32,6 +32,15 @@ public class NativeMethods
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, out string lpBuffer, uint nSize, IntPtr Arguments);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool LockWorkStation();
|
||||
|
||||
public static void LockScreen()
|
||||
{
|
||||
LockWorkStation();
|
||||
}
|
||||
|
||||
public static void TurnOffScreen()
|
||||
{
|
||||
Form f = new Form();
|
||||
|
||||
Reference in New Issue
Block a user