Article View: borland.public.cppbuilder.nativeapi
Article #16527Re: event loop
From: Remy Lebeau (TeamB)
Date: Mon, 12 May 2003 16:13
Date: Mon, 12 May 2003 16:13
28 lines
1862 bytes
1862 bytes
"JOLA" <weta@gazeta.pl> wrote in message
news:3ebf6e6e@newsgroups.borland.com...
> Question: would it be enough to place TApplicationEvents
> object in my app and how to use it?
Just assign an event handler to its OnMessage event, and set the Handled
parameter appropriately.
However, do keep in mind that OnMessage will only be triggered for messages
placed in the message queue, such as via PostMessage(). Not for messages
sent to a particular window directly via SendMessage(). Do you need to
intercept though as well? If so, then you'll mst likely need to use a
message hook via SetWindowsHookEx() instead.
> Or maybe it's better to put
> while (GetMessage())
> {
> send_message_to_source()
> and dispatch_it() //if it was returned by source
> }
> loop somewhere in the app
That is what the TApplication::OnMessage event already allows you to do.
Gambit
Technical Details
Message-ID:
<3ebfc985$3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3ebf6e6e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,f0a2759c1f722c56 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-12 09:21:58 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ebf6e6e@newsgroups.borland.com> Subject: Re: event loop Date: Mon, 12 May 2003 09:13:38 -0700 Lines: 30 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3ebfc985$3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1052756357 207.175.226.26 (12 May 2003 09:19:17 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail