Talking about Windows SDK - Write to beginners
Foreword
If you are a programming beginner, if you have just ended the C language course. You may be a bit disappointed and doubt: Is this C language? Can you reproduce software? Unable to imagine how a normal window on the Windows desktop appears in front of you. From the C language machine job to Windows programming does have a relatively large GAP. Maybe you have seen the top three chapters of Programming Windows, but for that hellowin program is very fascinating. I hope that this article of Hfire will help you fill this GAP and provide some experience in learning. Why is it talks about it, because Hfire knows is not deep enough, there will be errors, please criticize the correct.
Program and runtime environment and operating system
When you write a C program with Turbo C, then compile it to get an executable. Type the file name of this EXE file at the command prompt of the DOS, then it is executed. The surface is what it is. As an application, we don't have to consider things behind, but there is a simple fact that we must know clearly: the program is not just running by himself, it needs the cooperation of the runtime environment. Consider displaying a string of a string with a printf function. Obviously this function is not written by you. Maybe you have heard of C-Runtime Library, C running time library, yes, your program only rely on it to run. The Printf code is in the C operation time library, so you can easily call it, regardless of how it is implemented. However, C is also called some other functions, which are provided by the operating system, called an interrupt service, and the operating system's interrupt service program will further call the BIOS interrupt service program. It can be seen that the operation of the program is supported by a layer of service. In this, the operating system acts as a very important role. It provides a programmer to use the routine that can be used directly, or it can be called Application Programming Interface (Application Programming Interface, API). The DOS generally has no API saying that DOS's programming interface is acting as an interrupt service program. Programming in Windows is often interacted with the API. The 32-bit Windows API has more than 2,000, on the one hand, it provides a powerful programming interface, on the other hand, it makes the beginner, but it is.
Basic common sense of Windows operating system
Windows is a single user multitasking graphical operating system. The so-called single user refers to only one user (one person) to operate the computer through the Windows system; the so-called multi-task, refers to multiple processes and execution. Since the Windows system has these characteristics, then Windows programming will reflect these features. In order to do multitasking, the Windows program uses the message mechanism. I have my news. I am working hard. If I don't have my news, I will give the CPU to others; in order to make graphicalization, the Windows program must display the window and draw a customer area. Even the display string must also draw on the client area. Another point, Windows is widely used in dynamic links. Windows's API is placed in a dynamic link library for operation time calling. There are 32-bit GDI32.DLL, USER32.DLL, KERNEL32.DLL, and 16 bits of GDI.exe, Krnl386.exe, and APIs exist in these dynamic link libraries.
What is Windows SDK
SDK is Software Develope Kit, which contains the documentation for Windows software and the input library of the API function, the header file (because the API is in the dynamic link library, these dynamic link libraries are the components of the system therefore Provide, and enter the library and header files must be used, so you can use the API function in your program). Early SDK is a separate package that has now been included in Visual C and some other development environments. If you have already installed VC , you can start writing a Windows program. With the development of the Windows system, the content of SDK is increasing, and we will seize the most basic aspects. As for other specialized themes, they have learned further according to their own interests and technical directions. No need to be scared by the first Windows program
If you have already started, your textbook should be the classic programming window or a similar book. But no matter which book, you will face a basic Windows SDK program, this program has a row. Although it is not long, it is much longer than the Hello World of the C. Worse, it is full of strange variable types and constant definitions, but don't be scared by it, let us see what it is. The first will have a #include
learning method
Of course, write a program. It is best to write one every topic. From the beginning of the window, text is displayed to graphic display, controls, dialogs, and write more about Windows programming. When the first part is similar, you can write a comprehensive program. Finally, you will find that you can write a long program, and more than 1000 lines are not long, but it is difficult to imagine when studying C. It is also important to have some special websites, such as the VC Knowledge Base (www.vckbase.com) and VC Road (there is a very good tutorial, but now the website is gone, is recovering), and WWW .9cbs.net is also a nice place. Analysis of several Windows programming methods and others
Many beginners tend to mix Windows programming and VC to talk. Open the new project of VC , you can see VC supports many projects. Including the command line, MFC, and the Win32 Application, the SDK program. Using VC is not necessarily writing SDK programs, writing SDK programs must not use VC . The method of writing a Windows program is not only SDK, but also using class libraries such as MFC, OWL, using fast development tools such as VB, Delphi. These methods have each use. Using SDK is undoubtedly troublesome, we learn SDK is not to use it to edit the software, although it can, mainly in order to make a clear understanding of Windows programming, so you can use the MFC "you can do" your chest Have a gully.
THE END