VU CS 410 Windows Programming-Solved Papers & Quiz

We will provide VU CS 410 Windows Programming with midterm and Final papers to prepare for virtual university exams. One of the most useful papers for students to practice and get more marks in final results.

We assume that in virtual university, if students are looking at the VU midterm solved MCQs and final term past papers then massmcqs.com is the right place for your taste.

VU CS 410 Windows Programming

Q. What is a process?

Answer:  A series of actions or steps taken to achieve an end, a process is a collection of interrelated work tasks initiated in response to an event that achieves a specific result for the customer of the process.

Q. Briefly define Modal Loop. ( VU CS 410 Windows Programming)

Answer:  Modal loop is run by Modal dialogs and process message as does the application message loop. That’s why program execution is transferred to the modal loop so the modal loop itself gets messages and dispatch messages.

Q. Write windows Programming control process?

Answer: 

Q. Explain Pointer to Constant, and constant to Pointer?

Constant pointer to variable data:

char * const ptr = buff

*ptr = ‘a’;

ptr = buff2;

since we have declared ptr as a “constant pointer to variable data”, so we can change the contents
of the place where ptr is pointing at, i.e. data but being a constant variable, the ptr value i.e. the
address it contains cannot be modified.
Variable pointer to Constant data:
const char * ptr = buff. //variable pointer to constant data
*ptr = ‘a’; // it will be an error
ptr = buf2;

Q. Write the complete syntax or “get parent function”.?

The getParent function returns the parent handle of the specified child. This function will be useful when the parent of the child window to use.
Syntax::
HWND GetParent
(
HWND hWnd // handle to child window
);

Q. Types of assertion and name them? ( VU CS 410 Windows Programming )

There are three types of assertion:
1 Preconditions
·
Specify conditions at the start of a function.
2 Post conditions
·
Specify conditions at the end of a function.
3 Invariants
·
Specify conditions over a defined region of a program

Q. Write the characteristics of child windows?

Following are the characteristics of child windows.
·
A child window always appears within the client area of its parent window.
·
Child windows are most often as controls.
·
A child window sends WM_COMMAND notification messages to its parent window.
·
When a child window is created a unique identifier for that window is specified in
hMenu parameter of CreateWindow()

Q. What will happen if GetUpdateRect returns zero?

An application should call the GetUpdateRect function to determine whether the window has an update region. If GetUpdateRect returns zero, the application should not call the BeginPaint and EndPaint functions.

Q. Define Client area? ( VU CS 410 Windows Programming )

The client area is the part of a window where the application displays output, such as text or graphics. For example, a desktop publishing application displays the current page of a document in the client area.

 The application must provide a function, called a window procedure, to process input to the window and display output in the client area.

Q. WIN MAIN describe with detail.?

WinMain is the starting point in Every Win32 GUI programs. WinMain has four
Parameters these are,
1. First is instance of the current application.
2. Second parameter is also an instance of this application which is used for the
previous application of the same type that is already running. It is used only in
Window 16bit editions or Windows 3.1. Windows 32bit editions do not support this
parameter. It is here just for compatibility.
3. Third parameter is a command line argument of string type which is a type defined
as char *.
4. Fourth parameter is windows style.

Q. Differentiate between Super Classing and Sub Classing.??

SuperClassingSubClassing
Super-classing defines a class that adds
new functionality to a predefined
window class,
Sub-classing is allowed only within a
process.
Button or list box controls.Win32 processes have separate address
spaces
Super-classing involves creating a new
class that uses the window procedure of
an existing class for basic functionality.
An application cannot subclass a
window or class that belongs to another
process.

Q. Define the “Virtual-Key” message..?

Virtual-key code is a device-independent value defined by the system that identifies thepurpose of a key.

 After translating a scan code, the keyboard layout creates a message that includes the scan code, the virtual-key code, and other information about the keystroke, and then places the message in the system message queue.

Q. What is an extern storage class? ( VU CS 410 Windows Programming )

The extern defines a global variable that is visible to all object modules. When you use ‘extern’s variable cannot be initialized as all it does is to point the variable name at a storage location that has been previously defined.

Q. What is a stack?

In computer science, a stack is an area of memory that holds all local variables and parameters used by any function and remembers the order in which functions are called so that function returns occur correctly.

Q. infinite recursion..?

Infinite recursion, a special case of an infinite loop that is caused by recursion. This revised function will only run out of stack space if n is less than 1 or n is too large; error checking would remove the first case. For information on recursive functions which never run out of stock.

Q. Clipboard Working in short..?? ( VU CS 410 Windows Programming)

In Windows, data is shareable among applications. We can use it for copying the data from one file to the other in the same format e.g. from notepad to MS Word.. All the text or image data you have previously copied can now be pasted into other applications.

Q.  Write down the code c/c++ program that has 2 functions one take 4 integer variable as parameters and return their sum and the other take 4 integers as arguments and return their multiplication.??

#include <stdio.h>
// prototypes, the parameter names are optional,
// print the menu and obtains a selection
int GetChoice();
// inserts a number in the sorted array.
int AddNum (int num[], int sz);
// removes a number from the array.
int DelNum(int num[], int sz);
// prints out the sorted array
void PrintNums(int num[], int sz);
void main()
{
// the number of elements in array A[]
int Size = 0,
// the array that will keep its numbers sorted
A[20],
// the selection made from the menu
Selection;
// keep doing this loop until a 4 or Quit is
// selected from the menu…
Selection = GetChoice();
for( ; Selection != 4; )
{
if(Selection == 1)
Size = AddNum(A, Size);
else
if(Selection == 2)
Size = DelNum(A, Size);
else
PrintNums(A, Size);
Selection = GetChoice();
}
}
// assuming that user will enter only a valid int
int GetChoice()
{
int Choice;
printf(“Enter 1 – Insert, 2 – Delete, “);
printf(“3 – List and 4 – Quit: “);
scanf_s(“%d”, &Choice);
return Choice;
}
int AddNum(int Num[ ], int sz)
{
// local variables…
int i, j, Number;
// gets the number to insert
printf(“What number to insert? “);
scanf_s(“%d”, &Number);
// finds the place (i) to put the new number
for(i = 0; i < sz; ++i)
if(Number < Num[i])
break;
// shift the rest of the array by moving
// the numbers up by one slot.
for(j = sz; j > i; –j)
Num[j] = Num[j – 1];
// place the new number
Num[i] = Number;
// the array size is incremented
// and return to the calling function
return ++sz;
}
// assuming that the deleted item exists
int DelNum(int Num[], int sz)
{
// local variables…
int i, Number;
// gets the number to be deleted
printf(“What number are you going to delete? “);
scanf_s(“%d”, &Number);
// find the place in the array to be deleted
for(i = 0; i < sz; ++i)
if(Number == Num[i])
break;
// the array size is decremented
–sz;
// shift the rest of the array by moving the numbers
// down by one slot
for( ; i < sz; ++i)
Num[i] = Num[i + 1];
// return sz to the calling function
return sz;
}
void PrintNums(int Num[ ], int sz)
{
// local variable…
int i;
for(i = 0; i < sz; ++i)
printf(“Num[%d] = %d\t”, i, Num[i]);
printf(“\n”);
}

OutPut:

Q. Two common controls in Window programming.? ( VU CS 410 Windows Programming )

Common controls are of these types.
1. Date Time Picker Control.
2. List View Control.

Leave a Reply

Your email address will not be published. Required fields are marked *