Board index » delphi » Stopping a project from running

Stopping a project from running

I have a question about 'killing' a running project... here's my
situation. I have a 'main menu' project that calls various other
projects. If the user exits out of the main screen, I want all other
running .exe projects to close out at that time too. Is this possible to
do? Thanks,

-Greg Blickley

 

Re:Stopping a project from running


If you started the other .exes with CreateProcess you can stop them with
ExitProcess. Another option is to send a WM_QUIT message to the other
processes.

"Greg Blickley" <sha...@ptd.net> schreef in bericht
news:392BE97E.C35DBADB@ptd.net...

Quote
> I have a question about 'killing' a running project... here's my
> situation. I have a 'main menu' project that calls various other
> projects. If the user exits out of the main screen, I want all other
> running .exe projects to close out at that time too. Is this possible to
> do? Thanks,

> -Greg Blickley

Re:Stopping a project from running


Quote
Greg Blickley <sha...@ptd.net> wrote in message 392BE97E.C35DB...@ptd.net...
> I have a question about 'killing' a running project... here's my
> situation. I have a 'main menu' project that calls various other
> projects. If the user exits out of the main screen, I want all other
> running .exe projects to close out at that time too. Is this possible to
> do? Thanks,

> -Greg Blickley

Hello Greg,

During main form closing (FormClose) you must get the handle of  the window
for each open child application by calling
"FindWindows('WindowClassName','WindowCaption')". Then you must send to each
window a shut down message: sendmessage(Windowhandle,WM_CLOSE,0,0).

Regards
Matteo Barrese

Other Threads