Catching stop message of SrvAny

hi
I am using srvany.exe to invoke a GUI application.
 My problem is that my application uses threads and database connections, I want to close those resources when stopping the service.

What can I do to supply an orderly termination for my application?

thanks,
   udi
udicAsked:
Who is Participating?
 
raidosConnect With a Mentor Commented:
I havn't been able to find any information how to do this with SrvAny.Exe, however i found another "start application as server" program that can do it...called SrvStart it can be found here: http://www.nick.rozanski.com/software.htm

Regards
//raidos
0
 
CynnaCommented:
udic,

This might help you:

type
  TForm1 = class(TForm)
  (...)
  protected
     procedure WMEndSession(var WMsg: TWMEndSession);  message WM_ENDSESSION;
  (...)
  end;


procedure TForm1.WMEndSession(var WMsg: TWMEndSession);
begin

  // ... your cleanup code here...

  inherited;
end;
0
 
udicAuthor Commented:
hi
Cynna- i tried this before and no success.
Raidos- i take the ideas from your link (i didnt success to use SrvStart).

thanks,
udi
0
 
udicAuthor Commented:
hi
thank u as i wrote before i didnt success to use thos but i take the ideas.
now i cant catch stop process from windows task manager.

thanks again
udi
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.