Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. When a Non-Modal Window is Closed which Even Is fired

When a Non-Modal Window is Closed which Even Is fired

Scheduled Pinned Locked Moved C / C++ / MFC
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DSPCottage
    wrote on last edited by
    #1

    Dear All I want to Add some code when a Non Modal Windows is closed. Which Event is Fired when such a situation is occured. I test following Items and dont get answer: 1. OnDestroy 2. OnClose Best Regards Mahdi

    _ CPalliniC M 3 Replies Last reply
    0
    • D DSPCottage

      Dear All I want to Add some code when a Non Modal Windows is closed. Which Event is Fired when such a situation is occured. I test following Items and dont get answer: 1. OnDestroy 2. OnClose Best Regards Mahdi

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      Are you sure OnClose is not called? Are you not using OnCancel to close the dialog?

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      1 Reply Last reply
      0
      • D DSPCottage

        Dear All I want to Add some code when a Non Modal Windows is closed. Which Event is Fired when such a situation is occured. I test following Items and dont get answer: 1. OnDestroy 2. OnClose Best Regards Mahdi

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Are you sure OnDestroy isn't called? How do you 'close' the window? :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        D 1 Reply Last reply
        0
        • CPalliniC CPallini

          Are you sure OnDestroy isn't called? How do you 'close' the window? :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          D Offline
          D Offline
          DSPCottage
          wrote on last edited by
          #4

          I find the answer by trial and error PostNcDestroy is called when a non modal page is closed. Thank you for your help.

          J 1 Reply Last reply
          0
          • D DSPCottage

            I find the answer by trial and error PostNcDestroy is called when a non modal page is closed. Thank you for your help.

            J Offline
            J Offline
            Jijo Raj
            wrote on last edited by
            #5

            The CWnd::OnDestroy() should be called as per documentation. Extract from MSDN : "This method is called by the framework to inform the CWnd object that it is being destroyed. OnDestroy is called after the CWnd object is removed from the screen." I guess, something went wrong when you add your message handler for WM_DESTROY. Try once again by adding WM_DESTROY message handler by using class wizard. Regards, Jijo.

            _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

            1 Reply Last reply
            0
            • D DSPCottage

              Dear All I want to Add some code when a Non Modal Windows is closed. Which Event is Fired when such a situation is occured. I test following Items and dont get answer: 1. OnDestroy 2. OnClose Best Regards Mahdi

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              Gut Mikh Tappe wrote:

              I test following Items and dont get answer

              Did you add entries to the window class' message map so those methods would actually get called? Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups