7,655
社区成员
发帖
与我相关
我的任务
分享
01、GwesPowerOffSystem
02、PowerOffSystem
03、SetSystemPowerState
04、ExitWindowsEx
private const int KEYEVENTF_KEYUP = 0x0002;
private const int KEYEVENTF_SILENT = 0X0004;
private const byte VK_KEYLOCK = 0x85;
keybd_event(VK_KEYLOCK, 0, KEYEVENTF_SILENT, 0);
System.Threading.Thread.Sleep(100);
keybd_event(VK_KEYLOCK, 0, KEYEVENTF_SILENT | KEYEVENTF_KEYUP, 0);
[DllImport("CoreDLL")]
public static extern int SetSystemPowerState(String stateName, PowerState powerState, DevicePowerFlags flags);
SetSystemPowerState(null, 0x00100000,0x00001000);