PDA

View Full Version : cs410 Visual Programming Assignment no 2 idea solution apri l2011



Vuhelper
04-21-2011, 12:47 AM
Q1 [Marks: 10]

Write a program using WinMain function in which you will display a message box. Message Box displays”Just another Hello World program!” in its title bar (title bar of message box) and “Hello World” in the message. (See the figure below)




Q2 [marks: 10]

Q No 2 Which are the non-client areas of windows? Briefly explain any four.

Xpert
04-27-2011, 09:13 PM
Answer1:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
MessageBox(NULL,
L"Hello World!",
L"Just another Hello World program!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}

Xpert
04-27-2011, 09:14 PM
Answer2:
The Non-Client area of a window is defined as the area we don't draw on. The nonclient
area of a window is implemented by WPF and includes the parts of a window that
are common to most windows, including the following:
A border.
A border is an area around the perimeter of the window that enables the user to
size the window by using a mouse or other pointing device.
 A title bar.
A title bar displays an application-defined icon and line of text; typically, the
text specifies the name of the application or indicates the purpose of the
window. An application specifies the icon and text when creating the window. The
title bar also makes it possible for the user to move the window by using a mouse
or other pointing device.
 A menu bar.
A menu bar that lists the commands supported by the application. Items in the
menu bar represent the main categories of commands. Clicking an item on the
menu bar typically opens a pop-up menu whose items correspond to the tasks
within a given category. By clicking a command, the user directs the application to
carry out a task.
 Minimize, Maximize, and Restore buttons.
The buttons in the upper-right corner affect the size and position of the
window. When you click the maximize button, the system enlarges the window to
the size of the screen and positions the window, so it covers the entire desktop,
minus the taskbar. At the same time, the system replaces the maximize button
with the restore button. When you click the restore button, the system restores
the window to its previous size and position. When you click the minimize button,
the system reduces the window to the size of its taskbar button, positions the
window over the taskbar button, and displays the taskbar button in its normal
state. To restore the application to its previous size and position, click its taskbar