Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / August 2006

Tip: Looking for answers? Try searching our database.

how to turn on SSDP and Universal Plug And play Windows services programmatically?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lonewolf - 12 Aug 2006 19:03 GMT
Hi,
    could someone please enlighten me on how I could turn on the above
mentioned two windows services programmatically? Reason is i am writing
a program which needs to turn on these two services in order to access
the UPnP router to turn on port forwarding programmatically, and turn it
off after that. Can someone please enlighten me on the functions or
Win32 API to call to achieve it ? thank you so much for enlightening me
on this.
William DePalo [MVP VC++] - 13 Aug 2006 01:14 GMT
> could someone please enlighten me on how I could turn on the above
> mentioned two windows services programmatically? Reason is i am writing a
> program which needs to turn on these two services in order to access the
> UPnP router to turn on port forwarding programmatically, and turn it off
> after that. Can someone please enlighten me on the functions or Win32 API
> to call to achieve it ? thank you so much for enlightening me on this.

There are more than a few calls you need to use in a proper solution.

   // Once

   OpenSCManager();

       // Repeat for each service

       OpenService();
       StartService();
       CloseServiceHandle();

   // Once

   CloseServiceHandle();

Note that you will generally need to run in the context of an account with
administrative privileges.

Regards,
Will

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.