You are here:

C++/background

Advertisement


Question
I've written an extremely small C++ program in Borland 4.5 that I want to run constantly on my computer. The .exe comes up in a DOS window, and I was wondering if there's a bit of code I could add to make the thing run in the background (on a Windows XP machine) so that I don't have to look at it all the time. Thanks.

Answer
Hello,

I think I have the answer you're looking for. Call the function ShowWindow() as follows in your program somewhere:

ShowWindow(hWnd, SW_HIDE);

If you don't have a handle to a window, use NULL in place of hWnd. It hides the window from sight.

I hope this information was helpful.

-Eddie

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Eddie

Expertise

I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by ExpertRating.com. I also know a good deal about graphics via OpenGL, and GUIs.

Experience

I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2016 About.com. All rights reserved.