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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. capturing close button

capturing close button

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    Anandi VC
    wrote on last edited by
    #1

    in a dialog box ,there will be minimize,maximize,close buttons at the right-top end of the window. if i click on close button , how to capture it ? thanks in advance, Anandi VC

    I D 2 Replies Last reply
    0
    • A Anandi VC

      in a dialog box ,there will be minimize,maximize,close buttons at the right-top end of the window. if i click on close button , how to capture it ? thanks in advance, Anandi VC

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      WM_SYSCOMMAND / OnSysCommand / (eg)SC_CLOSE should do the trick, though I think in CDialog it ends up calling OnCancel, so you have less work to do - please verify for yourself. Iain.

      Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.

      A 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        WM_SYSCOMMAND / OnSysCommand / (eg)SC_CLOSE should do the trick, though I think in CDialog it ends up calling OnCancel, so you have less work to do - please verify for yourself. Iain.

        Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.

        A Offline
        A Offline
        Anandi VC
        wrote on last edited by
        #3

        Thank u :)

        1 Reply Last reply
        0
        • A Anandi VC

          in a dialog box ,there will be minimize,maximize,close buttons at the right-top end of the window. if i click on close button , how to capture it ? thanks in advance, Anandi VC

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Anandi.VC wrote:

          if i click on close button , how to capture it ?

          The framework calls OnSysCommand(0xf060), OnClose(), and OnCancel(), in that order.

          "Love people and use things, not love things and use people." - Unknown

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          A 2 Replies Last reply
          0
          • D David Crow

            Anandi.VC wrote:

            if i click on close button , how to capture it ?

            The framework calls OnSysCommand(0xf060), OnClose(), and OnCancel(), in that order.

            "Love people and use things, not love things and use people." - Unknown

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            A Offline
            A Offline
            Anandi VC
            wrote on last edited by
            #5

            Thank u David . Anandi VC

            1 Reply Last reply
            0
            • D David Crow

              Anandi.VC wrote:

              if i click on close button , how to capture it ?

              The framework calls OnSysCommand(0xf060), OnClose(), and OnCancel(), in that order.

              "Love people and use things, not love things and use people." - Unknown

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              A Offline
              A Offline
              Anandi VC
              wrote on last edited by
              #6

              i checked it and it is calling all the three functions you menctioned but in the following order : 1) OnClose() 2) OnCancel() 3) OnSysCommand() Thank u , Anandi VC

              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