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. can u terminate the dos window?

can u terminate the dos window?

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

    lets run a dos window (command.com) then type "sort" (then press return key). the dos window blocks there (until we input complete command for "sort"). at this stage, can we terminate the "sort" command or exit dos window without pressing close button of the dos window? - i mean, terminate the dos window only by tying some command ot text? ================================================ this is a VC question actually. I use an app to CreateProcess of the command.com. but once the dos blocks there (i.e. in the middle of sending command "sort"), my app can not terminate the dos window - i have tried all functions (such as TerminateProcess, RxitProcess). i think if i can terminate the dos by command as described above, i can terminate the dos in my app also. thx includeh10

    C 1 Reply Last reply
    0
    • I includeh10

      lets run a dos window (command.com) then type "sort" (then press return key). the dos window blocks there (until we input complete command for "sort"). at this stage, can we terminate the "sort" command or exit dos window without pressing close button of the dos window? - i mean, terminate the dos window only by tying some command ot text? ================================================ this is a VC question actually. I use an app to CreateProcess of the command.com. but once the dos blocks there (i.e. in the middle of sending command "sort"), my app can not terminate the dos window - i have tried all functions (such as TerminateProcess, RxitProcess). i think if i can terminate the dos by command as described above, i can terminate the dos in my app also. thx includeh10

      C Offline
      C Offline
      CodeBeetle
      wrote on last edited by
      #2

      when u use createprocess to run command.exe are u using the process handle in the return PROCESS_INFORMATION structure to TerminateProcess() ? also sort.exe is another app which is spawned by command.exe, so TerminateProcess() doesnt hav the process handle of sort.exe it only has command.exe. maybe try using createprocess to run sort.exe instead?


      CodeBeetle.Com


      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