If you don't mind creating your Forms/Controls in code, I have an idea that involves interfaces.
I've been wrapping some Lazarus controls etc inside referenced counted interfaces. Seems to work really nice, I like that Lazarus supports inherited Interfaces, and Interface helper classes. Makes wrapping TControls nice and simple.
I'm not at the computer I've been doing this, but the code say to create a Form with a Button on might looks something like ->
var
Frm:IForm;
Btn:IButton;
begin
Frm := App.Controls.NewForm;
Frm.Caption := 'The Form';
Frm.SetBounds(200,200,400,400);
Btn := App.Controls.NewButton;
Btn.SetBounds(20,20,100,50);
Btn.Caption := 'A Button';
Btn.Parent := Frm;
Frm.ShowModal;
end;
Now the advantage here, is that creating Forms/Controls this way will work between DLL's,. So creating a plugin architecture should be nice and simple.
Although TControl/TForms are not referenced counted, the helper classes are. So I've implemented a simple garbage collector also. So for example if say you had a reference to an IForm and the Form closes it won't be garbage collected, so the IForm can be shown again etc, but if an IForm closes with no references it will be garbage collected etc.