HOWTO: Trigger a Beep in VBCE Applications

ID: Q235386


The information in this article applies to:
  • Microsoft Windows CE Toolkit for Visual Basic 6.0


SUMMARY

The Beep statement is not available in 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. Start a new Windows CE HPC Project in Visual Basic 6.0. Form1 is created by default.


  2. Place a Command Button on Form1.


  3. Paste the following code into the code module of Form1:


  4. 
    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

Windows CE Toolkit Help for Visual Basic 6.0

For more information, please see the following article in the Microsoft Knowledge Base:

Q184650 INFO: What Does Visual Basic Have That VBCE Doesn't Have?

Additional query words: wince vbce vbce6

Keywords : kbToolkit kbVBp600 kbWinCE kbGrpVB
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: July 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.