You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vladimir Panteleev edited this page Feb 1, 2014
·
2 revisions
Suppressing DMD's "abnormal program termination" message box on Windows
Run the following D program in the background. It's not a perfect solution (message boxes will steal focus for a fraction of a second), but it'll keep the reduction going.
importstd.c.windows.windows;
extern(Windows)
{
HWNDFindWindowA(LPCSTR, LPCSTR);
HWNDFindWindowExA(HWND, HWND, LPCSTR, LPCSTR);
}
voidmain()
{
while(true)
{
auto h = FindWindowA("#32770", null);
while (h)
{
auto h2 = FindWindowExA(h, null, null, "\nabnormal program termination\n");
if (h2)
{
h2 = FindWindowExA(h, null, "Button", "OK");
if (h2)
SendMessageA(h2, BM_CLICK, 0, 0);
}
h = FindWindowExA(null, h, "#32770", null);
}
Sleep(1);
}
}