Solved

Catching stop message of SrvAny

Posted on 2002-06-28
4
358 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:udic
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
raidos earned 100 total points
ID: 7116082
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
 
LVL 7

Expert Comment

by:Cynna
ID: 7118870
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
 

Author Comment

by:udic
ID: 7123848
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
 

Author Comment

by:udic
ID: 7123854
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now