How to develop a Service for Win95

As we can develop services for WinNT workstation. How can I develop an application that works as a service for Windows 95 Operatining system
imtiazahmadAsked:
Who is Participating?
 
jhanceConnect With a Mentor Commented:
Win95 has the ability to start a program as a "service".  Create a registry key value at:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices

The name of this key can be anything and the value of the key is a command line string (i.e. pathname to a program) that will get run when Windows boots.

Generally programs started here either hide their window (use ShowWindow(SW_HIDE) or display themselves in the system tray.

There are not services in the same context as an NT Service but you can accomplish similar things using them.  Be aware also that unlike NT, there is no restriction on who can install or remove services from this registry key.
0
 
imtiazahmadAuthor Commented:
Plese give me the code if any one know how to develop Service for WIN95
0
 
snoeglerCommented:
Because Win95 has no security levels, and no access restrictions, there is no need for services. Every app without user interaction which is launched at startup (HKLM\Software\Microsoft\Windows\CurrentVersion\Run) acts like a service
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
imtiazahmadAuthor Commented:
What I need is like a service in WIn NT is running continuously from the system start-Up I want to have an application which will start at the startup and execute in seperate thread. If U have any idea about this please let me knowledgable
0
 
MT_MUCommented:
One other comment...

Check out the function

RegisterServiceProcess (Win95/98 only)
0
 
imtiazahmadAuthor Commented:
OK lets forget about the service
I would like to know how to write an application which executes itself after some specified period of time delay
0
 
imtiazahmadAuthor Commented:
OK lets forget about the service
I would like to know how to write an application which executes itself after some specified period of time delay
0
 
snoeglerCommented:
Hmm ...
Why don't you write a small .EXE which gets loaded every startup (HKLM\Software\Microsoft\Windows\CurrentVersion\Run), which checks if the delay you want has passed - and if so, it launches your 'real' app.

You could also use the interfaces to the task planner, but it is only available on newer windows versions.

0
 
imtiazahmadAuthor Commented:
Can yiu give me asample for the which can launch itself after some delay
0
 
jhanceCommented:
Only Windows NT & 2000 have a scheduler that you can use to run at a particular time.  If you need to delay an app's startup, you can do something like:

main()
{
   // Delay before starting up
   Sleep(5000);

etc...

}

If you need a longer delay that is possible with Sleep, put it in a look and call it enough times to generate the delay you need.
0
 
imtiazahmadAuthor Commented:
I want to have this application run on Windows 95 / 98 without any scheduler
0
 
jhanceCommented:
So what in the world _DO_ you want.

This question has been completely answered.  Note:


Item 1:

>Win95 has the ability to start a
>program as a "service".  Create a
>registry key value at:

>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices

Item 2:

>RegisterServiceProcess

Item 3:


main()
{
   // Delay before starting up
   Sleep(5000);

etc...

}



What _ELSE_ do you need?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.