MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Any idea how to drop an incoming call?

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> Compact Framework
Author Message
diesel power



Joined: 08 Feb 2008
Posts: 2

PostPosted: Fri Feb 08, 2008 5:19 am    Post subject: Any idea how to drop an incoming call? Reply with quote

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

Archived from group: microsoft>public>dotnet>framework>compactframework
Back to top
View user's profile Send private message
Peter Foot



Joined: 01 Sep 2007
Posts: 14

PostPosted: Fri Feb 08, 2008 3:03 pm    Post subject: Re: Any idea how to drop an incoming call? Reply with quote

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 MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

"diesel power" wrote in message @v4g2000hsf.googlegroups.com...
> 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
Back to top
View user's profile Send private message
diesel power



Joined: 08 Feb 2008
Posts: 2

PostPosted: Fri Feb 08, 2008 12:47 pm    Post subject: Re: Any idea how to drop an incoming call? Reply with quote

On Feb 8, 12:03 pm, "Peter Foot"
wrote:
> 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
>
> "diesel power" wrote in message
>
> @v4g2000hsf.googlegroups.com...
>
> > 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

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Implement Drag and Drop in CF Hi frnds, I'm supposed to provide to drag and drop an item from its existing position to a new position in a list view. I know that drag and drop is not supported in CF, is there any way out to handle the above functionality ? Mouse Down, Mouse Up and Mou

XML over GPRS - Is this a good idea????? Hi All I was hoping some one could give me some guidance on the matter of sending data over GPRS. I have taken over an application written for Windows mobile 5.0 with VS2005. It is currently communicating with a web service via GPRS. The Web service place

RichTextBox Drag and Drop Gurus, Does anyone out there know how to do custom drag and drop on a RichTextBox? I can do this on any control but a RichTextBox. Lets say I have a class called "MyClass". Well, I put it in the drag drop buffer by calling DoDragDrop. In the DragEnter a

Drop down list control Hi I am making a drag and drop control for a email layout. I have a drop down list used for the subject and want to allow the developer to add items to the collection of the drop down. The listitem editor works, come sup and i can add. However the moment

drag-drop in textbox Hi all, I am trying to drag-drop controls (buttons) into a textbox. For this I set the dragdrop property of the textbox as well as button to true. However I am not getting the desired effect of dragging the buttons into the textbox control. How do I go ab
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> Compact Framework All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group