- Notifications
You must be signed in to change notification settings - Fork17
Suppressing DMD crashes
Vladimir Panteleev edited this pageFeb 1, 2014 ·2 revisions
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);}}