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

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

问题描述

我有以下问题:
我的ASP.Net应用程序接收到一个C ++源$ C ​​$的简单的控制台PROGRAMM 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属性),但有时接收到的源可以包含一些崩溃指令(如访问无效的内存地址或其他内容)和PROGRAMM坠毁。 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.

也许有一些办法prevent显示此消息或automaticaly关闭其?我google了很多关于WinAPI的,但无法找到一个解决方案。如果这是不可能的一个过程 - 也许我可以暂时禁用该窗口上整个系统

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?

谢谢,对不起,我的英语不好=)

Thanks and sorry for my bad English =)

推荐答案

从Windows Vista开始,您可以使用WinAPI的函数 WerAddExcludedApplication 来禁用Windows错误报告的一个特定的应用

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

请参阅: 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天全站免登陆