Programing

Windows Vista에서 '디버그 / 응용 프로그램 닫기'대화 상자를 비활성화하려면 어떻게합니까?

lottogame 2020. 9. 20. 10:32
반응형

Windows Vista에서 '디버그 / 응용 프로그램 닫기'대화 상자를 비활성화하려면 어떻게합니까?


Windows에서 애플리케이션이 충돌하고 Visual Studio와 같은 디버거가 설치되면 다음 모달 대화 상자가 나타납니다.

[제목 : Microsoft Windows]

X가 작동을 멈췄습니다.

문제로 인해 프로그램이 올바르게 작동하지 않습니다. Windows에서 프로그램을 닫고 솔루션을 사용할 수 있는지 알려줍니다.

[디버그] [응용 프로그램 닫기]

이 대화 상자를 비활성화하는 방법이 있습니까? 즉, 프로그램이 충돌하고 조용히 구워 졌습니까?

내 시나리오는 몇 가지 자동화 된 테스트를 실행하고 싶은데, 그중 일부는 테스트중인 애플리케이션의 버그로 인해 충돌이 발생합니다. 이 대화 상자가 자동화 실행을 지연시키는 것을 원하지 않습니다.

주변을 검색하면 Windows XP에서 이것을 비활성화하는 솔루션을 찾았다 고 생각합니다.

HKLM \ Software \ Microsoft \ Windows NT \ CurrentVersion \ AeDebug \ Debugger

그러나 Windows Vista에서는 작동하지 않았습니다.


WER (Windows 오류보고)에서 프로그램을 디버그하라는 메시지를 표시하는 대신 크래시 덤프를 수행하고 앱을 닫도록 강제하려면 다음 레지스트리 항목을 설정할 수 있습니다.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting]
"ForceQueue"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent]
"DefaultConsent"=dword:00000001

이를 설정 한 후 앱이 다운되면 * .hdmp 및 * .mdmp 파일이 다음 위치에 표시되어야합니다.

%ALLUSERSPROFILE%\Microsoft\Windows\WER\

여기를 보아라:

http://msdn.microsoft.com/en-us/library/bb513638.aspx

regedit

DWORD HKLM 또는 HKCU \ Software \ Microsoft \ Windows \ Windows 오류보고 \ DontShowUI = "1"

WER가 조용히보고합니다. 그런 다음 설정할 수 있습니다.

DWORD HKLM 또는 HKCU \ Software \ Microsoft \ Windows \ Windows 오류보고 \ Disabled = "1"

MS와의 대화를 중지합니다.


이것이 정확히 동일한 대화를 참조하는지 확실하지 않지만 여기에 Raymond Chen 의 다른 접근 방식이 있습니다 .

DWORD dwMode = SetErrorMode(SEM_NOGPFAULTERRORBOX);
SetErrorMode(dwMode | SEM_NOGPFAULTERRORBOX);

Firefox 용 Windows 64 비트에서 릴리스 자동화 작업을 위해이 기능을 비활성화해야했고 다음을 수행했습니다.

  • gpedit.msc
  • 컴퓨터 구성-> 관리 템플릿
  • Windows 구성 요소-> Windows 오류보고
  • "심각한 오류에 대한 사용자 인터페이스 표시 방지"를 사용으로 설정합니다.

http://www.blogsdna.com/2137/fix-windows-installer-explorer-update-has-stopped-working-in-windows-7.htm 에서 고객 경험보고를 위해 수행 된 것과 유사합니다 .


내 컨텍스트에서는 전체 시스템이 아닌 단위 테스트에 대한 팝업 만 억제하고 싶습니다. 처리되지 않은 예외 포착, 런타임 검사 억제 (예 : 스택 포인터의 유효성) 및 오류 모드 플래그와 같은 이러한 오류를 억제하기 위해 함수 조합이 필요하다는 것을 발견했습니다. 이것이 내가 성공으로 사용한 것입니다.

