<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Class Poco::Util::WinService</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="language" content="en"/> <meta name="date" content="2009-11-24"/> <meta name="generator" content="PocoDoc"/> <link rel="stylesheet" href="css/styles.css" type="text/css"/> </head> <body bgcolor="#ffffff" leftmargin="0" topmargin="0"> <div class="header"> <h1 class="namespace"><a href="Poco.Util.html" class="namespace">Poco::Util</a></h1> <h1 class="symbol">class WinService</h1> </div> <div class="body"> <p> <b>Library:</b> Util<br /> <b>Package:</b> Windows<br /> <b>Header:</b> Poco/Util/WinService.h</p> <h2>Description</h2> <div class="description"> <p>This class provides an object-oriented interface to the Windows Service Control Manager for registering, unregistering, configuring, starting and stopping services. </p> <p>This class is only available on Windows platforms. </p> </div> <h2>Member Summary</h2> <p><b>Member Functions: </b><a href="Poco.Util.WinService.html#17409" title="Poco::Util::WinService::displayName()">displayName</a>, <a href="Poco.Util.WinService.html#17423" title="Poco::Util::WinService::getStartup()">getStartup</a>, <a href="Poco.Util.WinService.html#17417" title="Poco::Util::WinService::isRegistered()">isRegistered</a>, <a href="Poco.Util.WinService.html#17418" title="Poco::Util::WinService::isRunning()">isRunning</a>, <a href="Poco.Util.WinService.html#17408" title="Poco::Util::WinService::name()">name</a>, <a href="Poco.Util.WinService.html#17410" title="Poco::Util::WinService::path()">path</a>, <a href="Poco.Util.WinService.html#17411" title="Poco::Util::WinService::registerService()">registerService</a>, <a href="Poco.Util.WinService.html#17421" title="Poco::Util::WinService::setStartup()">setStartup</a>, <a href="Poco.Util.WinService.html#17419" title="Poco::Util::WinService::start()">start</a>, <a href="Poco.Util.WinService.html#17420" title="Poco::Util::WinService::stop()">stop</a>, <a href="Poco.Util.WinService.html#17416" title="Poco::Util::WinService::unregisterService()">unregisterService</a></p> <h2>Enumerations</h2> <h3><a name="17401">Startup</a></h3> <div class="description"> <p></p> </div> <p class="decl"><a name="17402">SVC_AUTO_START</a></p> <div class="description"> <p></p> </div> <p class="decl"><a name="17403">SVC_MANUAL_START</a></p> <div class="description"> <p></p> </div> <p class="decl"><a name="17404">SVC_DISABLED</a></p> <div class="description"> <p></p> </div> <h2>Constructors</h2> <h3><a name="17405">WinService</a></h3> <p class="decl"><a href="Poco.Util.WinService.html" title="class Poco::Util::WinService">WinService</a>(<br /> const std::string & name<br />);</p> <div class="description"> <p>Creates the <a href="Poco.Util.WinService.html" title="class Poco::Util::WinService">WinService</a>, using the given service name. </p> </div> <h2>Destructor</h2> <h3><a name="17407">~WinService</a></h3> <p class="decl">~<a href="Poco.Util.WinService.html" title="class Poco::Util::WinService">WinService</a>();</p> <div class="description"> <p>Destroys the <a href="Poco.Util.WinService.html" title="class Poco::Util::WinService">WinService</a>. </p> </div> <h2>Member Functions</h2> <h3><a name="17409">displayName</a></h3> <p class="decl">std::string displayName() const;</p> <div class="description"> <p>Returns the service's display name. </p> </div> <h3><a name="17423">getStartup</a></h3> <p class="decl"><a href="Poco.Util.WinService.html#17401" title="enum Poco::Util::WinService::Startup">Startup</a> getStartup() const;</p> <div class="description"> <p>Returns the startup mode for the service. </p> </div> <h3><a name="17417">isRegistered</a></h3> <p class="decl">bool isRegistered() const;</p> <div class="description"> <p>Returns true if the service has been registered with the Service Control Manager. </p> </div> <h3><a name="17418">isRunning</a></h3> <p class="decl">bool isRunning() const;</p> <div class="description"> <p>Returns true if the service is currently running. </p> </div> <h3><a name="17408">name</a></h3> <p class="decl">const std::string & name() const;</p> <div class="description"> <p>Returns the service name. </p> </div> <h3><a name="17410">path</a></h3> <p class="decl">std::string path() const;</p> <div class="description"> <p>Returns the path to the service executable. </p> <p>Throws a <a href="Poco.NotFoundException.html" title="class Poco::NotFoundException">NotFoundException</a> if the service has not been registered. </p> </div> <h3><a name="17411">registerService</a></h3> <p class="decl">void registerService(<br /> const std::string & path,<br /> const std::string & displayName<br />);</p> <div class="description"> <p>Creates a Windows service with the executable specified by path and the given displayName. </p> <p>Throws a <a href="Poco.ExistsException.html" title="class Poco::ExistsException">ExistsException</a> if the service has already been registered. </p> </div> <h3><a name="17414">registerService</a></h3> <p class="decl">void registerService(<br /> const std::string & path<br />);</p> <div class="description"> <p>Creates a Windows service with the executable specified by path and the given displayName. The service name is used as display name. </p> <p>Throws a <a href="Poco.ExistsException.html" title="class Poco::ExistsException">ExistsException</a> if the service has already been registered. </p> </div> <h3><a name="17421">setStartup</a></h3> <p class="decl">void setStartup(<br /> <a href="Poco.Util.WinService.html#17401" title="enum Poco::Util::WinService::Startup">Startup</a> startup<br />);</p> <div class="description"> <p>Sets the startup mode for the service. </p> </div> <h3><a name="17419">start</a></h3> <p class="decl">void start();</p> <div class="description"> <p>Starts the service. Does nothing if the service is already running. </p> <p>Throws a <a href="Poco.NotFoundException.html" title="class Poco::NotFoundException">NotFoundException</a> if the service has not been registered. </p> </div> <h3><a name="17420">stop</a></h3> <p class="decl">void stop();</p> <div class="description"> <p>Stops the service. Does nothing if the service is not running. </p> <p>Throws a <a href="Poco.NotFoundException.html" title="class Poco::NotFoundException">NotFoundException</a> if the service has not been registered. </p> </div> <h3><a name="17416">unregisterService</a></h3> <p class="decl">void unregisterService();</p> <div class="description"> <p>Deletes the Windows service. </p> <p>Throws a <a href="Poco.NotFoundException.html" title="class Poco::NotFoundException">NotFoundException</a> if the service has not been registered. </p> </div> <h2>Variables</h2> <h3><a name="17424">STARTUP_TIMEOUT</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">static const int <a href="Poco.Util.WinService.html#17424" title="Poco::Util::WinService::STARTUP_TIMEOUT">STARTUP_TIMEOUT</a>;</p> <div class="description"> <p></p> </div> <p class="footer">POCO C++ Libraries 1.3.6-all<br /> Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p> </div> </body> </html>