Compaq iPAQ h3760 Datenblatt Seite 19

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 75
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 18
ENEE408G Fall 2003 (Update 09/23/2003)
Mobile Computing and Pocket PC Programming
18
(2) From File Æ Open on the API Viewer menu bar, select winceapi.txt file from the
directory C:\Windows CE Tools\ Bin .
(3) Choose the desired API Type and pick an item in the Available Items list box.
Click the Add button and the syntax of the selected item will appear in the bottom
textbox. We can copy those declarations and paste them in our eVB program.
(4) To use those APIs, we must put the corresponding declarations in a module (.bas
file, not the form file) and must put them in the General Declarations section.
(b) Example
In this example, we simply call the Playsound function. First, create a new Windows
CE Pocket PC Project, put a Commandbutton on the form. Rename the Name of
Commandbutton as “bnPlaySound”. Put the following codes in the form
Option Explicit
Dim af As Long
Private Sub bnPlaySound_Click()
Dim title_wave As String
title_wave = "\\Windows\\Alarm1.WAV"
music_play (title_wave)
End Sub
Private Sub Form_OKClick()
App.End
End Sub
We add a new module by Porject
Æ
Add Module. We add the Playsound API
declaration in this module. The declaration can be obtained according to what we
have learned in the previous sub-section. The constant SND_SYNC is also obtained in
the same way. Put the following codes in this module.
Option Explicit
Public Const SND_SYNC = &H0
Public Declare Function PlaySound Lib "Coredll" Alias "PlaySoundW"_
(ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As _
Long) As Long
Private Sub music_play(ByVal music_filename As String)
Dim af As Long
af = PlaySound(music_filename, 0, SND_SYNC)
End Sub
After finishing these settings, we can play alarm1.wav by clicking the button.
Seitenansicht 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 74 75

Kommentare zu diesen Handbüchern

Keine Kommentare