Vous êtes sur la page 1sur 4

Short notes:

1) Application framework
An application framework is a software library that provides a fundamental structure to support the
development of applications for a specific environment. An application framework acts as the skeletal
support to build an application. The intention of designing application frameworks is to lessen the general
issues faced during the development of applications. This is achieved through the use of code that can be
shared across different modules of an application. Application frameworks are used not only in the
graphical user interface (GUI) development, but also in other areas like web-based applications.
An application framework acts as a tool to supply the structure and templates for constructing an
application. By using object-oriented techniques while implementing the framework, pre-existing classes
can be used to build the applications easily.
2) LOOK and FEEL
look and feel is a term used in respect of a graphical user interface and comprises aspects of its design,
including elements such as colors, shapes, layout, and typefaces (the "look"), as well as the behavior of
dynamic elements such as buttons, boxes, and menus (the "feel"). The term can also refer to aspects of a
non-graphical user interface (such as a command-line interface), as well as to aspects of an API mostly
to parts of an API that are not related to its functional properties. The term is used in reference to
both software and websites.
Look and feel applies to other products. In documentation, for example, it refers to the graphical layout
(document size, color, font, etc.) and the writing style. In the context of equipment, it refers to consistency
in controls and displays across a product line.
Look and feel in operating system user interfaces serves two general purposes. First, it provides branding,
helping to identify a set of products from one company. Second, it increases ease of use, since users will
become familiar with how one product functions (looks, reads, etc.) and can translate their experience to
other products with the same look and feel.
3) WinProc()
In Win32 application programming, WindowProc (or window procedure) is a user-defined callback
function that processes messages sent to a window. This function is specified when an application
registers its window class and can be named anything.
The window procedure is responsible for handling all messages that are sent to a window. The function
prototypeof WindowProc is given by:
LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
4) API
API, an abbreviation of Application Program Interface, is a set of routines, protocols, and tools for
building software applications. The API specifies how software components should interact and APIs are
used when programming graphical user interface (GUI) components. A good API makes it easier to
develop a program by providing all the building blocks. A programmer then puts the blocks together.

There are many different types of APIs for operating systems, applications or for websites. Windows, for
example, has many API sets that are used by system hardware and applications when you copy and
paste text from one application to another, it is the API that allows that to work.
Most operating environments, such as MS-Windows, provide an API so that programmers can write
applications consistent with the operating environment. Today, APIs are also specified by websites. For
example, Amazon or eBay APIs allow developers to use the existing retail infrastructure to create
specialized web stores. Third-party software developers also use Web APIs to create software solutions
for end-users.
Q) Write a code for creating a simple window.
#include <windows.h>
const char g_szClassName[] = "myWindowClass";
// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
//Step 1: Registering the Window Class
wc.cbSize
= sizeof(WNDCLASSEX);
wc.style
= 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon
= LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor
= LoadCursor(NULL, IDC_ARROW);

wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
wc.hIconSm
= LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&wc))
{
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
// Step 2: Creating the Window
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"The title of my window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
NULL, NULL, hInstance, NULL);
if(hwnd == NULL)
{
MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
// Step 3: The Message Loop
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}

Q) What are different messages passed by mouse buttons?