Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/149.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 为什么应用程序可以标记为;“没有回应”;即使它发出信息?_C++_Winapi - Fatal编程技术网

C++ 为什么应用程序可以标记为;“没有回应”;即使它发出信息?

C++ 为什么应用程序可以标记为;“没有回应”;即使它发出信息?,c++,winapi,C++,Winapi,为什么应用程序即使发送消息也可以标记为“无响应” 消息循环如下所示: bool bLoop = true; while (bLoop) { int iMsgCount = 0; MSG msg; while ( PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE) ) { iMsgCount++; if(msg.message == WM_QUIT) {

为什么应用程序即使发送消息也可以标记为“无响应”

消息循环如下所示:

bool bLoop = true;
while (bLoop)
{
    int iMsgCount = 0;

    MSG msg;
    while ( PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE) )
    {
        iMsgCount++;

        if(msg.message == WM_QUIT)
        {
            bLoop = false;
            break;
        {

        AppPreprocessIME(msg);
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    Log( "Message loop (messages) %d ", iMsgCount );
    Log( "ThreadId %d", GetCurrentThreadId() );

    if(!bLoop)
       break;


    // Update/DirectX draw/etc.
}
循环运行正常(它写入日志消息),但Windows仍将其标记为“无响应”

是否有其他的检查窗口做这样的决定?或者其他什么东西会导致这种行为


此外,若附加了调试器(从调试器启动或在“无响应”状态下附加),则窗口将响应。我猜调试器钩住了某些东西或改变了消息队列处理。

您是否能够生成转储文件(处于无响应状态)并使用windbg进行分析?我不知道要分析什么。应用程序仍在运行,它会写入日志、查看消息等。嗯,如果
PeekMessage
返回0,则会退出循环并停止发送消息。附加调试器会更改行为。这是:“如果顶级窗口停止响应消息的时间超过几秒钟,系统会认为该窗口没有响应,并将其替换为重影窗口[…]。在调试应用程序时,系统不会生成重影窗口。”您是否可以