Skip to content

Commit

Permalink
move_memtests() doesn't run on a separate thread
Browse files Browse the repository at this point in the history
When pressing the run button, the MemTest instances now moves before starting.
  • Loading branch information
integralfx authored Nov 24, 2018
1 parent c1d76a0 commit 689e56c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions MemTestHelper/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private void btn_show_Click(object sender, EventArgs e)

private void offset_changed(object sender, EventArgs e)
{
move_memtests();
run_in_background(new MethodInvoker(delegate { move_memtests(); }));
}

private void btn_center_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -445,10 +445,10 @@ private void start_memtests()
double ram = Convert.ToDouble(txt_ram.Text) / threads;
ControlSetText(hwnd, MEMTEST_EDT_RAM, string.Format("{0:f2}", ram));

ControlClick(hwnd, MEMTEST_BTN_START);

ControlSetText(hwnd, MEMTEST_STATIC_FREE_VER, "Modified version by ∫ntegral#7834");

ControlClick(hwnd, MEMTEST_BTN_START);

Thread.Sleep(10);
}
}
Expand All @@ -464,20 +464,17 @@ private void move_memtests()
rows = (int)cbo_rows.SelectedItem,
cols = (int)cbo_threads.SelectedItem / rows;

run_in_background(new MethodInvoker(delegate
for (int r = 0; r < rows; r++)
{
for (int r = 0; r < rows; r++)
for (int c = 0; c < cols; c++)
{
for (int c = 0; c < cols; c++)
{
IntPtr hwnd = memtest_states[r * cols + c].proc.MainWindowHandle;
int x = c * MEMTEST_WIDTH + c * x_spacing + x_offset,
y = r * MEMTEST_HEIGHT + r * y_spacing + y_offset;
IntPtr hwnd = memtest_states[r * cols + c].proc.MainWindowHandle;
int x = c * MEMTEST_WIDTH + c * x_spacing + x_offset,
y = r * MEMTEST_HEIGHT + r * y_spacing + y_offset;

MoveWindow(hwnd, x, y, MEMTEST_WIDTH, MEMTEST_HEIGHT, true);
}
MoveWindow(hwnd, x, y, MEMTEST_WIDTH, MEMTEST_HEIGHT, true);
}
}));
}
}

private void close_all_memtests()
Expand Down

0 comments on commit 689e56c

Please sign in to comment.