[Lazarus] Win services

Reinier Olislagers reinierolislagers at gmail.com
Wed Dec 11 15:59:36 CET 2013


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)




More information about the Lazarus mailing list