home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l430 / 1.ddi / CHAP6.ZIP / BCSTMSG.C next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  996 b   |  40 lines

  1. /*
  2.     BCSTMSG.C -- Demontrates BroadCastMessage
  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 BCSTMSG (for Borland C++ v3.00)
  8.                  WINIOMS BCSTMSG (for Microsoft C/SDK)
  9. */
  10.  
  11. #include <windows.h> 
  12. #include "winio.h" 
  13.  
  14. /* undocumented function */ 
  15. extern void FAR PASCAL BroadcastMessage(HWND hwnd, WORD wMsg,
  16.                                     WORD wParam, DWORD lParam);
  17. #include "checkord.c"
  18.  
  19.  
  20. int main() 
  21.     {
  22.     // Ord/name check
  23.     if (! CheckOrdName("BroadcastMessage", "USER", 355))
  24.         return 0;
  25.  
  26.     winio_about("BCSTMSG"
  27.         "\nUses BroadCastMessage to minimize all windows"
  28.         "\n\nFrom Chapter 6 of"
  29.         "\n\"Undocumented Windows\" (Addison-Wesley, 1992)"
  30.         "\nby Andrew Schulman, David Maxey and Matt Pietrek"
  31.         );
  32.     puts("Press a key to minimize all windows on the desktop");
  33.  
  34.     getchar();
  35.     
  36.     BroadcastMessage(winio_current(), WM_SYSCOMMAND, SC_ICON, NULL);
  37.     
  38.     return 0;
  39.     }
  40.