隐藏错误报告窗口 [英] Hide Error Report window

查看:162
本文介绍了隐藏错误报告窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:

我的ASP.Net应用程序收到一个简单的控制台程序的C ++源代码,用cl.exe(命令行VC ++编译器)进行编译,并使用System.Diagnostics .Process。

I have the following problem:
My ASP.Net application receives a C++ source code of simple console programm, compiles it with cl.exe (command line VC++ compiler) and runs it using System.Diagnostics.Process.

ASP.Net应用程序在PC上运行,可用于其他工作(它不是服务器,只是一个工作机器)。我从用户隐藏运行的程序窗口(使用Process.CreateNoWindow和Process.WindowStyle = ProcessWindowStyle.Hidden属性),但有时收到的源可能包含一些崩溃的指令(如访问无效内存地址或其他东西)和程序崩溃。 Windows显示错误报告窗口(如果是Vista窗口,其中包含消息Windows正在检查问题的解决方案...),这样会分散用户注意力并使他感到困惑。

ASP.Net application runs on PC, which can be used for other work (it is not a server, just a working machine). I am hide running program window from user (using Process.CreateNoWindow and Process.WindowStyle = ProcessWindowStyle.Hidden properties), but sometimes received source can contain some crashing instruction (like access to invalid memory address or something else) and programm crashed. Windows show Error Report window (if it is Vista - window with message "Windows is checking for a solution to the problem...") in this case, which distracts user and confuse him.

也许有一些方法来阻止显示这个消息或关闭它的自动化?我有很多关于WinAPI的google,但找不到解决方案。如果一个进程是不可能的 - 也许我可以在整个系统上临时禁用这个窗口?

Maybe there is some way to prevent showing this messages or close its automaticaly? I have google a lot about WinAPI, but cannot find a solution. If it is impossible for a single process - maybe I can temporary disable this windows on whole system?

推荐答案

从Windows Vista开始,您可以使用WinAPI函数 WerAddExcludedApplication 为特定应用程序禁用Windows错误报告。

Starting with Windows Vista, you can use the WinAPI function WerAddExcludedApplicationto disable "Windows Error Reporting" for a specific application.

请参阅: a href =http://msdn.microsoft.com/en-us/library/bb513617(VS.85).aspx =nofollow noreferrer> http://msdn.microsoft.com/en-us/ library / bb513617(VS.85).aspx

See: http://msdn.microsoft.com/en-us/library/bb513617(VS.85).aspx

在Vista之前的Windows版本中,函数 AddERExcludedApplication 必须使用。

In Windows versions before Vista, the function AddERExcludedApplication had to be used.

请参阅: http://msdn.microsoft.com/en-us/library/bb513614(VS.85).aspx

这篇关于隐藏错误报告窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