我想让一个窗体在失去焦点后开始进行一系列的运算,应该响应哪个消息?谢谢!

解决方案 »

  1.   

    WM_KILLFOCUS
    WM_KILLFOCUS Notification--------------------------------------------------------------------------------The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. SyntaxWM_KILLFOCUS    WPARAM wParam
        LPARAM lParam;
        
    ParameterswParam
    Handle to the window that receives the keyboard focus. This parameter can be NULL. 
    lParam
    This parameter is not used. 
    Return ValueAn application should return zero if it processes this message. 
    ResIf an application is displaying a caret, the caret should be destroyed at this point. While processing this message, do not make any function calls that display or activate a window. This causes the thread to yield control and can cause the application to stop responding to messages. For more information, see Message Deadlocks. Notification RequirementsMinimum DLL Version None 
    Header Declared in Winuser.h, include Windows.h 
    Minimum operating systems Windows 95, Windows NT 3.1