Code Completion needs to know, when you enter in the unit and the routine name, where to get the information from. In whatever unit you are calling Unit1.mainwindow you need to include a 'USEUNIT call.
If you do this, Code completion should work.
As for creating a runtime object, what you've done is correct for the method. But what it seems you want is to be able to access properties. For this, you need to create properties on your runtime object.
For the second option i.e. defining properties for Runtime Object it could be done But I'm not intrested in doing this way because I have to define alot of properties and maintenace of Objects and properties is difficult.
I'm intrested in doing it method for First option from your reply, I'm currently using my objectwrapper in this way but it is not working for me. See the attached snapshot and it will be great if it could be done.