Microsoft KB Archive/193223

= HOWTO: Use the MessageBeep API to Play System .WAV Files =

Article ID: 193223

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q193223



SUMMARY
This article describes how to call the MessageBeep API function to play wave files associated with the Windows System sound assignment.



MORE INFORMATION
The system sound assignments are made through the Sounds icon in the Control Panel. The MessageBeep function can accept one of the five functions in the following list. The definitions for the constants were taken from the MessageBeep section in the "Visual Basic Programmer's Guide to the Win32 API".

  Constant              Description --  0xffffffff            Standard beep MB_ICONHAND          System hand sound MB_ICONQUESTION      System question sound MB_ICONEXCLAMATION   System exclamation sound MB_ICONASTERISK      System asterisk sound The values normally assigned to these constants follow. For the standard beep, zero can be used. #DEFINE MB_OK                0 #DEFINE MB_ICONHAND          16 #DEFINE MB_ICONQUESTION      32 #DEFINE MB_ICONEXCLAMATION   48 #DEFINE MB_ICONASTERISK      64 To use the MessageBeep function, use the DECLARE statement and then call MessageBeep with one of the constants. For example: DECLARE INTEGER MessageBeep IN Win32API INTEGER =MessageBeep(MB_ICONASTERISK)

