I have a service monitoring application that tracks the status of three other server applications - you know these green, red status elements, start, stop, etc.
The problem is that it shows an incorrect state in Windows 7, even if the user is an administrator.
The Start, Stop buttons are disabled and the setup button is turned on, the status color is gray, which is also incorrect. The Start button should be enabled with the status of the service showing green - applications are running.
If the application is launched with the option "run as administrator", then it behaves normally.
The application is written in Delphi 7 and works fine in other versions of Windows. This line of code:
OpenSCManager(PChar(sMachine), Nil, SC_MANAGER_ALL_ACCESS);
always returns 0 under Win7, causing a problem.
Any ideas and, if possible, any workarounds other than "run as administrator".
source
share