|
Windows Programming is what Delphi is about, and to use it efficiently, you must know a little bit of Windows' "Base System Architechture". Flip through and absorb - You'll find Windows Programming a pretty interesting topic... What is Windows? Going back into history, you could say that Windows was just simply the result of envious PC owners who wished that their computer would be 'easier to use'. When Apple Computer released the Macintosh, (which some still hail as the greatest invention of all time) developers started working on a similar operating system for the PC. Through some marketing and lots of tension, Windows became the forerunner of the whole lot. Today, Windows has become a sort of standard for all PCs. Almost all new computers are pre-installed with Windows, and almost all Windows programs today are comparable, or even better, than their DOS counterparts. How about that for a success story? How do you program in Windows? Now that you know more about the history of Windows, we shall now talk about how Windows programming works. This chapter will make it easier for you to understand Delphi. (You are getting confused, right? Right?) You'll find out that Windows programming isn't that difficult - after you understand it of course. First thing about Windows - it is a multi-tasking environment. That means that it can actually run more than one program at one time, giving you higher efficiency. This gave the creators of Windows a great headache. How do you implement an operating system where multiple programs can run at the same time? You'll need to process code for each program simultaneously, which is no easy feat. So, the makers of Windows created a system where each program was like a procedure - code was run only when the system requested for it. This meant that they needed to create a whole new system for Windows, containing the API (Application Program Interface). Code was in the form of 'events'. Only when an event occurs will code be run. Now you know why Delphi makes you type code that way! But that's not all. Remember I told about something called the API? The API is actually just a whole lot of commands built into Windows to do what programmers need for Windows Programming. You may not know it, but Delphi gives you access to the API too! But don't worry if you look up the API to find millions of commands - Most are them are not used very often. Another thing. Have you ever wondered how come people like to start type definitions with the letter 'T'? Well, we call this Hungarian Notation and it's just a naming method to help programmers identify the data type of a variable quickly. We mention this because some of you may be getting the misconception that the 'T' is compulsary, while in actual fact the naming method comes from tradition. How Delphi implements Windows As you've already seen, Delphi implements Windows very closely to how Windows programming is supposed to work. Code is attached to events. API calls are allowed. This flexibility allows for an efficient Windows programming environment. But of course, all this code is nothing if there isn't anything to attach it to - So go on to the next course, where you'll learn how touse the Visual Component Library (VCL), the building blocks of a Delphi program. |
|