Deactivate windows MessageBox dialog on exception

Andre Pany andre at s-e-a-p.de
Wed Aug 28 19:49:04 UTC 2019


On Wednesday, 28 August 2019 at 13:15:14 UTC, a11e99z wrote:
> On Wednesday, 28 August 2019 at 12:19:54 UTC, Andre Pany wrote:
>> Hi,
>>
>> I call another process using function pipeShell and 
>> Redirect.all.
>>
>
> import std;
>
> void main()
> {
>     auto p = pipeShell("a.exe", Redirect.all);
>     p.stdin.writeln("e1");
>     p.stdin.writeln("10");
>     p.stdin.writeln("e2");
>     p.stdin.writeln("9");
>
>     p.stdin.flush();
>     p.stdout.readln.writeln;
>
>     import core.thread: Thread;
>     import core.time: seconds;
>
>     Thread.sleep(2.seconds);
>     p.stdin.close;
>     p.stderr.byLineCopy.writeln;
>     Thread.sleep(1.seconds);
>     try {
> 	p.pid.kill; // Windows exception here "Access denied"
>     	p.pid.wait; // but no more MessageBox
>     } catch (Throwable) { }
> }

Thanks again. This solves my problem.

Kind regards
André


More information about the Digitalmars-d-learn mailing list