ok..... the code b'c' iknw u need im just curious if anyone has a link cause ive tried that''''' fail
Main Topics
Browse All Topicshow do i end a call with windows mobile. I dont know how to use TAPi but basically i have an if statement and inside there i want to basically have a function to end the call or press the RED button.. (on any device)? how would this be done in windows mobile under visual c#? thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
ok but that is using the TAPI dword adresses (unless some can explain how)? i need something simpler or someone to take it out of the dword and insert lol. I am a code newb and im looking for something to just literally copy and paste into the if () area or maybe some prerequ's in public namespace. All in all though i need something that is taht easy, im way to "noob" at coding for the advanced TAPI situation..
Thanks>
//F4 = red buton (hangup)
keybd_event(Keys.F4, 0, KeyEvent.KEYEVENTF_KEYDOWN
keybd_event(Keys.F4, 0, KeyEvent.KEYEVENTF_KEYUP, 0);
......
//simulate key press using P/Invoke
[DllImport("coredll.dll")]
public void keybd_event(Keys bVk, byte bScan, KeyEvent dwFlags, int dwExtraInfo);
is it enough for "cut'n'paste" ? :)
well, pardon me if it sounds rude, but if you can get it fine from the web, why on earth are you asking the questions? :)
- if() block should contain
/F4 = red buton (hangup)
keybd_event(Keys.F4, 0, KeyEvent.KEYEVENTF_KEYDOWN
keybd_event(Keys.F4, 0, KeyEvent.KEYEVENTF_KEYUP, 0);
- where you have all "using" statements
using System.Runtime.InteropServ
- somewhere in your class outside the fucntions etc
//simulate key press using P/Invoke
[DllImport("coredll.dll")]
public void keybd_event(Keys bVk, byte bScan, KeyEvent dwFlags, int dwExtraInfo);
I do advise you to open ANY C# tutorial, otherwise any further discussion makes no sense as you will keep saying "but I'm talking..." whatever I or anyone else posts.
oops, right, add the following instead of DllImport declaration:
const int KEYEVENTF_KEYUP = 0x2;
const int KEYEVENTF_KEYDOWN = 0x0;
// I've added "static extern" so (1) VS doesn't try to find that anywhere in your code
// and (2) it can be accessed without creating the instance of the class
// Besides, I've replaced KeyEvent enum by simple int parameter
[DllImport("coredll.dll")]
public static extern void keybd_event(Keys bVk, byte bScan, int dwFlags, int dwExtraInfo);
Then when you call key_event() - remove "KeyEvent." part and see what happens on real device
literally as I've written :)
replace
[DllImport("coredll.dll")]
public void keybd_event(Keys bVk, byte bScan, KeyEvent dwFlags, int dwExtraInfo);
by
const int KEYEVENTF_KEYUP = 0x2;
const int KEYEVENTF_KEYDOWN = 0x0;
[DllImport("coredll.dll")]
public static extern void keybd_event(Keys bVk, byte bScan, int dwFlags, int dwExtraInfo);
and then
keybd_event(Keys.F4, 0, KeyEvent.KEYEVENTF_KEYDOWN
keybd_event(Keys.F4, 0, KeyEvent.KEYEVENTF_KEYUP, 0);
by
keybd_event(Keys.F4, 0, KEYEVENTF_KEYDOWN, 0);
keybd_event(Keys.F4, 0,KEYEVENTF_KEYUP, 0);
Business Accounts
Answer for Membership
by: alexey_gusevPosted on 2009-09-28 at 16:32:55ID: 25444558
if you don't want to deal with TAPI, then look for cprog.exe - that's the phone application from Microsoft - you see on standard phone. some vendors might replace it with their own.
So find a process id of such app, then enumerate the windows to detect which one belongs to that process and finally send WM_KEYDOWN and WM_KEYUP to that window to simulate RED button press (you can look for its exact code in SDK headers)