Use Windows Mobile to obtain and block incoming calls

Source: Internet
Author: User

I received a special task today. I got a call number from Windows Mobile. In fact, it has a call display, but now I want to write it myself.ProgramTo display the incoming call...

No way... although I have never done it... it seems that this stuff is important... so I am still confused. I am going to find information online... Yes !~~~

 

The method is as follows:

Automatic incoming call
The local method of keybd_event is used to stop the call.

Public   Static   Class Dropcall
{
# Region Private Field
// VK key F4 of the end key
Private   Const   Int Vk_f4 =   0x73 ;
Private   Const   Int Keyeventf_keyup =   Zero X 0002 ;
# Endregion

# Region Public Field
// Banned phone number list
Public   Static List < String > Bannedlist =   New List < String > ();

/**/ ///   <Summary>
/// Simulate a key operation
///   </Summary>
Public   Static   Void Drop ()
{
Myref. keybd_event (vk_f4, 0 , 0 , 0 );
Myref. keybd_event (vk_f4, 0 , Keyeventf_keyup, 0 );
}
# Endregion
}

The systemstate class and systemproperty class are used to obtain the incoming call number.

# Region Attach event Delegate
Systemstate state =   New Systemstate (systemproperty. phoneincomingcallernumber );
Systemstate SS =   New Systemstate (systemproperty. phoneincomingcall );
SS. Changed + =   New Changeeventhandler (ss_changed );
State. Changed + =   New Changeeventhandler (state_changed );
# Endregion

We use the cellular simulator to simulate incoming calls.

The program running effect is as follows:

 

In addition, you can set up a series of phone numbers that you don't want to answer, so that the program will hang them up for you.
For example:

# Region Initialize the blocked number list
Dropcall. bannedlist. Add ( " 1 (312) 132-132 " );
# Endregion

When you dial the number 13112132132 in cellular emulator, the simulator will help you stop it.

Download the complete program: dropcalldemo.rar

Required environment:Windows Mobile 6 Professional SDK. NET Compact Framework 3.5

Windows Mobile 6 Professional SDK:

Http://www.microsoft.com/downloads/details.aspx? Familyid = 06111a3a-a651-4745-88ef-3d48091a390b & displaylang = en

 

You may need to refer to the following materials:

Use of cellular emulator:Http://www.cnblogs.com/sukiwqy/archive/2009/12/06/1618192.html

Table of common Windows Mobile key values (VK:Http://www.cnblogs.com/sukiwqy/archive/2009/12/06/1618204.html

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.