Skip to content

Commit

Permalink
"Fix" for nag window not closing
Browse files Browse the repository at this point in the history
  • Loading branch information
integralfx authored May 3, 2019
1 parent 2f226e4 commit 4818a28
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions MemTestHelper/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ public Form1()
var info = get_coverage_info(state.proc.MainWindowHandle);
if (info == null) continue;

close_nag_msg(state.proc.Id, "Memory error detected!", 10);
// for some reason, this sometimes won't close in start_memtests()
close_nag_msg(state.proc.Id, "Message for first-time users", 1);

close_nag_msg(state.proc.Id, "Memory error detected!", 1);

total_coverage += info.Item1;
}
Expand Down Expand Up @@ -697,24 +700,8 @@ private void start_memtests()
ControlSetText(hwnd, MEMTEST_STATIC_FREE_VER, "MemTestHelper by ∫ntegral#7834");
ControlClick(hwnd, MEMTEST_BTN_START);

while (true)
{
IntPtr msg = FindWindow(MEMTEST_CLASSNAME, "Message for first-time users");

if (msg == IntPtr.Zero) continue;

uint msg_pid;
GetWindowThreadProcessId(msg, out msg_pid);

if (msg_pid == state.proc.Id)
{
while (!close_nag_msg(state.proc.Id, "Message for first-time users"))
Thread.Sleep(100);
break;
}

while (!close_nag_msg(state.proc.Id, "Message for first-time users"))
Thread.Sleep(100);
}

if (chk_start_min.Checked)
ShowWindow(hwnd, SW_MINIMIZE);
Expand Down

0 comments on commit 4818a28

Please sign in to comment.