home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l430 / 1.ddi / CHAP6.ZIP / FILLWIND.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.5 KB  |  53 lines

  1. /*
  2.     FILLWIND.C -- Demonstrates FillWindow
  3.  
  4.     From Chapter 6 of "Undocumented Windows" (Addison-Wesley 1992)
  5.     by Andrew Schulman, Dave Maxey and Matt Pietrek
  6.  
  7.     Build using: WINIOBC FILLWIND (for Borland C++ v3.00)
  8.                  WINIOMS FILLWIND (for Microsoft C/SDK)
  9. */
  10.  
  11. #include <windows.h> 
  12. #include "wmhandlr.h" 
  13. #include "winio.h" 
  14.  
  15. /* undocumented function */ 
  16. extern void FAR PASCAL FillWindow(HWND hwndParent, HWND hwnd,
  17.                                             HDC hDC, HANDLE hBrush);
  18. #include "checkord.c"
  19.  
  20.  
  21. long dblclk(HWND hwnd, WORD wMsg, WORD wParam, DWORD lParam)
  22.     {
  23.     HDC hDC = GetDC(hwnd);
  24.     FillWindow(NULL, hwnd, hDC, GetStockObject(DKGRAY_BRUSH));
  25.     ReleaseDC(hwnd, hDC);
  26.     puts("The rest of the window should now be dark gray");
  27.     puts("Double click on a text line to do it again");
  28.     return 1;
  29.     }
  30.  
  31.  
  32. int main() 
  33.     {
  34.     // Ord/name check
  35.     if (! CheckOrdName("FillWindow", "USER", 324))
  36.         return 0;
  37.  
  38.     winio_about("FILLWIND"
  39.         "\nDemonstrates the FillWindow function"
  40.         "\n\nFrom Chapter 6 of"
  41.         "\n\"Undocumented Windows\" (Addison-Wesley, 1992)"
  42.         "\nby Andrew Schulman, David Maxey and Matt Pietrek"
  43.         );
  44.     
  45.     wmhandler_set(winio_current(),
  46.                         WM_LBUTTONDBLCLK, (WMHANDLER) dblclk);
  47.  
  48.     puts("Double click on a text line to turn the window dark gray");
  49.     puts("Close the window to exit");
  50.     
  51.     return 0;
  52.     }
  53.