🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.components.writing
Article #20

Re: How can I grab a message in a form?

#20
From: John Scalco
Date: Wed, 08 Mar 2000 00:00
72 lines
3292 bytes
- Bill,
Based on your declarations here, it looks like you have declared the
procedure at the unit level - not in the form class. The procedure needs to
be declared in the form class, otherwise the message won't be sent there.

I ran the code you have and it works.

hope this helps.

sincerely,
John Scalco
Software Developer/Consultant



Bill Artemik <bill@droste1.com> wrote in message
news:38aa7fb5.507930956@news3.newscene.com...
> I am writing a component that needs to respond to the form's
> OnActivate event.
>
> I have created a procedure:
>
> procedure WMActivate(var Message: TWMActivate);
> begin
>    if not (csDesigning in ComponentState) then
>        Case Message.Active of
>            WA_Active:      MyProcedure1;  {Form is being activated}
>            WA_Inactive:    MyProcedure2;  {Form is deactivating}
>        end;          { case }
> end;
>
> The interface is defined as:
>
> procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE;
>
> I stole this from the Forms.pas file figuring I could use it to grab
> the Windows message call (WA_Active) but I don't seem to get any
> response at run time.
>
> Any help?
>
>
>
>
> -----
> Bill Artemik
> Software Engineer
> Droste Consultants, Inc.
> bill@droste1.com
>
> -------------------------
>
> Attn: Spammers -> don't send to the following addresses:
> first.lady@whitehouse.gov consumerline@ftc.gov crc@ftc.gov fraud@uspis.gov
uce@ftc.gov rhunt@fcc.gov jquello@fcc.gov sness@fcc.gov rchong@fcc.gov
customer@usps.gov
> postmaster@agis.net abuse@agis.net root@agis.net dns-admin@agis.net
noc@agis.net
> hostmaster@agis.net phil@agis.net webmaster@agis.net document@agis.net
ip-request@agis.net routing@agis.net news@agis.net  accounting@agis.net
info@agis.net aapp@agis.net hr@agis.net
> emailer@qlink2info.com  simrem@answerme.com hostmaster@inreach.com
ap@inreach.com
> postmaster@emaildirect.net  abuse@emaildirect.net root@emaildirect.net
> postmaster@e-bizness.com abuse@e-bizness.com  root@e-bizness.com
comics@iaw.on.ca
> maxemail@united-cbe.org domreg@emaildirect.net domreg@hosting.netcom.com
> sales@marketingmasters.com  bizpro@softcom.net getpaid4@technosurf.com
> domreg@hosting.netcom.com aral@additionalbenefits.com lsims@ne.infi.net
> ltclinad@ne.infi.net ltperdir@ne.infi.net abuse@alladvantage.com
abuse@hotmail.com
>
Technical Details
Message-ID: <8a6cim$6fj$1@ussunp7.glaxo.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <38aa7fb5.507930956@news3.newscene.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fe2ce,55b8a71fae972e8a
X-Google-Attributes: gidfe2ce,public
X-Google-Thread: 112b07,55b8a71fae972e8a
X-Google-Attributes: gid112b07,public
From: "John Scalco" <jxs53831@glaxowellcome.com>
Subject: Re: How can I grab a message in a form?
Date: 2000/03/08
Message-ID: <8a6cim$6fj$1@ussunp7.glaxo.com>
X-Deja-AN: 594854931
References: <38aa7fb5.507930956@news3.newscene.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Complaints-To: usenet@ussunp7.glaxo.com
X-Trace: ussunp7.glaxo.com 952546710 6643 152.51.165.79 (8 Mar 2000 20:18:30 GMT)
Organization: Glaxo Wellcome
X-MSMail-Priority: Normal
Reply-To: "John Scalco" <jxs53831@GlaxoWellcome.com>
NNTP-Posting-Date: 8 Mar 2000 20:18:30 GMT
Newsgroups: comp.lang.pascal.delphi.components.writing,borland.public.delphi.vcl.components.writing