Overview of Windows Programming History of Windows GUI in Windows Multitasking in Windows Memory in Windows DLL's API COM
Overview of Windows Programming History of Windows GUI in Windows Multitasking in Windows Memory in Windows DLL's API COM
History of windows
GUI in windows
Multitasking in windows
Memory in windows
DLL’s
API
COM
DLL’s
Dynamic Link Library
DLLs - introduced with the first releases of the
Microsoft Windows OS, and today are a
fundamental structural component of the OS
DLLs allow certain code fragments to be compiled
into a single library, and to be linked to by multiple
programs.
This means that only one copy of the library
needs to exist, and multiple programs can share
the functions and the data between them.
Examples of DLL
COMDLG32.DLL-controls the dialog
boxes
GDI32.DLL-contains numerous functions
for drawing graphics, displaying text and
managing fonts
KERNEL32.DLL-contains hundreds of
functions for the management of memory
and various processes
API
Application Programming Interface
API is a set of routines, protocols, and
tools for building software applications
API is set of commands, which interfaces
the programs with the processors.
API consists of thousands of functions,
structures, and constants that can declare
and use in projects
COM
Component Object Model
Microsoft implemented a technology known as the COM
for Windows.
COM essentially takes the object-oriented programming
paradigm to the next level, by standardizing the class
interface, and allowing classes to be written in different
languages (C++, VB, etc.) and interfaced together
seamlessly.
COM programs (or "COM clients") can be written in
most languages that allow object-orientation.
Windows Data types
Hungarian Notation
LPVOID
LONG, INT, SHORT, CHAR
DWORD, WORD, BYTE
STR, LPSTR
TCHR
HANDLE
HINSTANCE
HMENU
WPARAM, LPARAM
Hungarian Notation
The Win32 API uses the so-called "Hungarian
Notation" for naming variables.
Hungarian Notation requires that a variable be
prefixed with an abbreviation of its data type, so
that when you are reading the code, you know
exactly what type of variable it is.
The reason this practice is done in the Win32
API is because there are many different data
types, making it difficult to keep them all straight.
LPVOID
LPVOID data types are defined as being a
"pointer to a void object".
ANSI-C standard allows for generic pointers to
be defined as "void*" types.
This means that LPVOID pointers can be used
to point to different types of objects, without
creating a compiler error.
However, the burden is on the programmer to
keep track of what type of object is being pointed
to.
LONG, INT, SHORT, CHAR
These types are not defined to a specific length.
It is left to the host machine to determine exactly
how many bits each of these types has.
LONG notation
LONG variables are typically prefixed with an "l" (lower-
case L).
UINT notation
UINT variables are typically prefixed with an "i" or a "ui"
to indicate that it is an integer, and that it is unsigned.
CHAR, UCHAR notation
These variables are usually prefixed with a "c" or a "uc"
respectively.
DWORD, WORD, BYTE