Subj : Re: Event Loop (Override Application->Run()?) To : borland.public.cpp.borlandcpp From : Takahiro Horie Date : Wed Oct 06 2004 09:29 am I figured it out minutes after my post: Write an OnMessage() handler for TApplication. Duh! Thanks, Timothy On Tue, 05 Oct 2004 12:59:22 -0700, Takahiro Horie wrote: >Hello, > >Im writing a program that uses TWAIN, and according to their sample >source code, I need to modify the windows event loop as follows: > >while (GetMessage((LPMSG)&msg,NULL,0,0)) { > twEvent.pEvent = (TW_MEMREF)&msg; > /* ... etc; do other TWAIN-related stuff ... */ > if (NotATwainEvent) { > /* process as normal */ > TranslateMessage((LPMSG)&msg); > DispathMessage((LPMSG)&msg); > } >} > >Unfortunately, all of this is hidden in Application->Run() when I >create a VCL application. > >I searched the Borland site and found "Coding closer to the metal" >http://bdn.borland.com/article/0,1410,27822,00.html > >...But this means giving up all of the power of VCL and having to >write in essentially raw Win32. > >Is there a way to do what I'm trying to do with TWAIN without throwing >away the nice VCL TForms and whatnot? > >Thanks in advance, >Timothy > .