?? form1.cs
字號:
?using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.Status;
using System.Threading;
namespace PhoneState
{
public partial class Form1 : Form
{
private SystemState callState, callCount;
public Form1()
{
InitializeComponent();
ListenCall();
}
public void ListenCall()
{
callState = new SystemState(SystemProperty.PhoneCallTalking);
callCount = new SystemState(SystemProperty.PhoneActiveCallCount);
callState.Changed += new ChangeEventHandler(callState_Changed);
callCount.Changed += new ChangeEventHandler(callCount_Changed);
}
void callCount_Changed(object sender, ChangeEventArgs args)
{
if (args.NewValue != null && (int)args.NewValue !=0)
MessageBox.Show("Call Incoming...");
}
void callState_Changed(object sender, ChangeEventArgs args)
{
if (args.NewValue != null)
{
String state = ((int)args.NewValue) == 1 ? "talking..." : "hang up";
MessageBox.Show(state);
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -