Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

event loop

0 views
Skip to first unread message

JOLA

unread,
May 12, 2003, 5:48:53 AM5/12/03
to
Hello!
I need to modify the event loop so that all the messages would be first send
to
"source" software
(which is software controlling scanner, delivered by
device developer )
to ensure that the "source" receives its messages.
If source doesn't process given message, it returns it to application to be
dispatched.

Question: would it be enough to place TApplicationEvents object in my app
and how to use it?
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 (but where? - I need it only when the source is
enabled, which happens not so often)?

Help please!
WETA

Remy Lebeau (TeamB)

unread,
May 12, 2003, 12:13:38 PM5/12/03
to

"JOLA" <we...@gazeta.pl> wrote in message
news:3ebf...@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

WETA

unread,
May 14, 2003, 9:57:04 AM5/14/03
to
Thank you!

but I guess I still don't catch the idea.
I must try a little more to make it work :)

Użytkownik "Remy Lebeau (TeamB)" <gamb...@yahoo.com> napisał w wiadomości
news:3ebfc985$3...@newsgroups.borland.com...

0 new messages