public void Initialize() { dlg = new TaskDialog("Applying Bluepill", "Bluepill"); dlg.AllowDialogCancellation = false; dlg.ShowProgressBar = true; dlg.ProgressBarMaxRange = 100; dlg.CustomButtons = new CustomButton[] { new CustomButton(CommonButtonResult.Cancel, "Cancel") }; dlg.EnableButton(2, false); }
public void TermintateImporantProcess_TaskDialog_VerificationClick(object sender, CheckEventArgs e) { TaskDialog taskDialog = sender as TaskDialog; taskDialog.EnableButton(1, e.IsChecked); }
public bool TermintateImporantProcess(IntPtr name, int id) { TaskDialog taskDialog = null; if (id == 1)//强制结束警告 { taskDialog = new TaskDialog(LanuageMgr.GetStr("KillAskStart") + " \"" + Marshal.PtrToStringUni(name) + "\" " + LanuageMgr.GetStr("KillAskEnd"), LanuageFBuffers.Str_AppTitle, LanuageMgr.GetStr("KillAskContentImporant")); taskDialog.VerificationText = LanuageMgr.GetStr("KillAskImporantGiveup"); taskDialog.VerificationClick += TermintateImporantProcess_TaskDialog_VerificationClick; taskDialog.CustomButtons = new CustomButton[] { new CustomButton(1, LanuageFBuffers.Str_Close), new CustomButton(2, LanuageFBuffers.Str_Cancel), }; taskDialog.EnableButton(1, false); } if (id == 2)//强制暂停警告 { taskDialog = new TaskDialog(LanuageMgr.GetStr("SuspendStart") + " \"" + Marshal.PtrToStringUni(name) + "\" " + LanuageMgr.GetStr("SuspendEnd"), LanuageFBuffers.Str_AppTitle, LanuageMgr.GetStr("SuspendWarnContent")); taskDialog.VerificationText = LanuageMgr.GetStr("KillAskImporantGiveup"); taskDialog.VerificationClick += TermintateImporantProcess_TaskDialog_VerificationClick; taskDialog.CustomButtons = new CustomButton[] { new CustomButton(1, LanuageFBuffers.Str_Close), new CustomButton(2, LanuageFBuffers.Str_Cancel), }; taskDialog.EnableButton(1, false); } if (id == 3)//强制结束重要警告 { taskDialog = new TaskDialog(LanuageMgr.GetStr("KillAskStart") + " \"" + Marshal.PtrToStringUni(name) + "\" " + LanuageMgr.GetStr("KillAskEnd"), LanuageMgr.GetStr("TitleVeryWarn"), LanuageMgr.GetStr("KillAskContentVeryImporant")); taskDialog.VerificationText = LanuageMgr.GetStr("KillAskImporantGiveup"); taskDialog.VerificationClick += TermintateImporantProcess_TaskDialog_VerificationClick; taskDialog.CustomButtons = new CustomButton[] { new CustomButton(1, LanuageFBuffers.Str_Close), new CustomButton(2, LanuageFBuffers.Str_Cancel), }; taskDialog.EnableButton(1, false); } if (id == 4)//强制暂停重要重要警告 { taskDialog = new TaskDialog(LanuageMgr.GetStr("SuspendStart") + " \"" + Marshal.PtrToStringUni(name) + "\" " + LanuageMgr.GetStr("SuspendEnd"), LanuageMgr.GetStr("TitleVeryWarn"), LanuageMgr.GetStr("SuspendVeryImporantWarnContent")); taskDialog.VerificationText = LanuageMgr.GetStr("KillAskImporantGiveup"); taskDialog.VerificationClick += TermintateImporantProcess_TaskDialog_VerificationClick; taskDialog.CustomButtons = new CustomButton[] { new CustomButton(1, LanuageFBuffers.Str_Close), new CustomButton(2, LanuageFBuffers.Str_Cancel), }; taskDialog.EnableButton(1, false); } if (id == 5)//暂停当前进程警告 { taskDialog = new TaskDialog(LanuageMgr.GetStr("SuspendThisTitle"), LanuageFBuffers.Str_AppTitle, LanuageMgr.GetStr("SuspendThisText")); taskDialog.VerificationText = LanuageMgr.GetStr("SuspendCheckText"); taskDialog.VerificationClick += TermintateImporantProcess_TaskDialog_VerificationClick; taskDialog.CustomButtons = new CustomButton[] { new CustomButton(1, LanuageFBuffers.Str_Yes), new CustomButton(2, LanuageFBuffers.Str_No), }; taskDialog.EnableButton(1, false); } Results rs = taskDialog.Show(this); return(rs.ButtonID == 1); }