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. Holy Dense... Codeguru Guru's

Holy Dense... Codeguru Guru's

Scheduled Pinned Locked Moved C / C++ / MFC
c++
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.
  • F Offline
    F Offline
    Fred 0
    wrote on last edited by
    #1

    Hi All, man, you know its Monday...... yes, i will lash myself after this. i can't belive, i've gone brain numb on this. I need to trap wm_quit/wm_close or any systm messages that will cause my app to shutdown, so i can check if my app is ready to shutdown ,and prevent this from happening unless certain conditions are met in my app. i've tried the OnCmdMsg --> if pMsg->message == WM_QUIT etc.... with no success. is this suppose to go in the main app .cpp file or the mainfrm.cpp Thanks in advance lost, stupid and confused Fred

    L C F M 4 Replies Last reply
    0
    • F Fred 0

      Hi All, man, you know its Monday...... yes, i will lash myself after this. i can't belive, i've gone brain numb on this. I need to trap wm_quit/wm_close or any systm messages that will cause my app to shutdown, so i can check if my app is ready to shutdown ,and prevent this from happening unless certain conditions are met in my app. i've tried the OnCmdMsg --> if pMsg->message == WM_QUIT etc.... with no success. is this suppose to go in the main app .cpp file or the mainfrm.cpp Thanks in advance lost, stupid and confused Fred

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      if you override the OnClose() handler and simply return without executing the default handler if you don't want to close


      "... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away"
      sonork: 100.18128   8028finder.com

      F 1 Reply Last reply
      0
      • F Fred 0

        Hi All, man, you know its Monday...... yes, i will lash myself after this. i can't belive, i've gone brain numb on this. I need to trap wm_quit/wm_close or any systm messages that will cause my app to shutdown, so i can check if my app is ready to shutdown ,and prevent this from happening unless certain conditions are met in my app. i've tried the OnCmdMsg --> if pMsg->message == WM_QUIT etc.... with no success. is this suppose to go in the main app .cpp file or the mainfrm.cpp Thanks in advance lost, stupid and confused Fred

        C Offline
        C Offline
        Chad Koehler
        wrote on last edited by
        #3

        If you are using the document/view architecture, look up CDocument::SaveModified() in MSDN.

        1 Reply Last reply
        0
        • F Fred 0

          Hi All, man, you know its Monday...... yes, i will lash myself after this. i can't belive, i've gone brain numb on this. I need to trap wm_quit/wm_close or any systm messages that will cause my app to shutdown, so i can check if my app is ready to shutdown ,and prevent this from happening unless certain conditions are met in my app. i've tried the OnCmdMsg --> if pMsg->message == WM_QUIT etc.... with no success. is this suppose to go in the main app .cpp file or the mainfrm.cpp Thanks in advance lost, stupid and confused Fred

          F Offline
          F Offline
          Fred 0
          wrote on last edited by
          #4

          i'll give those a shot

          1 Reply Last reply
          0
          • L l a u r e n

            if you override the OnClose() handler and simply return without executing the default handler if you don't want to close


            "... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away"
            sonork: 100.18128   8028finder.com

            F Offline
            F Offline
            Fred 0
            wrote on last edited by
            #5

            did the trick thanks

            1 Reply Last reply
            0
            • F Fred 0

              Hi All, man, you know its Monday...... yes, i will lash myself after this. i can't belive, i've gone brain numb on this. I need to trap wm_quit/wm_close or any systm messages that will cause my app to shutdown, so i can check if my app is ready to shutdown ,and prevent this from happening unless certain conditions are met in my app. i've tried the OnCmdMsg --> if pMsg->message == WM_QUIT etc.... with no success. is this suppose to go in the main app .cpp file or the mainfrm.cpp Thanks in advance lost, stupid and confused Fred

              M Offline
              M Offline
              Michael Dunn
              wrote on last edited by
              #6

              WM_QUIT is not passed to any window proc (MFC or otherwise). When GetMessage() pulls a WM_QUIT out of the queue, it returns 0 to terminate the window's message loop. --Mike-- Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm

              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