I remember a while ago that I needed to enable the vibration for a client's application. So I googled a bit and found the similar codes like below... And today, I found some people are looking for this solution on MSDN... So I decided to post it in C# and hope it will give some people a heads up...



       /// 
        /// This function plays the specified vibration.
        /// 
        /// Must be 0
        /// Must be NULL
        /// 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.
        /// Must be INFINITE
        /// 
        /// This API is not supported by Windows Mobile 6 Professional.
        [DllImport("aygshell.dll", EntryPoint = "Vibrate")]
        private static extern int VibrateStart(int cvn, IntPtr rgvn, bool fRepeat, uint dwTimeout);

        /// 
        /// Stops all current vibration songs.
        /// 
        /// 
        /// 
        /// This API not supported by Windows Mobile 6 Professional.
        /// 
        [DllImport("aygshell.dll")]
        private static extern int VibrateStop();

        private const uint INFINITE = 0xffffffff;

        /// 
        /// Start the mobile vibration.
        /// This is not supported by Windows Mobile 6 Professional.
        /// 
        /// 
        public static int StartVibrate()
        {
            return VibrateStart(0, IntPtr.Zero, true, INFINITE);
        }

        /// 
        /// Stops all current vibration.
        /// This is not supported by Windows Mobile 6 Professional.
        /// 
        public static void StopVibrate()
        {
            VibrateStop();
        }
by Elvis Hsu 1 comment Read More
Pooh~~~ I haven't organised the blog page for ages... Well, not many clicks~~~
Anyway, I tried to check emails at home with Ubuntu and found out the Evolution could not connect to our Exchange 2007 server. I found out it works well when I am in the office or VPN connection is on. Um... I think that will be my new task to find out what causes this... Or... If any one reads this post, I would appreciated some comments or suggestions for this issue.
by Elvis Hsu No comments Read More