Board index » Visual Studio » starting/ stopping a windows service
|
SammyJJones
|
|
SammyJJones
|
starting/ stopping a windows service
Visual Studio158
Hi, Does somebody know how to start / stop and get a status of a 'windows service' using MFC (or win32 api)? Regards, Ram. - |
| Jerry
Registered User |
Thu Jun 03 08:55:33 CDT 2004
Re:starting/ stopping a windows service
In article <eiUJzyWSEHA.2236@TK2MSFTNGP09.phx.gbl>,
ram_ba_ruch@newsgroups.nospam says... QuoteHi, want to look at ControlService. -- Later, Jerry. The universe is a figment of its own imagination. - |
| suhredayan
Registered User |
Thu Jun 03 09:18:09 CDT 2004
Re:starting/ stopping a windows serviceint StartService(LPSTR sService) { SC_HANDLE hSCM = OpenSCManager( "", SERVICES_ACTIVE_DATABASE, SC_MANAGER_ALL_ACCESS ); if( !hSCM ) { CloseServiceHandle(hSCM); return 0; } SC_HANDLE hService = OpenService( hSCM, sService, SERVICE_ALL_ACCESS ); if( hService ) { BOOL b = ::StartService( hService, 0, NULL ); } CloseServiceHandle(hService); CloseServiceHandle(hSCM); return 1; } -- Best Regards Suhredayan Omniquad Ltd www.omniquad.com">www.omniquad.com "Ram Baruch" <ram_ba_ruch@newsgroups.nospam>wrote in message QuoteHi, - |
| Ram
Registered User |
Thu Jun 03 12:04:21 CDT 2004
Re:starting/ stopping a windows service
thanks!
"suhredayan" <suhredayan@omniquad.com>wrote in message Quote
- |
