11.07.2015 Views

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

308 Micros<strong>of</strong>t WindowsIntroduced in 2007, Micros<strong>of</strong>t Windows Vista features bettersecurity, a 3D look, new search facilities, <strong>and</strong> multimediafeatures. (Micros<strong>of</strong>t Corporation)appears to be a combination <strong>of</strong> “back to basics” (a responseto the sluggish performance <strong>of</strong> Vista) <strong>and</strong> more seamlessuser access to data <strong>and</strong> media from a variety <strong>of</strong> sources.User’s PerspectiveFrom the user’s point <strong>of</strong> view, Windows is a way to control<strong>and</strong> view what is going on with the computer. The userinterface consists <strong>of</strong> a st<strong>and</strong>ard set <strong>of</strong> objects (windows,menus, buttons, sliders, <strong>and</strong> so on) that behave in generallyconsistent ways. This consistency, while not absolute,reduces the learning curve for mastering a new application.Programs can be run by double-clicking on their icon onthe underlying screen (called the desktop), or by means <strong>of</strong>a set <strong>of</strong> menus.Windows users generally manage their files througha component called Windows Explorer or My <strong>Computer</strong>.Explorer presents a treelike view <strong>of</strong> folders on the disk.Each folder can contain either files or more folders, whichin turn can contain files, perhaps nested several layers deep.Folders <strong>and</strong> files can be moved from place to place simplyby clicking on them with the mouse, moving the mousepointer to the destination window or folder, <strong>and</strong> releasingthe button (this operation is called dragging). Anotheruseful feature is called a context menu. Accessed by clickingwith the right-h<strong>and</strong> mouse button, the menu bringsup a list <strong>of</strong> operations that can be done with the currentlyselected object. For example, a file can be renamed, deleted,or sent to a particular destination.Windows includes a number <strong>of</strong> features designed tomake it easier for users to control their PC. Most settingscan be specified through windows called dialog boxes,which include buttons, check boxes, or other controls. Mostprograms also use Windows’s Help facility to present helppages using a st<strong>and</strong>ard format where related topics can beclicked. Most programs are installed or uninstalled usinga st<strong>and</strong>ard “wizard” (step-by-step procedure), <strong>and</strong> wizardsare also used by many programs to help beginners carry outmore complex tasks (see help systems).MultitaskingFrom the programmer’s point <strong>of</strong> view, Windows is a multitasked,event-driven environment (see multitasking).Programmers must take multitasking into account in recognizingthat certain activities (such as I/O) <strong>and</strong> resources(such as memory) may vary with the overall load on thesystem. Responsible programs allocate no more memorythan they need, <strong>and</strong> release memory as soon as it is nolonger needed. If the pool <strong>of</strong> free memory becomes too low,Windows starts swapping the least recently used segments<strong>of</strong> memory to the hard drive. This scheme, called virtualmemory, allows a PC to run more <strong>and</strong> larger programs thanwould otherwise be possible, but since accessing the harddrive takes considerably longer than accessing RAM, thesystem as a whole starts slowing down.Windows also has a rather small amount <strong>of</strong> memoryreserved for its GDI (Graphics Device Interface), a systemused for displaying graphical interface objects such as icons.If this resource pool (which has been made somewhat moreflexible in later versions <strong>of</strong> Windows) runs out, the systemcan grind to a halt.Programming PerspectiveProgrammers moving to Windows from more traditionalsystems (such as MS-DOS) must also deal with a new paradigmcalled event-driven programming. Most traditionalprograms are driven by an explicit line <strong>of</strong> execution throughthe code—do this, make this decision, <strong>and</strong> depending on it,do that—<strong>and</strong> so on. Windows programs, however, typicallydisplay a variety <strong>of</strong> menus, buttons, check boxes, <strong>and</strong> otheruser controls. They then wait for the user to do something.The user thus has considerable freedom to move about inthe program, performing tasks in different orders.A Windows program, therefore, is driven by events. Anevent is generally some form <strong>of</strong> user interaction such asclicking on a menu or button, moving a slider, or typinginto a text box. The event is conveyed by a message (seemessage passing) that Windows dispatches to the affectedobject. For example, if the user presses down (clicks) the leftmouse button while the mouse pointer is over a window, aWM_BUTTONDOWN message is sent to that window.Each <strong>of</strong> these interface objects (collectively called controls)has a message-h<strong>and</strong>ling procedure that identifiesthe message. The object must then have appropriate programcode that responds to each possible type <strong>of</strong> event. Forexample, if the user clicks on the File menu <strong>and</strong> then clickson Open, the code will display a st<strong>and</strong>ard dialog box thatallows for selecting the file to be opened.Fortunately for the programmer, Windows providesdevelopers with a large collection <strong>of</strong> types <strong>of</strong> windows, dialogboxes, <strong>and</strong> controls that can be displayed using a functioncall. For example, this code (after some preliminarydeclarations), displays a type <strong>of</strong> window called a list box:HWND MyWindow;hMyWindow = CreateWindow(“LISTBOX”,“Available Services”,WS_CHILD|WS_VISIBLE,0,0,100,200hwndParent,NULL,hINst,NULL);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!