.NET Components for Mobility

What's wrong with SystemState(SystemProperty.PhoneMissedCalls)

Last post 03-26-2010 12:27 AM by ashraf fawzy. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-13-2010 4:45 PM

    What's wrong with SystemState(SystemProperty.PhoneMissedCalls)

    Hi all ....

    I'm trying to to figure out how to add the missed call nubmers into my listview in windows
    mobile .

    Code :

     

     

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
    MonitorNotifications()
    
    End Sub
    
    
    
    Private Sub MonitorNotifications()
    
    _callInterceptor = New SystemState(SystemProperty.PhoneMissedCall)
    
    AddHandler _callInterceptor.Changed, AddressOf CallInterceptor_MissedCalls
    
    End Sub
    
    
    
    Private Sub CallInterceptor_MissedCalls(ByVal sender As Object, ByVal args As ChangeEventArgs)
    
    Dim objMissed As Object = args.NewValue
    
    Dim bMissed As Boolean = (CType(objMissed, Integer) = 0)
    
    If (bMissed = False) Then
    
    Return
    
    End If
    
    Dim item As ListViewItem = New ListViewItem((New String() {SystemState.PhoneLastIncomingCallerName, SystemState.PhoneLastIncomingCallerNumber, DateTime.Now.ToShortTimeString}))
    
    LvMsdLog.Items.Add(item)
    
    
    End Sub
     
    The first time I make a call from the Emulator everything goes well.

    The next times I try , the program doesn't add the missed calls until I dismiss
    the missed calls using the Windows Mobile itself.


    Then I'm able again to add the Missed Call into the ListView .... Then I have
    to Dismiss .... Then I'm able to add ....Then I have to dismiss.

    What is the wrong here ... Plz help.
  • 03-25-2010 7:25 AM In reply to

    Re: What's wrong with SystemState(SystemProperty.PhoneMissedCalls)

    The PhoneMissedCall is a boolean property so only changes when there is a missed call and is turned off once the user dismisses that missed call. If you want to monitor each and every missed call you can use the PhoneMissedCalls property which keeps a running total of missed calls. Each time this changes the PhoneLastIncomingCallerName property should also be updated with the latest call.

    Peter

  • 03-25-2010 9:24 AM In reply to

    Re: What's wrong with SystemState(SystemProperty.PhoneMissedCalls)

    Many thanks Peter for your help , I have another question related to this issue.

     How can I dismiss "Missed Calls" programatically ??

    My program monitor if there is new missed calls , and gives an alarm , so I want to add a button when the user clicks it , it dismisses the "Missed Calls" and my program stops alarming him about these "Missed Calls"  untill there is new one.

     

    Many thanks in advance.

  • 03-25-2010 10:30 PM In reply to

    Re: What's wrong with SystemState(SystemProperty.PhoneMissedCalls)

    Microsoft doesn't expose a method to dismiss this notification programmatically.

    Peter

  • 03-26-2010 12:27 AM In reply to

    Re: What's wrong with SystemState(SystemProperty.PhoneMissedCalls)

    Many thanks PeterFoot for your reply , I'v found a nice solution using the register value

    registry key [HKEY_CURRENT_USER\System\State\Phone] and change the value of "Missed Call Count" to zero. 

    And this will do the job

Page 1 of 1 (5 items)
Copyright © 2001-2012 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting