home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / win_lrn / i_o / ginstat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  907 b   |  36 lines

  1. /*
  2.  *
  3.  *  GetInputState
  4.  *  
  5.  *  This program demonstrates the use of the function GetInputState.
  6.  *  This function determines whether there are mouse, keyboard, or timer
  7.  *  events in the system queue that require processing.
  8.  *  
  9.  *  Windows Version 2.0 function demonstration application
  10.  *
  11.  */
  12.  
  13. #include <windows.h>
  14.  
  15. int PASCAL WinMain( hInstance, hPrevInstance, lpszCmdLine, cmdShow )
  16. HANDLE hInstance, hPrevInstance;
  17. LPSTR  lpszCmdLine;
  18. int    cmdShow;
  19. {
  20.   BOOL bState;
  21.   
  22.   MessageBox (NULL, (LPSTR)"Getting input state", (LPSTR)"GetInputState",
  23.      MB_OK);
  24.  
  25.   bState = GetInputState ();
  26.  
  27.   if ( bState != 0 )
  28.      MessageBox (NULL, (LPSTR)"No Important Messages on the Queue", (LPSTR)"GetInputState",
  29.         MB_OK);
  30.   else
  31.      MessageBox (NULL, (LPSTR)"Important Messages are Waiting",
  32.         (LPSTR)"GetInputState", MB_OK|MB_ICONEXCLAMATION);
  33.  
  34.   return 0;
  35. }
  36.