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. Send SIGINT by program?

Send SIGINT by program?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialquestion
3 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.
  • K Offline
    K Offline
    khb
    wrote on last edited by
    #1

    Hi together, I need some help: I have an console app that must be stopped by pressing CTRL-C to allow it to shut down gracefully (including saving some data). I spawn this app by an MFC app via CreateProcess(). My problem is now, that I also want to stop it by the MFC app, i.e. send an SIGINT to the console app. But I believe that this isn't possible, is it? Does anybody has an idea how to stop my console app gracefully? TerminateProcess() unfortunately doesn't help... Thank you very much for all your help, Marcus.

    R 1 Reply Last reply
    0
    • K khb

      Hi together, I need some help: I have an console app that must be stopped by pressing CTRL-C to allow it to shut down gracefully (including saving some data). I spawn this app by an MFC app via CreateProcess(). My problem is now, that I also want to stop it by the MFC app, i.e. send an SIGINT to the console app. But I believe that this isn't possible, is it? Does anybody has an idea how to stop my console app gracefully? TerminateProcess() unfortunately doesn't help... Thank you very much for all your help, Marcus.

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      If it is spawned via CreateProcess, you will get a handle on it. Can't you interact with the console window through this handle ? Send a close message or even CTRL-C keys to it ? ~RaGE();

      K 1 Reply Last reply
      0
      • R Rage

        If it is spawned via CreateProcess, you will get a handle on it. Can't you interact with the console window through this handle ? Send a close message or even CTRL-C keys to it ? ~RaGE();

        K Offline
        K Offline
        khb
        wrote on last edited by
        #3

        I'll try if it possible to send a CTRL-C key to the console. Thanks for the tip! Marcus.

        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