Page 238 - DCAP408_WEB_PROGRAMMING
P. 238

Windows Programming




                    Notes          14.11 Keywords

                                   Character Mode: In character mode, the display screen is treated as an array of blocks, each of
                                   which can hold one ASCII character.

                                   Device Context: A device context is a Windows data structure containing information about the
                                   drawing attributes of a device such as a display or a printer.
                                   Graphics mode: In graphics mode, the  display screen is  treated as  an array of pixels,  with
                                   characters and other shapes formed by turning on combinations of pixels.
                                   PeekMessage(): PeekMessage() looks into the message queue and checks to see if any messages
                                   are waiting.
                                   WM_PAINT: The WM_PAINT message is sent when the system or another application makes a
                                   request to paint a portion of an application’s window.
                                   14.12 Review Questions


                                   1.  Make distinction between character mode and graphic mode.
                                   2.  What is a device context? Illustrate the functions of device context.
                                   3.  Illustrate the use of WM_PAINT message.
                                   4.  Discuss the functions that are used for changing device contexts.

                                   5.  Illustrate with example the concept of Setting the Pen or Brush Color.
                                   6.  What is graphics output? Elucidate the basic  controls in VB that you can use to draw
                                       graphics on your form.

                                   7.  Make distinction between GetMessage() and PeekMessage().
                                   8.  Explicate the Structure of a PeekMessage() Loop.
                                   9.  Elucidate the use of CPaintDC objects and CClientDC objects.

                                   10.  You can load a picture at runtime by using the LoadPicture ( ) method. Comment.
                                   Answers: Self  Assessment


                                   1.  character-based                   2.   pixels
                                   3.  device context                    4.   CPaintDC
                                   5.  drop_caps                         6.   drop_caps
                                   7.  WM_PAINT                          8.   DispatchMessage

                                   9.  ChangeDisplaySettings             10.  GetDCBrushColor
                                   11.  line                             12.  0
                                   13.  animated                         14.  GetMessage()
                                   15.  PeekMessage()











          232                               LOVELY PROFESSIONAL UNIVERSITY
   233   234   235   236   237   238   239   240   241