Re:Hiding Taskbar buttons
In article <8f1gke$7...@bornews.borland.com>,
Quote
d.p...@cableinet.co.not-this-bit.uk (Deborah Pate) wrote:
> This happens because DLL forms are unparented.
> You can fix it by passing in a parent form's handle
> - which can be the application's handle - to the DLL
> routine and using the CreateParented method:
I tried doing as you said, using the CreateParented call in the dll, and
it doesn't work - no viewer window is shown. When I open a viewer from my
main program I call the viewers show method which does the following:
FViewer := TViewer.CreateParented(ParentWindow);
FViewer.OnClosingForm := FormClosing;
FViewer.Show;
I tried changing the exe method to pass in my MainWindow handle instead of
the Application handle and it made no difference.
One thing that may be worth pointing out is that these forms are not
hosted inside another window, they can be moved over the whole screen area
in a similar manner to the edit window(s) in delphi. The help for
CreateParented does imply that you only use it if your window is hosted in
a non vcl window.
If I set the window as a ToolWindow, the problem is solved, but the users
don't like the small caption.
Later:
I managed to get it working by overriding CreateParams for the form and
removing WS_CHILD. Because my forms are freely movable and not hosted in
another container I needed overlapping windows not child windows. A
normal delphi form fits this bill but using CreateParented adds the
WS_CHILD flag to the windows style. (Only took me two days to find that
:-) )
Regards
Keith.