private void StartMemTests() { CloseAllMemTests(); var threads = (int)cboThreads.SelectedItem; var ram = Convert.ToDouble(txtRAM.Text) / threads; var startMin = chkStartMin.IsChecked.Value; Parallel.For(0, threads, i => { memtests[i] = new MemTest(); memtests[i].Start(ram, startMin); }); /* * Some nag message boxes won't be clicked due to concurrent execution. * memTestA | memTestB * SetActiveWindow() | * | SetActiveWindow() * SendNotifyMessage() | * | SendNotifyMessage() * * memTestB's window will be active while calling SendNotifyMessage() * for memTestA. */ foreach (var hwnd in WinAPI.FindAllWindows(MemTest.MSG2)) { WinAPI.ControlClick(hwnd, MemTest.MSGBOX_OK); } if (!chkStartMin.IsChecked.Value) { LayOutMemTests(); } }
private bool StartMemTests() { CloseAllMemTests(); var threads = (int)cboThreads.SelectedItem; var ram = Convert.ToDouble(txtRAM.Text) / threads; var startMin = chkStartMin.IsChecked.Value; MemTest.VerboseLogging = chkVerbose.IsChecked.Value; MemTest.Timeout = TimeSpan.FromSeconds(udTimeout.Value.Value); Parallel.For(0, threads, i => { memtests[i] = new MemTest(); memtests[i].Start(ram, startMin); }); for (int i = 0; i < threads; i++) { var mt = memtests[i]; if (!mt.Started) { return(false); } } if (!chkStartMin.IsChecked.Value) { LayoutMemTests(); } return(true); }
private void StartMemTests() { CloseAllMemTests(); var threads = (int)cboThreads.SelectedItem; var ram = Convert.ToDouble(txtRAM.Text) / threads; var startMin = chkStartMin.IsChecked.Value; Parallel.For(0, threads, i => { memtests[i] = new MemTest(); memtests[i].Start(ram, startMin); }); if (!chkStartMin.IsChecked.Value) { LayOutMemTests(); } }
private void StartMemTests() { CloseAllMemTests(); var threads = (int)cboThreads.SelectedItem; var ram = Convert.ToDouble(txtRAM.Text) / threads; var startMin = chkStartMin.IsChecked.Value; Parallel.For(0, threads, i => { memtests[i] = new MemTest(); memtests[i].Start(ram, startMin); }); foreach (var hwnd in WinAPI.FindAllWindows(MemTest.MSG2)) { WinAPI.ControlClick(hwnd, MemTest.MSGBOX_OK); } if (!chkStartMin.IsChecked.Value) { LayOutMemTests(); } }