home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a079 / 1.img / FPDG.LZH / VOL2NUM0 / SHOWBOX / SHOWBOX.ART next >
Encoding:
Text File  |  1993-02-02  |  1.7 KB  |  18 lines

  1. The ShowBox.PRG program loads and calls the Windows API MessageBox function which performs the following operations:
  2.     [o]    Draws a box
  3.     [o]    Displays a question mark icon
  4.     [o]    Displays a query message
  5.     [o]    Displays a Yes and No push button, 
  6.     [o]    Returns user response.
  7. If you refer to a Windows API documentation you will see that the MessageBox function call has the following syntax:
  8. int Messagebox( HWndParent, lptext, lpCaption, wType )
  9.      HWndParent - Handle to parent window (msgboxRN)
  10.      lptext     - Text in box
  11.      lpCaption  - Message box window title
  12.      wType      - Specifies icon and type of buttons OR'ed
  13.                    together.
  14.  
  15. The first argument for the MessageBox function is a handle to the parent window. It is an integer value. In the example, the Windows main window will be the parent window and consequently, HWndParent will be assigned a zero value. The second argument is a string (C) which specifies the text displayed in the message box. The third argument is a string that specifies the text that appears in the title bar. The last argument is an integer (I) that designates which icon displays in the message box. 
  16. In the example shown in Listing 21.2, The FOXTOOLS is loaded using the SET LIBRARY TO command. Next, the RegFN() function is called to register the MessageBox Function. Since the function has four arguments, the ArgTypes string will have a value of "ICCI". The int in the MessageBox function syntax indicates that the MessageBox function returns an integer (I) value. Therefore, the ReturnType argument is assigned a value of "I". You will discover from the documentation that the MessageBox function is in the USER.EXE Windows library. Consequently, you will assign "USER.EXE" to the DLLName string. 
  17.  
  18.