Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
programming4us
Windows 7

Advanced Windows 7 Programming : Working in the Background - DEVELOPING TRIGGER-START SERVICES (part 2)

3/8/2014 8:19:35 PM

3. Configuring the TriggerStartService Example

The TriggerStartService example begins with a Windows service, so you'll select the Windows Service template in the Windows folder of your favorite language, as shown in Figure 1. Of course, the Windows Service template is only the starting point.


Now that you have a Windows Service project to use, you can begin configuring it. The following steps will get you started:

  1. Right-click the Service1.CS entry in Solution Explorer and choose Rename from the Context menu. Change the filename to TriggerStartService.CS. The filename change is necessary to ensure you don't end up with a service named Service1 installed on the system.

  2. Right-click the project entry in Solution Explorer and choose Add => Existing Item from the Context menu. You'll see an Add Existing Item dialog box.

    Figure 2. Add the ServiceNative.CS file to your application.
  3. Locate the ServiceNative.CS file on your hard drive, as shown in Figure 2. Adding this file provides P/Invoke support for the trigger-start features found in AdvAPI32.DLL.

  4. Right-click anywhere in the Design View window and choose Add Installer from the Context menu. The installer makes it possible to install the service on Windows later. You'll see several new files added to the project. Finally, you'll see a ProjectInstaller Design View window open.

  5. Right-click the ProjectInstaller.CS file entry in Solution Explorer and choose Rename from the Context menu. Rename the installer to TriggerStartServiceInstaller.CS.

  6. Select serviceInstaller1 in the Design View window.

  7. Change the (Name) property to TriggerStartServiceInstall, as shown in Figure 3.

    Figure 3. Set the service installer name and the installed name of the service.
  8. Change the ServiceName property to TriggerStartService, as shown in Figure 3.

  9. Select the serviceProcessInstaller1 entry in the Design View window.

  10. Change the Account property to LocalSystem.

Other -----------------
- Advanced Windows 7 Programming : Working in the Background - ADVANTAGES OF WORKING IN THE BACKGROUND
- Microsoft Visio 2010 : Importing Graphics (part 6) - Importing AutoCAD Drawings - Manipulating an Imported AutoCAD Drawing and Adding Furniture
- Microsoft Visio 2010 : Importing Graphics (part 5) - Importing AutoCAD Drawings - Inserting an AutoCAD File
- Microsoft Visio 2010 : Importing Graphics (part 4) - Adding Excel Charts to Your Diagrams, Importing Vector Graphics
- Microsoft Visio 2010 : Importing Graphics (part 3) - Adding Clip Art to Your Diagrams
- Microsoft Visio 2010 : Importing Graphics (part 2) - Using Images as Shapes in Visio - Handling Bitmaps and Jaggies
- Microsoft Visio 2010 : Importing Graphics (part 1) - Using Images as Shapes in Visio - Working with Images
- Microsoft Visio 2010 : Using Special Shape Features (part 2) - Control Handles , Hyperlinks, Action Tags
- Microsoft Visio 2010 : Using Special Shape Features (part 1) - Right-Click Actions,Shape Data Fields
- Microsoft Visio 2010 : Working with Text (part 3) - Text Resizing Behavior
 
 
Top 10 video Game
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
programming4us programming4us
PS4 game trailer XBox One game trailer
WiiU game trailer 3ds game trailer
Trailer game
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer