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 windows is closed ?

When a non modal windows is closed ?

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 4 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 In a small project I instantiate a non modal window by following code snippet : sheet->Create (NULL,-1,0 ); sheet->ShowWindow(SW_SHOW ); Then I set a timer , which I want to monitor the "sheet" windows when closed. Thus I want to implement a monitoring mechanisem in timer routine in order to be aware of close time of sheet window. How Can I do this? Regards Mahdi

    stefanmihaimogaS J T 3 Replies Last reply
    0
    • D DSPCottage

      Dear All In a small project I instantiate a non modal window by following code snippet : sheet->Create (NULL,-1,0 ); sheet->ShowWindow(SW_SHOW ); Then I set a timer , which I want to monitor the "sheet" windows when closed. Thus I want to implement a monitoring mechanisem in timer routine in order to be aware of close time of sheet window. How Can I do this? Regards Mahdi

      stefanmihaimogaS Online
      stefanmihaimogaS Online
      stefanmihaimoga
      wrote on last edited by
      #2

      Hello, you can close the non-modal dialog by calling CWnd::DestroyWindow[^] function. Best regards, Mihai Moga

      1 Reply Last reply
      0
      • D DSPCottage

        Dear All In a small project I instantiate a non modal window by following code snippet : sheet->Create (NULL,-1,0 ); sheet->ShowWindow(SW_SHOW ); Then I set a timer , which I want to monitor the "sheet" windows when closed. Thus I want to implement a monitoring mechanisem in timer routine in order to be aware of close time of sheet window. How Can I do this? Regards Mahdi

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

        Gut Mikh Tappe wrote:

        Then I set a timer , which I want to monitor the "sheet" windows when closed.

        What I understood is that - you want to check whether the sheet window is closed from your timer routine? A few suggestions are below, 1) You could call IsWindow() by passing the handle of dialog. If the window specified by handle doesn't exist, the api will return failure. The first question that comes to mind will be - What happen if the handle will be resued by any other window created in between? Not a real concern. Read this[^]. 2) You could send a WM_NULL message to the window. If the send function failed, then your window is RIP! 3) But the best method is - instead of polling, let the sheet window notify you when it closes. Handle the WM_DESTROY message in your sheet dialog and send a message to your parent window. Did i explained too much details? :rolleyes: Regards, Jijo.

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

        D T 2 Replies Last reply
        0
        • J Jijo Raj

          Gut Mikh Tappe wrote:

          Then I set a timer , which I want to monitor the "sheet" windows when closed.

          What I understood is that - you want to check whether the sheet window is closed from your timer routine? A few suggestions are below, 1) You could call IsWindow() by passing the handle of dialog. If the window specified by handle doesn't exist, the api will return failure. The first question that comes to mind will be - What happen if the handle will be resued by any other window created in between? Not a real concern. Read this[^]. 2) You could send a WM_NULL message to the window. If the send function failed, then your window is RIP! 3) But the best method is - instead of polling, let the sheet window notify you when it closes. Handle the WM_DESTROY message in your sheet dialog and send a message to your parent window. Did i explained too much details? :rolleyes: Regards, Jijo.

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

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

          Thank you Your help is great I can overcome the problem. Thanx again

          1 Reply Last reply
          0
          • D DSPCottage

            Dear All In a small project I instantiate a non modal window by following code snippet : sheet->Create (NULL,-1,0 ); sheet->ShowWindow(SW_SHOW ); Then I set a timer , which I want to monitor the "sheet" windows when closed. Thus I want to implement a monitoring mechanisem in timer routine in order to be aware of close time of sheet window. How Can I do this? Regards Mahdi

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            can you change little architecture of your program, why can't non-modal dialog box notify parent dialog box.. when it closed!

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
            Never mind - my own stupidity is the source of every "problem" - Mixture

            cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/xml>

            1 Reply Last reply
            0
            • J Jijo Raj

              Gut Mikh Tappe wrote:

              Then I set a timer , which I want to monitor the "sheet" windows when closed.

              What I understood is that - you want to check whether the sheet window is closed from your timer routine? A few suggestions are below, 1) You could call IsWindow() by passing the handle of dialog. If the window specified by handle doesn't exist, the api will return failure. The first question that comes to mind will be - What happen if the handle will be resued by any other window created in between? Not a real concern. Read this[^]. 2) You could send a WM_NULL message to the window. If the send function failed, then your window is RIP! 3) But the best method is - instead of polling, let the sheet window notify you when it closes. Handle the WM_DESTROY message in your sheet dialog and send a message to your parent window. Did i explained too much details? :rolleyes: Regards, Jijo.

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

              T Offline
              T Offline
              ThatsAlok
              wrote on last edited by
              #6

              Jijo raj wrote:

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

              Cool Site!!!!

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
              Never mind - my own stupidity is the source of every "problem" - Mixture

              cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/xml>

              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