5 : Windows Message Mapping

いち.消息流程

         WM_CREATE

    first message to a view . use ONCreate 无法截获. OnInitalUpdate可以使用, but this function maybe use more than one time .

         WM_CLOSE

    OnClose to close the window, use CDocument::SaveModified for safe.

         WM_QUERYENDSESSION

    It is sure that many programs are  running when you want to close the windows. So, these session must be end before the windows are closed .

And then , using WM_QUERYENDSESSION in OnQueryEndSession function.

         WM_DESTROY

    WM_DESTROY after WM_CLOSE .->OnDestroy.

    the view is visable but it and its child are still active.

    -> call base OnDestroy.

         WM_NCDESTROY

    last message before window destroyed.

    child has been destroyed .

    ->OnNCDestroy ->base OnNCDestroy.

    The 动态 view use PostNCDestroy.

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章:

  • 2022-01-21
  • 2021-11-22
  • 2021-11-13
  • 2022-12-23
  • 2021-10-14
  • 2021-08-29
  • 2021-07-17
  • 2021-06-16
猜你喜欢
  • 2022-03-01
  • 2021-05-21
  • 2021-12-24
  • 2021-09-16
  • 2021-06-26
  • 2021-06-12
  • 2022-02-01
相关资源
相似解决方案