Page 227 - DCAP408_WEB_PROGRAMMING
P. 227

Unit 14: Text and Graphics Output




              WPARAM  wParam,                                                                   Notes
              LPARAM  lParam
          );
          Parameters

          wParam: This parameter is not used.

          lParam: This parameter is not used.
          Return Value


          An application returns zero if it processes this message.
          The WM_PAINT message is generated by the system and should not be sent by an application.
          To  force  a  window  to  draw  into  a  specific  device  context,  use  the  WM_PRINT  or
          WM_PRINTCLIENT  message. Most  common  controls  support  the  WM_PRINTCLIENT
          message.


               !
             Caution  This requires the target window to support the WM_PRINTCLIENT message.
          The DefWindowProc function validates the update region. The function may also send the
          WM_NCPAINT message to the window procedure if the window frame must be painted and
          send the WM_ERASEBKGND message if the window background must be erased.
          The system sends this message when there are no other messages in the application’s message
          queue. DispatchMessage determines where to send the message; GetMessage determines which
          message to dispatch. GetMessage returns the WM_PAINT message when there are no other
          messages in the application’s message queue, and DispatchMessage sends the message to the
          appropriate window procedure.





             Notes  A window may receive internal paint messages as a result of calling RedrawWindow
             with the RDW_INTERNALPAINT flag set. In this case, the  window may  not have an
             update region. An application should call the GetUpdateRectfunction to determine whether
             the window has an update region. If GetUpdateRect returns zero, the application should
             not call the BeginPaint and EndPaint functions.





              Task  What does dispatchMessage signify?

          Self Assessment

          Fill in the blanks:
          7.   The ......................... message is sent when the system or another application makes a request
               to paint a portion of an application’s window.
          8.   ......................... determines where to send the message.





                                           LOVELY PROFESSIONAL UNIVERSITY                                   221
   222   223   224   225   226   227   228   229   230   231   232