C # cf.net provides us with a systemstate namespace. We only need to create a State object, and it will be okay to hook up an event. What Ms does on the one hand is commendable!
Microsoft. windowsmobile. Status. systemstate scall = new Microsoft. windowsmobile. Status. systemstate (Microsoft. windowsmobile. Status. systemproperty. phoneincomingcall );
Scall. Changed + = new changeeventhandler (callincoming_changed );
We hung up a change event when calling, and then we can handle it.
One way I can see on the Internet is to use the program to simulate F4 to abort the call in the change event. The Code is as follows:
[Dllimport ("coredll. DLL ")] public static extern void keybd_event (byte bvk, byte bscan, int dwflags, int dwextrainfo); you can use: keybd_event (vk_f4, 0, 0, 0); keybd_event (vk_f4, 0, keyeventf_keyup, 0 );Note:
The problem with this solution is that the incoming call firewall will not be ideal enough. It will ring before each call, and the function is not completely blocked. Ms users should be able to think of it as well.
But they asked me what to do without doing better. This is what I am wondering about. Maybe he cannot do it at the framework layer.
If you want to do a better job, you should start with the RIL layer to achieve what we need. However, Ms provides too little information about RIL. You can go:
Http://msdn.microsoft.com/en-us/library/aa919462.aspx
I wrote a simple example by myself. After compilation, the size is only 7 kb, which is quite small. Using C # To write MW programs is quite efficient, however, the functionality provided by the Compact framework is far from enough. However, I believe that Ms should soon provide us with a better framework for the impact of the iPhone on the entire functional mobile phone market, I believe Ms has this strength. The IDE provided by MS for our programmers is really incomparable. I personally think it will be useful to you :)!