home *** CD-ROM | disk | FTP | other *** search
- /*
- SYSERRBX.C -- Demontrates SysErrorBox
-
- From Chapter 6 of "Undocumented Windows" (Addison-Wesley 1992)
- by Andrew Schulman, Dave Maxey and Matt Pietrek
-
- Build using: WINIOBC SYSERRBX (for Borland C++ v3.00)
- WINIOMS SYSERRBX (for Microsoft C/SDK)
- */
- #include <dos.h>
- #include <windows.h>
- #include "winio.h"
-
- /* undocumented function */
- extern int FAR PASCAL SysErrorBox(LPSTR msg, LPSTR title,
- WORD lButton, WORD mButton, WORD rButton);
-
- #define SEB_OK 1
- #define SEB_CANCEL 2
- #define SEB_YES 3
- #define SEB_NO 4
- #define SEB_RETRY 5
- #define SEB_ABORT 6
- #define SEB_IGNORE 7
-
- #define SEB_DEFAULT 0x8000
-
-
- #include "checkord.c"
-
- int main()
- {
- int nResult;
-
- // Ord/name check
- if (! CheckOrdName("SysErrorBox", "USER", 320))
- return 0;
-
- winio_about("SYSERRBX"
- "\nDemonstrates use of the SysErrorBox() function"
- "\n\nFrom Chapter 6 of"
- "\n\"Undocumented Windows\" (Addison-Wesley, 1992)"
- "\nby Andrew Schulman, David Maxey and Matt Pietrek"
- );
-
- nResult = SysErrorBox("Press one of these buttons.",
- "SysErrorBox() Test",
- SEB_ABORT, SEB_RETRY, SEB_IGNORE | SEB_DEFAULT);
-
- printf("You pressed the %s button\n",
- nResult == 1 ? "left" :
- nResult == 2 ? "middle" :
- "right");
-
- printf("\nProgram terminated");
- return 0;
- }
-