Touch Diamond DIY

Source: Internet
Author: User

Since I became addicted to tennis, not only has the amount of exercise increased, but the amount of meals has also increased. It is said that programmers are groups with serious lack of exercise, but to be honest, they usually exercise more and feel that this day is a good day.

Recently, I couldn't help my friends. I threw some funds and made an outfit. I didn't have to spend any money on the venue. There was a good tennis court in the college apartment next to the community. There are not many students playing tennis, but sometimes someone playing badminton there, so you generally don't have to worry about being occupied.

To tell the truth, I am a blind player in tennis. I don't have to talk about skills without strategy. I just want to go online without going out of the world. I don't want to win or lose, but I want to participate in it! However, after all, it is not a professional player, so it is always a bit concerned, such as what to do with a mobile phone? If you leave it alone, you may miss the phone number. You can always lie to a friend to watch the battle. In fact, it is for people to help me answer the phone.

If you are familiar with Windows Mobile, you will certainly give me a bunch of software that can solve my troubles, such as laidiangenie and QCellCore. But to be honest, these software is too common. The more common the application is, the more likely it will become. I like simple, small, and specialized software, especially on platforms like Windows Mobile.

He said, "Do it yourself and make full use of your clothes ." I am also a programmer. How can I starve to death with a craft? Just do it! Although I am not a Windows Mobile developer, I am still confused when I start some small functions.

First, think about what features I need. It is very simple. In fact, when I receive a call when I play tennis or busy with other things, the phone will automatically hang up and tell the other party that I am busy and cannot answer the phone at the moment. Although the phone itself stores missed calls, I am myself a worried person who calls the other party. Do not give it to others. I browsed the related functions provided by Touch Diamond. There is a "reject incoming calls with text information" function, but it still does not meet my needs, because the premise is to reject incoming calls, the mobile phone will send text messages to the other party, but the mobile phone is not in my hands at all during tennis. All I need is it to do everything on its own. The requirement is clear: Automatic hanging up, automatic sending of text messages, and retained of the call list.

Open Visual Studio 2008 and create a new smart device project. In fact, there is no big difference between the development method and common Windows Forms, that is, the content is changed.

First, create a Microsoft. windows Mobile. status. systemState object, and register its Changed event to listen to the mobile phone status, if the status is incoming call (Microsoft. windows Mobile. status. systemState. phoneIncomingCall), the program starts to work. First, record the telephone number, display it in the list of the main interface, and then stop the phone. Currently, I use the following method to simulate an End key click operation (such code can be seen everywhere on the Internet ):

   1: using System.Runtime.InteropServices;
   2:  
   3: namespace Autumoon.WindowsMobile6.PhoneBuddy
   4: {
   5:     public static class Keyboard
   6:     {
   7:         // Use keybd_event API to send click message to system.
   8:         [DllImport("coredll.dll")]
   9:         public static extern void keybd_event(
  10:             byte bVk,
  11:             byte bScan,
  12:             int dwFlags,
  13:         int dwExtraInfo);
  14:     }
  15:  
  16:     public sealed class VirtualKey
  17:     {
  18:         // The VK value of End button is F4.
  19:         private const int VK_F4 = 0x73;
  20:         private const int KEYEVENTF_KEYUP = 0x0002;
  21:  
  22:         /// <summary>
  23:         /// Simulate one click operation.
  24:         /// </summary>
  25:         internal static void DropCall()
  26:         {
  27:             Keyboard.keybd_event(VK_F4, 0, 0, 0);
  28:             Keyboard.keybd_event(VK_F4, 0, KEYEVENTF_KEYUP, 0);
  29:         }
  30:     }
  31: }

After hanging up the phone, it is necessary to send a text message of the nature of the message to avoid the worries of VIP characters (parents, close friends, creditors, etc, the text message content can be customized (currently, MMS is not supported). The default message is "Sorry, I'm busy now. ". SMS sending is very simple ,. NET Compact Framework provides Microsoft. windows Mobile. pocketOutlook. smsMessage class, as long as you have filled in the necessary information, you can use the Send () method of SmsMessage to Send the text message.

After debugging several times, although the function is very small, it is very practical and does not need to buy Professional-level call management software, I have been able to ride on the tennis court without distractions through my own work (Sorry, too exaggerated :))!

To sum up, the Windows Mobile platform is easy for developers to develop. Excellent development tools, rich development resources, and easy-to-use running platforms can greatly save development time and improve efficiency. For non-professional mobile developers like me, I don't need to crack hack like a Hacker, and then shake my cell phone and say, "You see, it can work like this !" I only want to use a few lines of code to expand its functions and applications. Even simple functions bring great convenience to my life and work, who wants to say, "Hello, James, help me see if I have a phone number." What about it?

Next, when I am free, I will try to spend some time improving the features of this software, and I will be happy to share with you the fruits of my work! By the way, I gave it a name:Phone Buddy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.