Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 938147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:35:41+00:00 2026-05-15T21:35:41+00:00

I have a old command line based program (its fortran if that matters) that

  • 0

I have a old command line based program (its fortran if that matters) that is opened from a C# application when a user clicks a button. If the command line program is shut down while it is running data becomes corrupted. Is there any way to prevent people shutting it down while it is running? Like make the [x] not be available or somehow embed the program into mine?

 System.Diagnostics.Process pname =
 System.Diagnostics.Process.Start(Path.Combine(Application.StartUpPath,
"diag_main.exe"));

    pname.Exited += new EventHandler(pname_Exited);

Note: I want to still be able to see the application running and it closes on its own when it is finished, I just can’t have people killing it while it is in the process of running.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:35:42+00:00Added an answer on May 15, 2026 at 9:35 pm

    A solution that will take a decent amount of programming but can be done:

    Write a separate program that intercepts the screen output of the program and sends it to your program somehow. Run this program in the hidden window, it turns around and runs the app and sends the output to your program.

    At least parts of the interceptor are almost certainly going to have to be in assembly.

    Edit: Redirecting stdout won’t do it even if the program only writes to it–he wants the output displayed.

    There are three things that might need to be intercepted:

    Int 21h filesystem writes. These are the things that could be intercepted by redirecting stdout. Beware that some programs may write to a different handle number that actually represents the stdout file–look up the handle that’s being written to in the program’s handle table and compare it to the stdout entry (IIRC the second entry)–if they match it’s actually screen output.

    The second level is IIRC int 10h. There are several sub-calls that must be intercepted.

    Finally, a program may do direct screen writes. Intercepting these would be a major pain, I wouldn’t even consider trying it (you would have to basically rewrite the dos box.) Instead, frequently compare the screen memory with a saved copy looking for changes.

    In all three cases at least parts of the routine are going to have to be written in assembly.

    I have done the first, played a bit with the second but then I found that I could get by without doing it. I’ve never attempted the third.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an old, third party, command line, proprietary program which I'm calling from
I have inherited a 20-year-old interactive command-line unix application that is no longer supported
I have a command-line process that creates a PDF file from an HTML file
I have a python script start.py that executes well from the command line. There
I have old code that uses size_t which IIRC comes from cstring.h. On OS
I was writing a command line program which will have a status bar, much
I have a C++ command line program compiled with Microsoft Visual Studio 2003, and
I have old text inside a div. I want that text to fly out
I have refereed old questions and found that people face many issues after installing
I have this old question but no answer works for me from online, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.