home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a079 / 1.img / FPDG.LZH / VOL2NUM0 / SHOWBOX / SHOWMBOX.PRG < prev   
Encoding:
Text File  |  1993-02-01  |  1.9 KB  |  47 lines

  1. *****************************************************************
  2. *     * 09/92               showbox.prg                         *
  3. *****************************************************************
  4. *     * Author's Name: Jeb Long                                 *
  5. *     *                                                         *
  6. *     * Description:                                            *
  7. *     *  ShowMBox.PRG illustrates how to use FOXTOOLS.DLL       *
  8. *           to call a typical Windows API function                                                        *
  9. *****************************************************************
  10. * The #define statements came from the windows.h header
  11. * file that comes with C compilers. The following statements
  12. * define combinations of push buttons that are produced by
  13. * the MessageBox function:
  14. #define MB_OK                0
  15. #define MB_OKCANCEL          1
  16. #define MB_ABORTRETRYIGNORE  2
  17. #define MB_YESNOCANCEL       3
  18. #define MB_YESNO             4
  19. #define MB_RETRYCANCEL       5
  20.  
  21. * Following #defines available Icons that can be used
  22.  
  23. #define MB_ICONHAND          16
  24. #define MB_ICONQUESTION      32
  25. #define MB_ICONEXCLAMATION   48
  26. #define MB_ICONASTERISK      64
  27.  
  28. SET LIBRARY TO (SYS(2004)+"FOXTOOLS")   && Load CALLDLLS.DLL Library
  29.  
  30. msgboxRN = RegFn( "MessageBox",  "ICCI","I" , "user.exe")
  31. ************************************************************
  32. * Syntax for Windows API MessageBox() function
  33. *    int Messagebox( HWndParent, lptext, lpCaption, wType )
  34. *     HWndParent - Handle to parent window (msgboxRN)
  35. *     lptext - Text in box
  36. *     lpCaption - Message box window title
  37. *     wType     - Specifies icon and type of buttons OR'ed
  38. *                  together.
  39. ************************************************************* 
  40. result = CallFn(msgboxRN, 0, "Do you want to answer",;
  41.     "Ask The User", MB_YESNO + MB_ICONQUESTION)
  42.  
  43. WAIT WINDOW "User says: " + iif(result = 6, "Yes", "No")
  44. * ...
  45. RETURN
  46.  
  47.