att,某些对话框弹出时,在右下通知区域选择退出程序,就会莫名其妙挂掉,而另一些不会;是否有人碰到过类似情况?

解决方案 »

  1.   

    GetActivePopup() 和 AfxGetMainWnd() 比较
      

  2.   


    CFrameWnd 没有 GetActivePopup()这个函数
      

  3.   

    打错了,::GetLastActivePopup
    GetLastActivePopup Function--------------------------------------------------------------------------------The GetLastActivePopup function determines which pop-up window owned by the specified window was most recently active. SyntaxHWND GetLastActivePopup(          HWND hWnd
    );
    ParametershWnd
    [in] Handle to the owner window. 
    Return ValueThe return value identifies the most recently active pop-up window. The return value is the same as the hWnd parameter, if any of the following conditions are met: The window identified by hWnd was most recently active.
    The window identified by hWnd does not own any pop-up windows.
    The window identifies by hWnd is not a top-level window, or it is owned by another window.
      

  4.   

    通过::FindWindowEx()函数取得子窗口的句柄
    然后再判断其m_hWnd,这样可不可以?
      

  5.   

    谢谢4楼DavidHsing的回答,问题解决了:)