Microsoft KB Archive/235386

= How To Trigger a Beep in VBCE Applications =

Article ID: 235386

Article Last Modified on 8/19/2005

-

APPLIES TO


 * Microsoft Windows CE Toolkit for Visual Basic 6.0
 * Microsoft Office Keyboard

-



This article was previously published under Q235386



SUMMARY
The Beep statement is not available in eVB/VBCE applications. However, the Beep functionality can be implemented using the MessageBeep API call.



MORE INFORMATION
VBCE 6.0 includes the capability to declare and use certain system application programming interfaces (APIs). The file WINCEAPI.TXT is provided with the VBCE Toolkit and includes sample declare statements, constants, and other useful information.

The following code demonstrates this sample:  Create a new Windows CE project in either Visual Basic or eMbedded Visual Basic. Form1 is created by default. Place a Command Button on Form1.  Paste the following code into the code module of Form1: Option Explicit Declare Function MessageBeep Lib "Coredll" (ByVal wType As Long) As Long Const MB_ICONHAND = 16 Const MB_ICONQUESTION = 32 Const MB_ICONEXCLAMATION = 48 Const MB_ICONASTERISK = 64 Const MB_ICONINFORMATION = 64  'MB_ICONASTERISK Const MB_ICONSTOP = 16          'MB_ICONHAND

Private Sub Command1_Click Dim ret ret = MessageBeep(MB_ICONEXCLAMATION) If ret = 0 Then Msgbox "Error occurred" End Sub 

