Computing.Net > Forums > Programming > how to run my C++ program in bakgrn

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to run my C++ program in bakgrn

Reply to Message Icon

Name: bullet__proof__monk
Date: April 18, 2005 at 15:14:58 Pacific
OS: winxp
CPU/Ram: 512 / p4
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: April 18, 2005 at 15:52:25 Pacific
Reply:

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


0

Response Number 2
Name: bullet__proof__monk
Date: April 19, 2005 at 08:33:35 Pacific
Reply:

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


0

Response Number 3
Name: StuartS
Date: April 19, 2005 at 08:51:08 Pacific
Reply:

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


0

Response Number 4
Name: tommycoolman
Date: April 19, 2005 at 09:46:28 Pacific
Reply:

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.


0

Response Number 5
Name: saddam (by lurker)
Date: April 19, 2005 at 16:56:10 Pacific
Reply:

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


0

Related Posts

See More



Response Number 6
Name: bullet__proof__monk
Date: April 20, 2005 at 06:04:16 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: how to run my C++ program in bakgrn

C programing in DOS www.computing.net/answers/programming/c-programing-in-dos/1217.html

how to compile C program in edit pl www.computing.net/answers/programming/how-to-compile-c-program-in-edit-pl/8975.html

How to find yesterday's date in C www.computing.net/answers/programming/how-to-find-yesterdays-date-in-c/4421.html