locked
How to hide the call notification window? RRS feed

  • Question

  • Hi all,

    I want to disable the call notification screen when I select "Ignore" on this screen, and set focus on my application. How do I do it in native (C++)?
    - I tried to print the message when pressing "Ignore" on the call notification screen, but didn't get any event.
    Q. Do we get any event when we select "Answer" or "Ignore" on the call notification screen?
    Q. If no, is there any other way to get notification of the selection made on call notification screen?

    Kindly help me on this.

    Thanks and regards,

    Sachin.
    Tuesday, January 19, 2010 11:13 AM

Answers

  • Hi Sachin, you should be able to do it via the State & Notification Broker's PhoneCallTalking and PhoneIncomingCall system properties. Here it is a sample in C# that you should convert to native code (properties are the same): 

            public Form1()
            {
                InitializeComponent();
    
                _PhoneIncomingCall.Changed += new ChangeEventHandler(_PhoneIncomingCall_Changed);
            }
    
            bool bTalking = false;
            bool bIncoming = false;
            bool bIgnoring = false;
            SystemState _PhoneCallTalking = new SystemState(SystemProperty.PhoneCallTalking);
            SystemState _PhoneIncomingCall = new SystemState(SystemProperty.PhoneIncomingCall);
    
    
            void _PhoneCallTalking_Changed(object sender, ChangeEventArgs args)
            {
                bTalking = (0 != (int)args.NewValue);
    
                //_PhoneIncomingCall.Changed += new ChangeEventHandler(_PhoneIncomingCall_Changed);
                _PhoneCallTalking.Changed -= _PhoneCallTalking_Changed;
            }
    
            void _PhoneIncomingCall_Changed(object sender, ChangeEventArgs args)
            {
                bIncoming = (0 != (int)args.NewValue);
                if (bIncoming)
                {
                    //_PhoneIncomingCall.Changed -= _PhoneIncomingCall_Changed;
                    _PhoneCallTalking.Changed += new ChangeEventHandler(_PhoneCallTalking_Changed);
                }
                else
                {
                    //answered: bTalking = true
                    //ignored: bTalking = false
                    bIgnoring = !bTalking;
                    MessageBox.Show(string.Format("IgnoredCall: {0}", bIgnoring.ToString()));
    
                    //reset vars
                    bIncoming = false;
                    bIgnoring = false;
                    bTalking = false;
                }
            }
    



    HTH!




    Thanks,
    ~raffaele
    http://blogs.msdn.com/raffael

    This posting is provided 'as is' with no warranties and confers no rights.
    • Marked as answer by warrentang Thursday, January 21, 2010 2:07 AM
    Tuesday, January 19, 2010 4:52 PM

All replies

  • Hi Sachin, you should be able to do it via the State & Notification Broker's PhoneCallTalking and PhoneIncomingCall system properties. Here it is a sample in C# that you should convert to native code (properties are the same): 

            public Form1()
            {
                InitializeComponent();
    
                _PhoneIncomingCall.Changed += new ChangeEventHandler(_PhoneIncomingCall_Changed);
            }
    
            bool bTalking = false;
            bool bIncoming = false;
            bool bIgnoring = false;
            SystemState _PhoneCallTalking = new SystemState(SystemProperty.PhoneCallTalking);
            SystemState _PhoneIncomingCall = new SystemState(SystemProperty.PhoneIncomingCall);
    
    
            void _PhoneCallTalking_Changed(object sender, ChangeEventArgs args)
            {
                bTalking = (0 != (int)args.NewValue);
    
                //_PhoneIncomingCall.Changed += new ChangeEventHandler(_PhoneIncomingCall_Changed);
                _PhoneCallTalking.Changed -= _PhoneCallTalking_Changed;
            }
    
            void _PhoneIncomingCall_Changed(object sender, ChangeEventArgs args)
            {
                bIncoming = (0 != (int)args.NewValue);
                if (bIncoming)
                {
                    //_PhoneIncomingCall.Changed -= _PhoneIncomingCall_Changed;
                    _PhoneCallTalking.Changed += new ChangeEventHandler(_PhoneCallTalking_Changed);
                }
                else
                {
                    //answered: bTalking = true
                    //ignored: bTalking = false
                    bIgnoring = !bTalking;
                    MessageBox.Show(string.Format("IgnoredCall: {0}", bIgnoring.ToString()));
    
                    //reset vars
                    bIncoming = false;
                    bIgnoring = false;
                    bTalking = false;
                }
            }
    



    HTH!




    Thanks,
    ~raffaele
    http://blogs.msdn.com/raffael

    This posting is provided 'as is' with no warranties and confers no rights.
    • Marked as answer by warrentang Thursday, January 21, 2010 2:07 AM
    Tuesday, January 19, 2010 4:52 PM
  • Thanks Raffaele!
    Wednesday, January 20, 2010 5:33 AM