How to get Phone Call History in windows Phone 7

No.of Views4039
Bookmarked0 times
Downloads 
Votes0
By  j2inet   On  06 Nov 2010 00:11:31
Tag : Windows Phone , Utilities
In this codesnippet, help to get Phone Call History in windows Phone 7
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

I've always resorted to using third party utilities for collecting the call history in my Windows Phone. But some one in the forums asked how to retrieve the call history. I finally took a look at this and it was much easier than I thought. The process is as simple as opening a handle to the call history, reading the call history, and then closing the handle. I put together the following code example for the user in the forums that had asked about it and thought to share it here.

Code

#include "stdafx.h"#include "phone.h"int _tmain(int argc, _TCHAR* argv[])
{
    HANDLE callLogHandle;
    CALLLOGENTRY logEntry;if(S_OK!=PhoneOpenCallLog(&callLogHandle))return -1;//failurelogEntry.cbSize = sizeof(CALLLOGENTRY);while(S_OK==PhoneGetCallLogEntry(callLogHandle, &logEntry))
    {//The logEntry structure is populated with call data. //do something with it here.}

    PhoneCloseCallLog (callLogHandle);return 0;
}

Hopes help.

 
Sign Up to vote for this article
 
About Author
 
j2inet
Occupation-Not Provided
Company-Not Provided
Member Type-Senior
Location-Not Provided
Joined date-12 Jun 2009
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
By:John BaileyDate Of Posted:1/28/2011 8:09:17 AM
This isn't Windows Phone 7 code
This doesn't appear to be C#, and I'm pretty sure this is Windows Mobile 6.5 or earlier code rather than Windows Phone 7 code. You shold change your title to indicate that.
By:Derik WhittakerDate Of Posted:11/7/2010 10:13:49 AM
Kick ass guy
I am going to go out on a limb here and say that this code will get rejected from the marketplace upon submission
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top