Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From looking at the source in forms.pas (Delphi 2009), it appears that they create a "master" window in win32 gui apps to allow calls to </p> <ul> <li>TApplication.Minimize</li> <li>TApplication.Restore</li> <li>etc</li> </ul> <p>It appears that messages passed to the <code>Application.Handle</code> are forwarded as appropriate to the <code>MainForm</code>, if it exists. This would allow the app to respond to minimize, etc if the main window has not been created. By modifying the project source you can create a delphi app <em>without</em> a main window. </p> <p>In this case, the <code>TApplication</code> methods will still work, even if you haven't created a main window. Not sure if I'm grasping all of the purposes, but I don't have time to go through all of the TApplication code. </p> <p>Per your questions:</p> <ul> <li><p><strong>Where does it come from?</strong> It is the handle of a window created in <code>TApplication.Create</code></p></li> <li><p><strong>What windows handle is it?</strong> a fake window that every gui delphi app requires as part of the TApplication abstraction</p></li> <li><p><strong>Is it the windows handle of the appliation's main form</strong> No</p></li> <li><p><strong>If its not the handle of application's mainform then what is it?</strong> See above</p></li> <li><p><strong>more importantly: why is it the ultimate parent of every form?</strong> assuming you're right that its the ultimate parent, i assume that it is so because it makes it easy to find all of forms in your application (enumerating the children of this "master" form).</p></li> <li><p><strong>and most important: why does everything go haywire if i try to have a form be unparented</strong> i think because the hidden "master" form is getting system messages that it <em>should</em> pass on to its children and/or the mainform, but can't find the unparented form.</p></li> </ul> <p>Anyway, that's my take on it. You can probably learn more by looking at the TApplication declaration and code in <code>forms.pas</code>. The bottom line from what i see is it is a convenient abstraction.</p> <p>Best regards,</p> <p>Don</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload