Christian
Thu Mar 06 07:24:33 CST 2008
Try if this will work...
[DllImport("coredll.dll")]
static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int
dwExtraInfo);
const int KEYEVENTF_KEYPRESS = 0x0000;
const int KEYEVENTF_KEYUP = 0x0002;
void SendKey(Keys key) {
keybd_event((byte)key, 0, KEYEVENTF_KEYPRESS, 0); // key press
keybd_event((byte)key, 0, KEYEVENTF_KEYUP, 0); // key release
(KEYEVENTF_KEYUP)
}
void EndCall() {
SendKey(Keys.F4);
}
Call EndCall() in your reject call logic...
--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com
"Vivek Waghmare" <vivek_r_waghmare@hotmail.com> wrote in message
news:%237D6Ir4fIHA.5752@TK2MSFTNGP03.phx.gbl...
>
>
> Hi ALL
>
> Im using MS Windows 5.0 SDK, I have created a sample application, in which
> i want to reject a call on a specific condition. In order to catch the
> incoming call i have written code like this.
>
> public partial class Form1 : Form
>
> {
>
> Microsoft.WindowsMobile.Telephony.Phone m_Phone = null;
>
> Microsoft.WindowsMobile.Status.SystemState m_State = null;
>
> public Form1()
>
> {
>
> InitializeComponent();
>
> m_Phone = new Microsoft.WindowsMobile.Telephony.Phone();
>
> m_State = new
> Microsoft.WindowsMobile.Status.SystemState(Microsoft.WindowsMobile.Status.SystemProperty.PhoneIncomingCall);
>
> m_State.Changed += new
> Microsoft.WindowsMobile.Status.ChangeEventHandler(m_State_Changed);
>
> }
>
> void m_State_Changed(object sender,
> Microsoft.WindowsMobile.Status.ChangeEventArgs args)
>
> {
>
> // Reject Call for specific condition
>
> }
>
> }
>
>
>
> but in the m_State_Changed i am not able to find a way to end the call
> programatically.
>
> In one got any idea
>
>
>
> Thanks
>
> VKey
>
> "Vivek Waghmare" <vivek_r_waghmare@hotmail.com> wrote in message
> news:eIXyma0fIHA.5900@TK2MSFTNGP02.phx.gbl...
>> How to Reject an incoming call programmtically using Windows Mobile 5.0
>> SDK
>>
>
>