Intercepting mouse and keyboard event

I have the following prob:
In D2-D3, I am using a c++ DLL for heavy algorithmic operation
I run them in thread. No prob so far.
- problem 1:
I want my user interface beeing frozen while the TTread is
running. I want something like "If this flagThread is TRUE,
then do not react at all to mouse and keyboard events. But,
of course, allows other event, such a painting the form.
Also I want the form to be still draggable.
All these features are lost if I put MyForm.Enabled := False.
Is SetHookWindowsEx the solution ? if yes, how to use that ?
Thanks a lot
- problem 2: How to allows the c++ routines to use the
Synchronize and the FTerminated capabilities of my Delphi Threads ? Code
example is welcome...
Andre.
--
-------------------------------------------------------------
Andre Nicoulin              Prof | Private
        ELCA Informatique SA     |
        Av. de la Harpe 22-24    | ch. de Bonne Esperance 35
        CH 1000 Lausanne 13      | CH 1006 Lausanne
Voice : +41 21 613 21 11         | +41 21 728 36 50
E-mail: Andre.Nicou...@elca.ch   | Andre.Nicou...@worldcom.ch
Fax   : +41 21 613 21 00         | -
                                 |                ||||||          
Pager : 0740 95 10 49            |                (.)(.)    
-----------------------------------------------ooO-(_)-Ooo---