Hello all,
My ServiceControl package has long been able to create and delete services,
but I didn't have much luck getting it to make in-place changes to existing
services. Note that you can fry your machine with this stuff, so please
don't try it if you don't know what you are doing. Otherwise, install the
package from my D5 goodies, and file in the code below.
Have a good one,
Bill
!ServiceController methodsFor!
disableService
"Disable the receiver's service. Messenger is a good one to try;
otherwise, be
careful!!"
| prerequisteServiceNames |
self assert:[
AdvApiLibrary default
changeService:self handle
dwServiceType:SERVICE_NO_CHANGE
dwStartType:SERVICE_DISABLED
dwErrorControl:SERVICE_NO_CHANGE
lpBinaryPathName:nil
lpLoadOrderGroup:nil
lpdwTagId:nil
lpDependencies:prerequisteServiceNames
lpServiceStartName:nil
lpPassword:nil
lpDisplayName:nil.
].
! !
!ServiceController categoriesFor: #disableService!public! !
!ServiceControlManager class methodsFor!
disableService:displayName
"Disable the named service. Be careful!!"
"
ServiceControlManager disableService:'Messenger'.
"
( ServiceControlManager new openServiceName:displayName ) disableService.
! !
!ServiceControlManager class categoriesFor: #disableService:!public! !
--
Wilhelm K. Schwab, Ph.D.
[hidden email]