Board index » cppbuilder » Preventing TWinControl releasing resources when hidden

Preventing TWinControl releasing resources when hidden


2005-11-07 09:11:35 PM
cppbuilder37
It seems that the TWinControl releases allocated window resources some time
after the window has been hidden (minimized, screen saver, etc).
Is there a way to prevent the TWinControl from releasing the resources - if
not from within VCL then maybe by trapping the one of the related WM
messages.
We are using embedded Java controls (using JBuilder) on some Forms, that
does not survive the "missing" resources and handles.
Thanks in advance,
Bent Christensen
 
 

Re:Preventing TWinControl releasing resources when hidden

"Bent Christensen" < XXXX@XXXXX.COM >wrote in message
Quote
Is there a way to prevent the TWinControl from releasing the resources
No.
Quote
We are using embedded Java controls (using JBuilder) on some Forms,
that does not survive the "missing" resources and handles.
You will have to detach the Java controls when the resources are being
freed, and then reattach them when new resources are allocated. How you do
that, though, depeds on how exactly you are using the Java controls in the
first place.
Gambit
 

Re:Preventing TWinControl releasing resources when hidden

Hello Gambit
That was also my analysis. My problem is to grab the resource destruction
event before the actual release of the window handle. Unforunately the
DestroyHandle method is not virtual so overriding this method is
unfortunately not an option.
As to your question about implementation: The Java native window handle is
assigned as a child window to a TWinControl. Thus the window fills the
client area of the control. This implementation is using the jni/awt
libraries.
Any ideas?
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Bent Christensen" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>Is there a way to prevent the TWinControl from releasing the resources

No.

>We are using embedded Java controls (using JBuilder) on some Forms,
>that does not survive the "missing" resources and handles.

You will have to detach the Java controls when the resources are being
freed, and then reattach them when new resources are allocated. How you
do that, though, depeds on how exactly you are using the Java controls in
the first place.


Gambit

 

{smallsort}