#include <windows.h>
#include <rtcapi.h>
int exception_handler(LPEXCEPTION_POINTERS p)
{
    printf("Exception detected during the unit tests!\n");
    exit(1);
}
int runtime_check_handler(int errorType, const char *filename, int linenumber, const char *moduleName, const char *format, ...)
{
    printf("Error type %d at %s line %d in %s", errorType, filename, linenumber, moduleName);
    exit(1);
}

int main()
{
    DWORD dwMode = SetErrorMode(SEM_NOGPFAULTERRORBOX);
    SetErrorMode(dwMode | SEM_NOGPFAULTERRORBOX);
    SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)&exception_handler); 
    _RTC_SetErrorFunc(&runtime_check_handler);

    // Run your tests here

    return 0;
}

WPF 애플리케이션에서

[DllImport("kernel32.dll", SetLastError = true)]
static extern int SetErrorMode(int wMode);

[DllImport("kernel32.dll")]
static extern FilterDelegate SetUnhandledExceptionFilter(FilterDelegate lpTopLevelExceptionFilter);
public delegate bool FilterDelegate(Exception ex);

public static void DisableChashReport()
{
 FilterDelegate fd = delegate(Exception ex)
 {
  return true;
 };
 SetUnhandledExceptionFilter(fd);
 SetErrorMode(SetErrorMode(0) | 0x0002 );
}

단순히 응용 프로그램을 종료하는 처리되지 않은 예외 필터를 구현 한 다음 SetUnhandledExceptionFilter ()로 해당 필터 함수를 설정해야합니다 .

보안 CRT를 사용하는 경우 자체 잘못된 매개 변수 처리기를 제공하고 _set_invalid_parameter_handler ()를 사용 하여 이를 설정해야 합니다.

이 블로그 게시물에도 몇 가지 정보가 있습니다. http://blog.kalmbachnet.de/?postid=75


During test you can run with a 'debugger' like ADPlus attached which can be configured in many useful ways to collect data (minidumps) on errors and yet prevent the modal dialog problems you state above.

If you want to get some useful information when your app crashes in production you can configure Microsoft Error reporting to get something similar to ADPlus data.


This isn't a direct answer to the question since this is a workaround and the question is about how to disable that feature, but in my case, I'm a user on a server with limited permissions and cannot disable the feature using one of the other answers. So, I needed a workaround. This will likely work for at least some others who end up on this question.

I used autohotkey portable and created a macro that once a minute checks to see if the popup box exists, and if it does, clicks the button to close the program. In my case, that's sufficient, and leaves the feature on for other users. It requires that I start the script when I run the at-risk program, but it works for my needs.

The script is as follows:

sleep_duration = 60000 ; how often to check, in milliseconds.
                       ; 60000 is a full minute

Loop
{
    IfWinExist, ahk_class #32770 ; use autohotkey's window spy to confirm that
                ; ahk_class #32770 is it for you. This seemed to be consistent
                ; across all errors like this on Windows Server 2008
    {
        ControlClick, Button2, ahk_class #32770 ; sends the click.
                ; Button2 is the control name and then the following
                ; is that window name again
    }
    Sleep, sleep_duration ; wait for the time set above
}

edit: A quick flag. When other things are up, this seems to attempt to activate controls in the foreground window - it's supposed to send it to the program in the background. If I find a fix, I'll edit this answer to reflect it, but for now, be cautious about using this and trying to do other work on a machine at the same time.


After trying everything else on the internet to get rid of just in time debugger, I found a simple way that actually worked and I hope will help someone else.

Go to Control Panel Go to Administrative Tools Go to Services Look down the list for Machine Debug Manager Right Click on it and click on Properties Under the General Tab, look for Start Up Type Click on Disable. Click on Apply and OK.

I haven't seen the debugger message since, and my computer is running perfectly.


Instead of changing values in the registry you can completly disable the error reporting on Windows Server 2008 R2, Windows Server 2012 and Windows 8 with: serverWerOptin /disable

https://technet.microsoft.com/en-us/library/hh875648(v=ws.11).aspx

참고URL : https://stackoverflow.com/questions/396369/how-do-i-disable-the-debug-close-application-dialog-on-windows-vista

반응형