This blog has moved. Please update your bookmarks.

Taking A Stroll Down VCL Lane

With Delphi, Borland decided to include the source code to the Visual Component Library framework. This was a stroke of genius, because every once in a while, I find myself strolling down VCL lane and browsing through the source. Whenever I do that, I learn an immense amount of how Delphi works, and how the VCL wraps around the messy Win32 API; and I always find tiny little caveats and things I hadn't noticed before.

For instance, I had no idea that there was a TApplication.ShowMainForm property. This property decides whether or not to show the main window at application startup. Previously, I have used quite elaborate methods to avoid this; including using OnFormCreate to set the coordinates of the window to negative values, and hiding it immediately after OnFormShow and stuff.

This property takes all of this away, and I would never have found it if I hadn't - just in passing - glanced over the TApplication object and how it works.

I realize that somewhere out there, there are a bunch of really good Win32 programmers who wrote this. I envy them. In my dreams, I'd like to be one of them.


0 Comments:

Post a Comment

<< Home

 

Blog contents copyright © 2005 Mats Gefvert. All rights reserved.