是否有这个函数,怎么用?或者怎么添加这个事件

解决方案 »

  1.   

    OnActivate事件不能满足你的需求吗?
      

  2.   

    如果该窗体未隐藏时,OnActivate就不管用了
      

  3.   

    如果该窗体未隐藏时,OnActivate就不管用了,何解?
      

  4.   

    WM_ACTIVATEThe WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately. WM_ACTIVATE 
    fActive = LOWORD(wParam);           // activation flag 
    fMinimized = (BOOL) HIWORD(wParam); // minimized flag 
    hwndPrevious = (HWND) lParam;       // window handle 
      

  5.   

    OnActivate为什么会不能用?
    是不是有个Form Stay on top.
    那就改到OnPaint里去