Here's a simple managed wrapper for the Vibrate API
public class Vibrate
{
[DllImport("aygshell.dll")]
static extern int Vibrate(int cvn, IntPtr rgvn, bool fRepeat, uint dwTimeout);
[DllImport("aygshell.dll")]
static extern int VibrateStop();
const uint INFINITE = 0xffffffff;
public static bool Play()
{
VibratePlay(0, IntPtr.Zero, true, INFINITE);
}
public static void Stop()
{
VibrateStop();
}
}
For more information on the Vibrate API, you might want to check the MSDN Documentation out.
No comments:
Post a Comment