On 11/12/2013 15:47, Michael Van Canneyt wrote: > > > On Wed, 11 Dec 2013, Antonio Fortuny wrote: > >> >> Le 11/12/2013 14:38, Michael Van Canneyt a écrit : >>> >>> >>> On Wed, 11 Dec 2013, Antonio Fortuny wrote: >>>> SMgr := TServiceManager.Create(nil); >>>> try >>>> SMgr.Access := SC_MANAGER_ALL_ACCESS; >>> >>> You should set refreshonconnect:=true (or something similar). >> Ok Michael, works up to there (SMgr.Refresh works too) >> but when doing: >> h := SMgr.GetServiceHandle(SERVICE_NAME, SERVICE_ALL_ACCESS); >> I get the windows exception 1006 !!? > > I don't know what that means. > > Maybe you don't have permission to get a file handle on this service.
Regarding permissions: random guess: do you need a manifest file with proper elevation? Have you set that in project options? (Don't know if Vista actually requires this & you mentioned you were already running as admin, but who knows) -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
