Any idea how to drop an incoming call?

D

diesel power

Hi there!
Does anyone have an idea how to automatically drop an incoming call?

Imports Microsoft.WindowsMobile.Status

Public Class Form1
Dim WithEvents FromHowIGetPhoneCalls As New
SystemState(SystemProperty.PhoneIncomingCallerNumber)

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MenuItem1.Click
Me.Close()
End Sub

Private Sub FromHowIGetPhoneCalls_Changed(ByVal sender As Object,
ByVal args As Microsoft.WindowsMobile.Status.ChangeEventArgs) Handles
FromHowIGetPhoneCalls.Changed
If Not args.NewValue Is Nothing Then
If (args.NewValue.ToString.Equals("0XXXXXXX")) Then
'here must be the drop call
End If
End If
End Sub

End Class
 
P

Peter Foot

You should be able to simulate a keypress of the End key (equivalent to F4).
e.g.

//P/Invoke required
[DllImport("coredll.dll")]
internal static extern void keybd_event(byte bVk, byte bScan, int dwFlags,
int dwExtraInfo);

internal const int VK_F4 = 0x73;
internal const int KEYEVENTF_KEYUP = 0x0002;


//simulate press and release using:-

keybd_event(VK_F4, 0, 0, 0);
keybd_event(VK_F4, 0, KEYEVENTF_KEYUP, 0);

It shouldn't be too difficult to convert the snippets to VB.NET as required.

Peter
 
D

diesel power

You should be able to simulate a keypress of the End key (equivalent to F4).
e.g.

//P/Invoke required
[DllImport("coredll.dll")]
internal static extern void keybd_event(byte bVk, byte bScan, int dwFlags,
int dwExtraInfo);

internal const int VK_F4 = 0x73;
internal const int KEYEVENTF_KEYUP = 0x0002;

//simulate press and release using:-

keybd_event(VK_F4, 0, 0, 0);
keybd_event(VK_F4, 0, KEYEVENTF_KEYUP, 0);

It shouldn't be too difficult to convert the snippets to VB.NET as required.

Peter

--
Peter Foot
Microsoft Device Application Development MVPwww.peterfoot.net|www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility


Hi there!
Does anyone have an idea how to automatically drop an incoming call?
Imports Microsoft.WindowsMobile.Status
Public Class Form1
Dim WithEvents FromHowIGetPhoneCalls As New
SystemState(SystemProperty.PhoneIncomingCallerNumber)
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MenuItem1.Click
Me.Close()
End Sub
Private Sub FromHowIGetPhoneCalls_Changed(ByVal sender As Object,
ByVal args As Microsoft.WindowsMobile.Status.ChangeEventArgs) Handles
FromHowIGetPhoneCalls.Changed
If Not args.NewValue Is Nothing Then
If (args.NewValue.ToString.Equals("0XXXXXXX")) Then
'here must be the drop call
End If
End If
End Sub
End Class

thx it works
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top