July 21st, 2003 11:10 PM
Windows programming overview
If someone has already writen a tutorial on this already please forgive me, I searched but came up empty. Also i used a spell checker but am poor at gramour.
This a short overview and walk through of Win32 Programming.
First to define Win32 programming. This in itself is the creation of windows programs or to make use of the Win32 API. The Win32API is a set of pre-made core windows functions, the Application Programming Interface. The Win32API itself is comprised Mainly of four DLL's
Kernel32.dll -> Windows Kernel
User32.dll -> Responsible for handling most of the GUI, Windows, Menus, dialogs, Message Box, Buttons, Icons...
gdi32.dll -> Handling of all graphics, Graphics device Interface, for drawing on the screen, handling of images, graphics...
Shell32.dll -> Core of Windows Explorer, simple tasks such as Restarting Windows, Formating the drive, drag and drop folders and files, or more complex...
Any programming language that can use functions inside 32bit DLL's can be used to make Windows applications. Though many C/C++ compilers handle this internally for you, making it as simple as #include windows.h and then you just call the Win32API functions, CreateWindow(), LoadMenu(), LoadIcon(), LoadImage(), MessageBox()....
Handling of the registry is also provided in the Win32API with the use of advapi32.dll such functions include RegCreateKey(), RegQueryValue, RegcloseKey(), RegDeleteKey()...
As the API was built upon and enhanced, some functions graduated, such as CreateWindow() became CreateWindowEx() where Ex represents extended. As these enhanced functions grew in terms of abilities, and parameters, Microsoft started thinking ahead. Some Extended functions have reserved DWORDs for future growth to the Win32API. These reserved paramerts are always set to 0.
The traditional GUI nature of Windows is in fact optional, a win32 application can be made that does not have any window, dialog or interface of any kind. For those however wishing to create GUI applications in Windows, have allot of goodies provided by Microsoft for making this easy.
GUI's usually consist of a parent window, and/or dialog(s). Objects or widgets such as buttons, edit boxes, scroll bars...are added to the window or dialog. Both windows and dialogs have a heart and a brain. The brain called a window procedure is responsible for handling messages pumped to it by the heart. When a user clicks a button, types inside a edit box, moves a window... a message is sent to the window procedure for the parent. If a button is placed inside a window, the button is a child of the window, and therefor when the button is pushed or released a message is sent to the window procedure.
These widgets or objects can be added individually with a bunch of CreateWindowEx(), or through use of resource scripts. To use resources you require a resource compiler. The resource compiler takes a resource script you wrote using a special language set, and compiles it into a res file. this file is then linked and compiled into your executable at build time.
GUI toolkits such as the infamus MFC, OWL or wxWindows *trembles*, can also be used.
I hope this has given you a bit of an oversight into the world of windows programming. Now don't get me wrong Linux, Unix, BSD programming is also cool, though I have not yet ventured into it, would definately help your Resume.