J'essaie d'utiliser QueryServiceConfig et pour cela je fais

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
size:=marshal.SizeOf(typeof(TQueryServiceConfig));
      if QueryServiceConfig(FServiceHandle,config,size,size) then
      begin
        if config.dwStartType=SERVICE_DEMAND_START then
          rdModeStart.ItemIndex:=0
        else if config.dwStartType=SERVICE_AUTO_START then
          rdModeStart.ItemIndex:=1;
      end
Mais à chaque fois QueryServiceConfig renvoie FALSE. Et config ne contient pas toutes les données et notamment le nom du service.

Comment puis-je faire?