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. Capture the windows console exit event

Capture the windows console exit event

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestionlearning
2 Posts 2 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.
  • N Offline
    N Offline
    Nacho Chip
    wrote on last edited by
    #1

    Hello all, I have some questions about the windows console. If my main GUI windows create a new console windows attach to the main process by calling AllocConsole(). Is there any way to get notify when the console get closed by the user? For example, the close windows button in the top right get clicked by the user. The problem what I have is that if the console windows get closed, then my main process will also be terminated. However, it happen without letting my free my application resource. Any suggestion? Thanks for advance! Nachi

    Nacho

    M 1 Reply Last reply
    0
    • N Nacho Chip

      Hello all, I have some questions about the windows console. If my main GUI windows create a new console windows attach to the main process by calling AllocConsole(). Is there any way to get notify when the console get closed by the user? For example, the close windows button in the top right get clicked by the user. The problem what I have is that if the console windows get closed, then my main process will also be terminated. However, it happen without letting my free my application resource. Any suggestion? Thanks for advance! Nachi

      Nacho

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

      See the SetConsoleCtrlHandler Function[^] 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