How To Trigger a Beep in VBCE Applications (235386)



The information in this article applies to:

  • Microsoft Windows CE Toolkit for Visual Basic 6.0
  • Microsoft eMbedded Visual C++, Version:4.0

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:
  1. Create a new Windows CE project in either Visual Basic or eMbedded Visual Basic. Form1 is created by default.
  2. Place a Command Button on Form1.
  3. 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
    					

REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

184650 INFO: What Language Features does VB have that VBCE and eVB Do Not


Modification Type:MinorLast Reviewed:8/19/2005
Keywords:kbhowto kbToolkit KB235386