1 Lecture
CS410
Midterm & Final Term Short Notes
Windows Programming
Windows Programming involves creating software applications specifically designed to run on Microsoft Windows operating systems. Developers use programming languages like C++, C#, or Visual Basic to build interactive desktop applications, games,
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
1. What is the primary programming language used for Windows Programming?
a) Java
b) C++
c) Python
d) Ruby
Solution: b) C++
2. Which API is commonly used for Windows Programming to access system resources?
a) DirectX
b) WinAPI
c) OpenGL
d) POSIX
Solution: b) WinAPI
3. Which programming framework is often used for Windows desktop applications?
a) .NET Core
b) MFC (Microsoft Foundation Classes)
c) Node.js
d) Django
Solution: b) MFC (Microsoft Foundation Classes)
4. What is the extension for Windows executable files?
a) .exe
b) .dll
c) .txt
d) .bat
Solution: a) .exe
5. Which programming language is commonly used for Universal Windows Platform (UWP) apps?
a) Swift
b) Java
c) C#
d) Ruby
Solution: c) C#
6. Which Windows Programming component is used for creating graphical user interfaces (GUI)?
a) DirectX
b) WinForms
c) Windows Forms
d) Win32
Solution: c) Windows Forms
7. Which Windows version introduced the Windows Presentation Foundation (WPF) framework?
a) Windows XP
b) Windows 7
c) Windows 8
d) Windows Vista
Solution: d) Windows Vista
8. Which tool is commonly used for debugging Windows applications?
a) Visual Studio Debugger
b) Eclipse Debugger
c) GDB (GNU Debugger)
d) Xcode Debugger
Solution: a) Visual Studio Debugger
9. Which Windows Programming approach allows communication between processes running on different machines?
a) IPC (Inter-Process Communication)
b) RPC (Remote Procedure Call)
c) AJAX (Asynchronous JavaScript and XML)
d) REST (Representational State Transfer)
Solution: b) RPC (Remote Procedure Call)
10. Which Windows component is used for handling events and messages in GUI applications?
a) Message Loop
b) Event Loop
c) Control Loop
d) Polling Loop
Solution: a) Message Loop
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
1. Question: What is the Windows Registry, and how is it used in Windows Programming?
Answer: The Windows Registry is a hierarchical database used to store configuration settings and system information. In Windows Programming, developers use the registry to store application-specific settings, preferences, and other configuration data.
2. Question: Explain the concept of a window class in Windows Programming.
Answer: In Windows Programming, a window class defines the attributes and behavior of a window. It specifies the window procedure, background color, cursor style, and other properties. When a window is created, it is associated with a window class, determining its behavior and appearance.
3. Question: How do you handle user input in a Windows application?
Answer: To handle user input in a Windows application, developers use message handling. Windows applications have a message loop that continuously checks for messages (like keyboard and mouse events) in the message queue and calls the appropriate window procedure to process them.
4. Question: What are GDI (Graphics Device Interface) and GDI+ in Windows Programming?
Answer: GDI and GDI+ are APIs used for drawing and rendering graphics in Windows applications. GDI provides basic 2D graphics capabilities, while GDI+ offers more advanced features, including anti-aliasing, gradient fills, and image manipulation.
5. Question: How do you create a modal dialog box in Windows Programming, and what is its purpose?
Answer: To create a modal dialog box, you use the `DialogBox` function. A modal dialog box temporarily halts the main application's execution and requires the user to interact with it before returning to the main window. It is commonly used for user input or configuration tasks.
6. Question: What is COM (Component Object Model) in Windows Programming?
Answer: COM is a Microsoft technology used for inter-process communication and building reusable software components. It enables objects to communicate with each other, regardless of the programming language they were created in, facilitating component-based development in Windows applications.
7. Question: Explain the role of a message loop in a Windows application.
Answer: The message loop is a fundamental part of a Windows application. It retrieves messages from the message queue and dispatches them to the appropriate window procedure for handling. It ensures that user input and system messages are processed efficiently.
8. Question: How do you handle file input/output operations in Windows Programming?
Answer: Windows Programming uses the Win32 API or C++ standard libraries for file input/output operations. Functions like `CreateFile`, `ReadFile`, and `WriteFile` are commonly used for file handling tasks.
9. Question: What is the purpose of the manifest file in Windows Programming?
Answer: The manifest file (usually an XML file) is used to define the application's dependencies and required privileges. It ensures that the application runs with the desired settings, such as specific Windows versions, administrative privileges, or UI themes.
10. Question: How do you handle exceptions in Windows Programming?
Answer: In Windows Programming, exceptions are typically handled using structured exception handling (SEH) mechanisms. Developers use the `__try`, `__except`, and `__finally` blocks to catch and handle exceptions that occur during the program's execution.