Difficulty: Easy
Correct Answer: Correct (Windows uses an event/message-driven model)
Explanation:
Introduction / Context: Modern operating systems and GUIs typically use an event-driven programming model. In Microsoft Windows, applications process a message loop, handling events such as keystrokes, mouse clicks, window resizing, timers, and inter-process notifications. This question checks whether you recognize Windows’ event-driven paradigm.
Given Data / Assumptions:
Concept / Approach: Event-driven programming reacts to notifications rather than polling continuously. The OS and frameworks deliver events; the application registers handlers (callbacks, delegates) to respond. This yields responsive UIs and efficient resource usage, as code runs on demand when input or state changes occur.
Step-by-Step Solution:
Recall the Windows message loop: GetMessage/DispatchMessage or framework equivalents.Map to higher-level constructs (form events, routed events, async I/O callbacks).Conclude that Windows apps are indeed event driven.Verification / Alternative check: Inspect sample WinForms/WPF apps where UI logic resides in event handlers; the app is idle outside of events.
Why Other Options Are Wrong:
Common Pitfalls: Blocking the UI thread and starving the message pump; failing to offload long operations; not unsubscribing handlers leading to leaks.
Final Answer: Correct (Windows uses an event/message-driven model)
Discussion & Comments