Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all ,
i was wondering if anyone can help me in how
to make my C++ program run in background
on windows ...
anyhelp will be taken thankfully ...
thanks alot ...
bpm

Just minimise the Window and it's running in the background.
If you want to reduce the application so all it shows is an Icon in the notification area, thats the right hand of the task bar, then you need to look at the Shell_NotifyIcon API
Stuart

Hi ...
thanks for replying me ...
but you didn't help ..
can u explain more ...
i want my program to run without the user notice ... for example
main()
{
while(8)
{}
}i want this program to run , and dosn't show anything , when double clicked on it ... not even the black DOS screen ..
thank you ..
bpm

Mentioning a Black DOS screen I assume you are running a DOS application, not a Windows application.
In that case the only way to do it is to configure a pif file so it runs minimised. It will still show up on the task bar but with a DOS application there is no way of preventing that.
Stuart

Are you using MS Visual Studio?
You could just create a simple Win32 application.
......
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
while(1)
{
Sleep(1000);
}return 0;
}......
When the program is executed, no window pops up. And the only way to kill it is to use Task Manager.

Perhaps you may want to register it as a service in Win NT/2000. By doing so you cannot simply use the task manager because it will be a system process. There is NO method of making it run totally invisible but you can create a dll and get one of the processes Ex. explorer.exe or winlogon.exe to load it. That is about as far as you can get.
saddam

thanks you all
tommycoolman ,
thanks man , after doing some reasearch's , its true , what you said is what i need, what shall i learn to program in win32 app. all what i know is the basics of C++ (the normal DOS programs) ... and from what you typed above(the code) i understanded nothing of it ...
please guide me , in what shall i do ...
in order to make my program work .thanks you all
bpm

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |