Link to home
Start Free TrialLog in
Avatar of frangers99
frangers99

asked on

NT Service Continued....

I posted a question recently that was answered pretty quickly...

--- from previous question ---

https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20145483

I had written a small monitoring program for Windows 98 and have started to convert it into a service
for NT.

So far it looks good, i've used a template from http://www.jgsoftware.com/nt.htm -> the vpcsrvce.zip and the service installs, accesses
all my modules and functions from the form and everything is great...until... i use the FindWindow command.

--- end from previous question ---

I am still working on this application, i've come accross two problems.

(1) The GetUserName function returns 'SYSTEM' always, because my service is started from the system account. Is there a way to retrieve the logged on user name?

(2) Everynow and then when logged in with a standard user account (not the account i installed the service from) i get a message box popping up saying 'The operation completed successfully' with the title 'GetLastError'. I know this is coming from the standard uService.pas routines but i'm not sure where from.... so how can i get rid of these popups?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Epsylon
Epsylon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of frangers99
frangers99

ASKER

i tried the get user name function.... havent thoroughly tested it yet, but seems to work fine. I still can't track down that GetLastError msg.

One other problem... how do you make an attempt to close the main form the same as trying to close the process (ie like every other delphi application!)
Avatar of Russell Libby
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Epsylon's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer