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

  1. /*
  2.     SYSERRBX.C -- Demontrates SysErrorBox
  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 SYSERRBX (for Borland C++ v3.00)
  8.                  WINIOMS SYSERRBX (for Microsoft C/SDK)
  9. */
  10. #include <dos.h>
  11. #include <windows.h> 
  12. #include "winio.h" 
  13.  
  14. /* undocumented function */ 
  15. extern int FAR PASCAL SysErrorBox(LPSTR msg, LPSTR title,
  16.                         WORD lButton, WORD mButton, WORD rButton);
  17.  
  18. #define SEB_OK      1
  19. #define SEB_CANCEL  2
  20. #define SEB_YES     3
  21. #define SEB_NO      4
  22. #define SEB_RETRY   5
  23. #define SEB_ABORT   6
  24. #define SEB_IGNORE  7
  25.  
  26. #define SEB_DEFAULT 0x8000
  27.  
  28.  
  29. #include "checkord.c"
  30.  
  31. int main() 
  32.     {
  33.     int nResult;
  34.     
  35.     // Ord/name check
  36.     if (! CheckOrdName("SysErrorBox", "USER", 320))
  37.         return 0;
  38.  
  39.     winio_about("SYSERRBX"
  40.         "\nDemonstrates use of the SysErrorBox() function"
  41.         "\n\nFrom Chapter 6 of"
  42.         "\n\"Undocumented Windows\" (Addison-Wesley, 1992)"
  43.         "\nby Andrew Schulman, David Maxey and Matt Pietrek"
  44.         );
  45.  
  46.     nResult = SysErrorBox("Press one of these buttons.",
  47.                     "SysErrorBox() Test",
  48.                     SEB_ABORT, SEB_RETRY, SEB_IGNORE | SEB_DEFAULT);
  49.     
  50.     printf("You pressed the %s button\n",
  51.             nResult == 1 ? "left" :
  52.             nResult == 2 ? "middle" : 
  53.                             "right");
  54.  
  55.     printf("\nProgram terminated");
  56.     return 0;
  57.     }
  58.