/// <summary> /// 撤销锁屏 /// </summary> private void StopLockScreen() { // BlockInput(false); //if (actHook != null) //{ // actHook.Stop(); //} DoAction(() => { if (bsForm != null) { bsForm.EnableMouseAndKeyboard(); bsForm.Close(); bsForm = null; } //FormCollection fc = Application.OpenForms; //foreach (Form frm in fc) //{ // if (frm.Name == "BlackScreen") // { // frm // frm.Close(); // break; // } //} }); }
/// <summary> /// 锁屏(禁止鼠标和键盘) /// </summary> private void LockScreen(bool isSlient) { // BlockInput(true); // actHook = new Cls.UserActivityHook(); //actHook.OnMouseActivity += ActHook_OnMouseActivity; //actHook.KeyDown += ActHook_KeyDown; //actHook.KeyPress += ActHook_KeyPress; //actHook.KeyUp += ActHook_KeyUp; // actHook.Start(); DoAction(() => { if (bsForm == null) { BlackScreen frm = new BlackScreen(isSlient); frm.Show(); bsForm = frm; } }); }