a) With suitable illustration, discuss the relationship between processes and threads and how a process is created in Windows.
AP,6
b) Using the Windows API, write a C/C++ system program to delete a file in the Windows file system. Compile and run the program and copy the source code into your answer booklet.
CR,8
c) Discuss the Windows registry and how it is use in data/information management. AN,6
a) A process is a program in execution. That means it has been allocated processor time and all resources necessary for it to run. A thread on the other hand is a subcomponent of a process. A process may consist of one or more threads.
b)Create a DLL header file Remove.h and the driver program that make use of the file.
//DLL header file Remove.h
class REMOVE_API RemoveApi
{
public:
void Del(void);
};
//Driver program
#include<iostream>
#include<stdio.h>
#include "stdafx.h"
#include "Remove.h"//Include the Remove.h
#include<iostream>
using namespace std;
void Remove_api::Del(void)
{
int delStatus; //Check if has been deleted or not 1 is deleted 0 otherwise
char file[20]; //File name
cout<<"Enter the name of file to delete: "<<endl;
cin>>file;
delStatus = remove(file);
if(delStatus == 0)
cout<<file<<" has been deleted."<<endl;
else
cout<<"Failed. Please try again."<<endl;
return 0;
}
c)The registry is a Windows System hierarchical database that contains data that is critical for the operation of Windows Operating system, the applications and services. The data is structured in a hierarchical format. Each node in the tree is called a key. Each key can contain both subkeys and data entries called values.
The registry is organized in the following four root keys
The registry stores critical information such as the entire current configuration of various settings, user account information, software application configuration.
The windows registry can be edited to achieve various needs in the computer system
Comments
Leave a comment