Of course, if you don't have the source code for the DOS program, you can't make it multitasking! Then TSR is the way to go. You don't need to deeply understand the inner workings of TSR's. If you adapt and link your program to the two source files 'popup.c' and 'resident.c', they will turn your standard c program into a TSR.
You call your program from the popup function in the popup file.
Your program must abide by a few rules.
1. The program must be built with Borland Turbo C, I used version 3, which is a free download from Borlands site. It must use the tiny or small memory model.
2. The program must not use DOS functions 0 to 12.
3. If the program changes the curent working disc directory, it must restore the original directory before returning to the interrupted program.
4. The program should avoid the use of floating point operations.
5. The program must never terminate or exit to DOS.
I have attached an example Turbo C project.
To run the program type 'tsr'. This command will load the TSR and cause it to terminate and stay resisdent. Before terminating, the program displays the following message, "Popup has been loaded".
If you were to run it a second time, it would sense that it was already resisdent and would display, "Popup is already resident".
You can cause it to suspend, resume or terminate itself with the commands,
tsr wait
tsr restart
tsr quit
The hot keys assigned to it are ALT . (Full stop) combination. This will run the TSR.
I should imagine that your program will intercept the comms interrupt and update the clock when a message arrives. Good luck.