home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource1 / cenvew / winmsg.cmm < prev    next >
Text File  |  1993-11-15  |  776b  |  27 lines

  1. // WinMsg.cmm - Display all Window messages for a standard window
  2. //
  3.  
  4. #include "Window.lib"
  5.  
  6. printf("This will create a default window and display all messages sent\n"
  7.        "to that window.  Press any key to execute...");
  8. getch();
  9.  
  10. // Create a default window and let it run
  11.    if ( MakeWindow(NULL,NULL,"WindowFunction",
  12.                    "Display Windows' messages",
  13.                    WS_OVERLAPPEDWINDOW | WS_VISIBLE,
  14.                    CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
  15.                    NULL,0) ) {
  16.  
  17.       while ( DoWindows() )
  18.          ;
  19.    }
  20.  
  21. WindowFunction(hwnd,msg,wparm,lparm,counter)
  22. {
  23.    printf("\nMessage %d: hwnd = %04X, msg = %04X, wparm = %04X, lparm = %08X",
  24.           counter++,hwnd,msg,wparm,lparm);
  25. }
  26.  
  27.