home *** CD-ROM | disk | FTP | other *** search
- /*
- FILLWIND.C -- Demonstrates FillWindow
-
- From Chapter 6 of "Undocumented Windows" (Addison-Wesley 1992)
- by Andrew Schulman, Dave Maxey and Matt Pietrek
-
- Build using: WINIOBC FILLWIND (for Borland C++ v3.00)
- WINIOMS FILLWIND (for Microsoft C/SDK)
- */
-
- #include <windows.h>
- #include "wmhandlr.h"
- #include "winio.h"
-
- /* undocumented function */
- extern void FAR PASCAL FillWindow(HWND hwndParent, HWND hwnd,
- HDC hDC, HANDLE hBrush);
- #include "checkord.c"
-
-
- long dblclk(HWND hwnd, WORD wMsg, WORD wParam, DWORD lParam)
- {
- HDC hDC = GetDC(hwnd);
- FillWindow(NULL, hwnd, hDC, GetStockObject(DKGRAY_BRUSH));
- ReleaseDC(hwnd, hDC);
- puts("The rest of the window should now be dark gray");
- puts("Double click on a text line to do it again");
- return 1;
- }
-
-
- int main()
- {
- // Ord/name check
- if (! CheckOrdName("FillWindow", "USER", 324))
- return 0;
-
- winio_about("FILLWIND"
- "\nDemonstrates the FillWindow function"
- "\n\nFrom Chapter 6 of"
- "\n\"Undocumented Windows\" (Addison-Wesley, 1992)"
- "\nby Andrew Schulman, David Maxey and Matt Pietrek"
- );
-
- wmhandler_set(winio_current(),
- WM_LBUTTONDBLCLK, (WMHANDLER) dblclk);
-
- puts("Double click on a text line to turn the window dark gray");
- puts("Close the window to exit");
-
- return 0;
- }
-