I am making this program which checks if your floppy drive is ready or not. And so it has to check for say 20 seconds. And for this I want the program to run in the background. How do I do this?

I am using Borland C++ and Turbo C++

Recommended Answers

All 10 Replies

What operating system?

For rep happy the morons who can't tell the difference, I'm asking if the OP is using Windows or DOS. The answer to the question changes drastically between those two systems, and Borland has written C++ compilers for them both. :icon_rolleyes: ;)

commented: Are you really that stupid? +0

I want it to be a DOS based program. I have borland C++ the windows based.

But is it possible to run a C++ program in the background????

I want it to be a DOS based program. I have borland C++ the windows based.

The question is whether or not DOS is your operating system. Don't confuse a console application in Windows with being "DOS". Which, given your reply, is a likely assumption.

On what OS do you intend to run the target executable?

got it... Windows XP

You would have to write a TSR (terminate-and-stay-resident), and I'm not sure that cmd.exe supports that like it did with MS-DOS Version 6.X and earlier.

I thought you might use one of the win32 hooks, but probably not from what I read.

Possibly a device driver or a windows service program

You have to write it as a window service.

im pretty sure that it isnt exactly the right way to do it, or the best way, but i know an easy way to run a c++ program in the background.

Make it a win32 application instead of console but do not draw a window.

I know it works, ive done it before.

again, i know its not a good way to do it, but it will work.

thanks for the help..

But, I can't see the code.....

commented: code becomes invisible after a year -6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.