home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / rpc / mazelord / topwnd.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-06  |  1.5 KB  |  76 lines

  1. /***********************************************************************
  2. File:   TopWnd.c
  3.  
  4. Abstract:
  5.  
  6.     This contains the windows procudure responsible for drawing the
  7.     top-view map.
  8.  
  9.  
  10. Contents:
  11.  
  12.     TopViewWndProc() -- windows message processor for Top view window.
  13.  
  14.  
  15.  
  16. ************************************************************************/
  17.  
  18. #include "winmaze.h"
  19. #include "mazproto.h"
  20. #include "net.h"
  21. #include <mmsystem.h>
  22.  
  23.  
  24.  
  25.  
  26. /*=====================================================================
  27. Function: TopViewWndProc()
  28.  
  29. Inputs: Standard windows entrypoint parms
  30.  
  31. Outputs: returns success
  32.  
  33. Abstract:
  34.     Takes care of maintaining the top view map.
  35. ======================================================================*/
  36.  
  37. LONG FAR PASCAL TopViewWndProc(
  38.     HWND hWnd,
  39.     UINT Message,
  40.     UINT wParam,
  41.     LONG lParam
  42.     )
  43. {
  44.     PAINTSTRUCT ps;
  45.     HDC hDC;
  46.  
  47.     switch (Message) {
  48.  
  49.         case WM_KEYDOWN:
  50.            SendMessage(hWndMaze,WM_KEYDOWN,wParam,lParam);
  51.            break;
  52.  
  53.         case WM_MOVE:
  54.             break;
  55.  
  56.         case WM_SIZE:
  57.             break;
  58.  
  59.         case WM_PAINT:
  60.             hDC = BeginPaint(hWnd, &ps);
  61.             SetBkMode(hDC, TRANSPARENT);
  62.             DrawTopView(hDC,TRUE);
  63.             EndPaint(hWnd, &ps);
  64.             break;
  65.  
  66.         case WM_CLOSE:
  67.             DestroyWindow(hWnd);
  68.             break;
  69.  
  70.         default:
  71.             return DefWindowProc(hWnd, Message, wParam, lParam);
  72.         }
  73.  
  74.     return(0);
  75. }
  76.