🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to prevent CLOSE program ?

#562
From: Sonnich Jensen
Date: Thu, 27 May 1999 00:00
39 lines
1958 bytes
Not excatly what you're searching for, but I made something like that once.

I have a program start a 'child-program', where the parent can't be close
until the child returns it close message to the parent.
You can use the TApplication.OnAppMessage (correct name ???) to capture all
messages, and the FindWindow to get the handle of another window if you know
its classname and caption.

MyHandle := FindWindow(blah blah)
PostMessage( MyHandle, WM_USER+whatever, data...)

and use the AppMessage to capture these telling whether it can close or not.

Not that if yuo set the Handled paramater to True, then the message will not
be carried out.

As I don't know what specifications yuo excatly have I don't know whether
this helps you. Hopefylly it gives a hint or idea.

See http://homestead.dejanews.com/user.sonnich/files/child.zip as an
example.

God luck with it !
S.

Chow Hoi Ka, Eric wrote in message <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
>
Technical Details
Message-ID: <374d5d0a$0$5240@diablo.uninet.ee>
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: "Sonnich Jensen" <sonnich.jensen@novobcs.ee>
Subject: Re: How to prevent CLOSE program ?
Date: 1999/05/27
Message-ID: <374d5d0a$0$5240@diablo.uninet.ee>
X-Deja-AN: 482737283
References: <374D0BF9.20262D91@sftw.umac.mo>
X-Trace: 927816970 5240 (none) 194.204.47.55
Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.winapi
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4