Share via


Vibrate

4/8/2010

This function plays the specified vibration song.

Note

This API is not supported by Windows Mobile Professional.

Syntax

HRESULT Vibrate(
  DWORD cvn,
  const VIBRATENOTE * rgvn,
  BOOL fRepeat,
  DWORD dwTimeout
);

Parameters

  • cvn
    [in] Must be 0.
  • rgvn
    [in] Must be NULL.
  • fRepeat
    [in] A Boolean value that indicates whether the song should be repeated. If this parameter is equal to TRUE, it will refer to dwTimeout to determine how long the vibration song should play.
  • dwTimeout
    [in] Must be INFINITE.

Return Value

Value Description

E_FAIL

The function failed to play the vibration song. Ensure that the VibrateGetDeviceCaps function was called prior to calling the Vibrate function. The device must be present before the Vibrate function is called.

E_NOTIMPL

The specified feature is not implemented.

S_OK

The function played the vibration song successfully.

Example

The following sample code will play a standard vibration song using the default amplitude and frequency for the single note. The vibration song will play until stopped because the dwTimeout parameter is set to INFINITE.

hr = Vibrate (0, NULL, TRUE, INFINITE);

Requirements

Header vibrate.h
Library aygshell.lib
Windows Mobile Smartphone 2002 and later

See Also

Reference

VibrateGetDeviceCaps
VIBRATENOTE
VibrateStop