🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #561

Re: How to prevent CLOSE program ?

#561
From: Matthias Thiel
Date: Thu, 27 May 1999 00:00
27 lines
1545 bytes
Chow Hoi Ka, Eric schrieb in Nachricht <374D0BF9.20262D91@sftw.umac.mo>...
>Hello,
>
>Is it possible to prevent close other program ?
>
>Such as that, my program A will be started in background, and is
>listening for some events. And the main function is to prevent closing
>the program B.
>
>How to do this ?
>
>Best regards,
>Eric
>

Hmm...
The easiest way would be to modify program B not to be closed.
For this you can use the OnCloseQuery event. (Just set CanClose to false).

To make program A able to prevent program B from closing would mean to
capture all close messages addressed to program B. This can be done by a
windows hook but I ave no experiences in it.
If you just want to restart program B if it is terminated a search with
GetNextWindow or FindWindow could be a way...

Hth,
Matthias.
Technical Details
Message-ID: <7ijhro$n30$1@unlisys.unlisys.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <374D0BF9.20262D91@sftw.umac.mo>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1091e5,929a2d8bb17d4a83
X-Google-Attributes: gid1091e5,public
X-Google-Thread: fd817,929a2d8bb17d4a83
X-Google-Attributes: gidfd817,public
X-Google-Thread: 10baee,929a2d8bb17d4a83
X-Google-Attributes: gid10baee,public
From: "Matthias Thiel" <matthias_thiel@sj.com>
Subject: Re: How to prevent CLOSE program ?
Date: 1999/05/27
Message-ID: <7ijhro$n30$1@unlisys.unlisys.net>
X-Deja-AN: 482712509
References: <374D0BF9.20262D91@sftw.umac.mo>
Organization: [Posted via] Interactive Networx
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.winapi