List service and services status under Win-7
- by Ronaldo Junior
I have a service monitor app that monitors the status of three other servers app - you know those kind of green, red status stuff, start, stop, etc.
The problem is that it shows the wrong state in Windows 7 even if the user is the administrator.
The start, stop buttons are disabled and the install button enabled, the status color is grey which is also wrong. The start button should be enabled with the service status showing green - the apps are running.
If the application is run with the setting "run as administrator" then it behaves normally.
The application is written in Delphi 7 and works perfectly in other versions of Windows.
This line of code:
OpenSCManager(PChar(sMachine),Nil,SC_MANAGER_ALL_ACCESS) always return 0 under Win7, causing the problem.
Any ideas and if possible, any workaround apart from "run as administrator".
Regards
Ronaldo