Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Daemon-type programs

Status
Not open for further replies.

StukA

Programmer
Apr 11, 2001
115
US
How would I go about writing a "daemon" type program (no window, runs in the background) for Win95/98...I know that NT/2k has services, but I'd like to be able to do this in 98....where do I start?
 
Maybe there autoexec.bat will help? In Win95 it worked. John Fill
1c.bmp


ivfmd@mail.md
 
Running it isn't the problem. What I need to know is how to create a program that either doesn't create a window at all, or closes it's window after it is running succesfully.
 
This program will exit the loop 'while' when is called PostQuitMessage(0) in any places in the your program:

#include<windows.h>
xxx f(x){DoSomeThing;PostQuitMessage(0);}
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
MSG msg;
while(GetMessage(&msg,0,0,0))DispatchMessage(&msg);
return 0;
}
is not a pproblem the following:
#include<windows.h>
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
return 0;
}//a perfectly legal program what make nothing
John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top