Solved

How to develop a Service for Win95

Posted on 2000-03-29
12
193 Views
Last Modified: 2013-11-20
As we can develop services for WinNT workstation. How can I develop an application that works as a service for Windows 95 Operatining system
0
Comment
Question by:imtiazahmad
  • 6
  • 3
  • 2
  • +1
12 Comments
 

Author Comment

by:imtiazahmad
ID: 2668113
Plese give me the code if any one know how to develop Service for WIN95
0
 
LVL 6

Expert Comment

by:snoegler
ID: 2668733
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
 

Author Comment

by:imtiazahmad
ID: 2669468
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
 
LVL 32

Accepted Solution

by:
jhance earned 25 total points
ID: 2669620
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
 
LVL 1

Expert Comment

by:MT_MU
ID: 2670544
One other comment...

Check out the function

RegisterServiceProcess (Win95/98 only)
0
 

Author Comment

by:imtiazahmad
ID: 2673329
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:imtiazahmad
ID: 2673423
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
 
LVL 6

Expert Comment

by:snoegler
ID: 2673540
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
 

Author Comment

by:imtiazahmad
ID: 2678903
Can yiu give me asample for the which can launch itself after some delay
0
 
LVL 32

Expert Comment

by:jhance
ID: 2679532
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
 

Author Comment

by:imtiazahmad
ID: 2684171
I want to have this application run on Windows 95 / 98 without any scheduler
0
 
LVL 32

Expert Comment

by:jhance
ID: 2684239
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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now