The short version -
I have an OpenGL Window which is created using WinApi calls. I would prefer to keep it this way, instead of wrapping OpenGL into a VCL Form.
To provide some preference menus and file dialogs, I resorted to using VCL forms, and the typical dialogs (TOpenDialog, TSaveDialog).
What I'm wondering is - how do I get these Forms and Dialogs to see my OpenGL Window as their owner?
I have attempted to pass my window handle over to the forms, but I feel certain that I'm doing this improperly, as it has no effect.
Form1 := TForm1.Create(nil);
Form1.ParentWindow := hwnd; //handle to OpenGL Window
What is it that a VCL form requires in order to see a native window as it's owner?
The Long Version -
My application has two modes. Standalone mode, where it runs by itself. Secondarily, there's a Plugin Mode that runs in the process space of a host application.
When in standalone mode, I have no issues with the VCL forms and Dialogs. Even though their ownership is uncertain, it doesn't affect usability in any way.
When in plugin mode, I am finding that the host application will take control of my VCL Forms, and the Open&Save Dialogs.
So, when running in a host's process space, my VCL Forms are rendered very strangely. I've attempted to repair them manually, but they will not respond to style changes.
Edit - Details on Dialogs
My main concern is the rendering of the VCL Forms, but here are some more details on the Dialogs, if it's of any use.
I'm executing dialogs like this:
if FileOpenDialog.Execute(hwnd) then
Begin
//open up file
End;
And it has no effect. The dialog will act the same as though I had not passed a handle to it. Bear in mind that I am using Delphi 2006, and this version of Delphi is still utilizing the old file dialogs, which were introduced in Windows XP.
Finally - when running as a Plugin, my Open/Save dialogs will appear as though they belong to the host application on the taskbar. So, the host has a taskbar Tab. My application also has it's own Tab. My Open Dialog appears attached to the Host's Tab, when I execute it.
Images
Preference Menu In Standalone Mode:
Preference Menu as Plugin in Host:
If I could simply change the color of the black text, that would be good enough, but I can't seem to do it.