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?
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.