Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
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 dwTimeoutto 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 VibrateGetDeviceCapsfunction was called prior to calling the Vibratefunction. The device must be present before the Vibratefunction 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 dwTimeoutparameter is set to INFINITE.

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

Requirements

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

See Also