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#
  4. DOS exec not receiving input from standard I/O...

DOS exec not receiving input from standard I/O...

Scheduled Pinned Locked Moved C#
comtutorialquestion
4 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.
  • F Offline
    F Offline
    Fuzzychaos
    wrote on last edited by
    #1

    I'm trying to use different functions like SendInput and SendKeys to send input for controlling a DOS program running in a Command Prompt window (very old DOS program - no source code). Both of the above functions work on a standard Command Prompt, but it doesn't work on the DOS program once I run it. It also seems that many of keyboard macro programs don't work on these types of DOS programs either. Does anyone know of how to send the key input in the way that many DOS programs are reading input from the keyboard? I solved this once a very long time ago using libs in Windows XP (still running this OS) but lost the code and my source of information :((.

    Jeremy Props to the family: New Dawn Engineering

    P 1 Reply Last reply
    0
    • F Fuzzychaos

      I'm trying to use different functions like SendInput and SendKeys to send input for controlling a DOS program running in a Command Prompt window (very old DOS program - no source code). Both of the above functions work on a standard Command Prompt, but it doesn't work on the DOS program once I run it. It also seems that many of keyboard macro programs don't work on these types of DOS programs either. Does anyone know of how to send the key input in the way that many DOS programs are reading input from the keyboard? I solved this once a very long time ago using libs in Windows XP (still running this OS) but lost the code and my source of information :((.

      Jeremy Props to the family: New Dawn Engineering

      P Offline
      P Offline
      Phil J Pearson
      wrote on last edited by
      #2

      It may be almost impossible. Some DOS programs talked directly to the hardware to get input and you can't do that in Windows unless you write a kernel mode driver. Even then it may still be infeasible. Get real and junk the DOS program - this is 2007!!!!

      Phil


      The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.

      F 1 Reply Last reply
      0
      • P Phil J Pearson

        It may be almost impossible. Some DOS programs talked directly to the hardware to get input and you can't do that in Windows unless you write a kernel mode driver. Even then it may still be infeasible. Get real and junk the DOS program - this is 2007!!!!

        Phil


        The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.

        F Offline
        F Offline
        Fuzzychaos
        wrote on last edited by
        #3

        Actually it is totally possible with a project right here on CodeProject!!! http://www.codeproject.com/cpp/sendkeys_cpp_Article.asp It took me this long to eventually find my functioning code, which led me back to the article. Now I just have to check that a C# version exists and if not I will convert the project myself. I am real, and I can't junk the DOS program because I work in the real world where you can't just re-write software on a whim to meet the latest craze, especially where it would be dangerous to do so (people's limbs at risk).

        Jeremy Props to the family: New Dawn Engineering

        P 1 Reply Last reply
        0
        • F Fuzzychaos

          Actually it is totally possible with a project right here on CodeProject!!! http://www.codeproject.com/cpp/sendkeys_cpp_Article.asp It took me this long to eventually find my functioning code, which led me back to the article. Now I just have to check that a C# version exists and if not I will convert the project myself. I am real, and I can't junk the DOS program because I work in the real world where you can't just re-write software on a whim to meet the latest craze, especially where it would be dangerous to do so (people's limbs at risk).

          Jeremy Props to the family: New Dawn Engineering

          P Offline
          P Offline
          Phil J Pearson
          wrote on last edited by
          #4

          I am glad you have found a solution that works in your particular case. I am real too, I make my living writing programs for the real world. DOS programs started to die ten years ago and no critical applications should rely on such programs any longer - hardware and software support is non-existent; it is a matter of chance whether they can be made to run now and there are absolutely no guarantees for the future (i.e. next week). Development of an alternative to the DOS app should have started at least five years ago. Whatever may be said against Windows there has never been a more universal, stable and consistent operating system on which to develop software for all sorts of applications. To speak of it as a "whim" and "the latest craze" is dangerously short-sighted, especially if people's limbs are at risk!

          Phil


          The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.

          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