Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Creating form dinamically Posted by tijoen on 28 May 2006 at 1:52 PM
Hi, I am creating the form dinamically and I would like to change the name of the form before it is created, so I can access it by findWindow when I need...
But I am getting errors whe nI close the main form...
any ideas?

thanks
Report
Re: Creating form dinamically Posted by zibadian on 28 May 2006 at 2:33 PM
: Hi, I am creating the form dinamically and I would like to change the name of the form before it is created, so I can access it by findWindow when I need...
: But I am getting errors whe nI close the main form...
: any ideas?
:
: thanks
:
That's possible. First you need to remove the form from the "Auto-create forms" (Project Options). Then you need to edit the project source file, so that it creates the form without any owners. After that you can set the Name property to whatever you like. Finally you can insert that form into the Application by calling InsertComponent().
This however will not change the classname, since that cannot be changed during runtime. Also FindWindow() doesn't search for the Name property but for the Caption of the form.
As for the errors, those can happen when other programs are still using the window handle, after the form (and thereby its handle) has been destroyed.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.