Phone application and hardware buttons

  • Thread starter =?iso-8859-1?Q?J=F6rg?= Schneider
  • Start date

?

=?iso-8859-1?Q?J=F6rg?= Schneider

Hi,

I am stuck with my first VB.Net and Compact Framework project (I come
from Delphi) and need a little help to get started

Requirements:
My Application has to replace the provider dependent phone application
on the MDA III and MDA Compact. At first it has to provide the basic
functionality, which shouldn't be too much:

- dial a number with the touchscreen
- catch incoming calls
- start the application when the green phone-button is pressed

Well, I am already stuck at the beginning:

a) Replacing cprog.exe
At first I tried to replace the original phone application with my
self-written program, but without success. I couldn't delete, rename or
replace the file. On the internet I found the information that the
cprog.exe lies in ROM and therefore can't be deleted.

b) Catching the phone buttons
The green and red phone buttans can't be catched via
Microsoft.WindowsCE.Forms.HardwareButton... After a few tries I found
out that they must be VK_F3 and VK_F4 - but the handling doesn't work
stable (cprog.exe is started even when I "eat" the event with
KeyEventArgs.Handled, sometimes the events arent sent etc.)
After searching the Internet for a long time I found references to the
function GetAsyncKeyState, but don't know how to implement it - I think
I need a working VB.Net example here.

c) Registry
In the registry, the cprog.exe is associated a few times, but when I
change a value (try to point to my application) it is ignored


A possible solution to my problems with a complete different approach is
mentioned by the user mamaich in a web forum:

http://forum.xda-developers.com/viewtopic.php?p=140351

Quote:
"As you know OS communicates with GSM device through a COM-port. It
sends normal AT-commands. You can hook the COM-port, parse ATDxxx and
modem's responces and hide unneeded commands."

This leads to my next problem:

d) Serial port
The following code lists the Com-ports 1-6 and 8-9, but it doesn't tell
me what port I can/must use:

For Each sp As String In System.IO.Ports.SerialPort.GetPortNames
CB_COMPORTS.Items.Add(sp)
Next

How can I detect *robust* of which type a Com-port is (Bluetooth,
virtual, Irda etc) and use it then? Is a .Close() followed by a .Open()
sufficient?


Sorry it's much text, but I hope that somebody of you can point me in
the right direction. Since, as I already mentioned, this is my first
VB.Net project I appreciate every piece of code.

-Jörg

PS: Sine I didn't know in which group I should write I did a rather big
crosspost - please set the appropriate follow-up
 
Ad

Advertisements

K

Ken Tucker [MVP]

Hi,

Check out open net cf they have made a open source project that
extends the compact framework which I think might help you.

http://www.opennetcf.org/CategoryView.aspx?category=Home

Ken
-------------------
Hi,

I am stuck with my first VB.Net and Compact Framework project (I come
from Delphi) and need a little help to get started

Requirements:
My Application has to replace the provider dependent phone application
on the MDA III and MDA Compact. At first it has to provide the basic
functionality, which shouldn't be too much:

- dial a number with the touchscreen
- catch incoming calls
- start the application when the green phone-button is pressed

Well, I am already stuck at the beginning:

a) Replacing cprog.exe
At first I tried to replace the original phone application with my
self-written program, but without success. I couldn't delete, rename or
replace the file. On the internet I found the information that the
cprog.exe lies in ROM and therefore can't be deleted.

b) Catching the phone buttons
The green and red phone buttans can't be catched via
Microsoft.WindowsCE.Forms.HardwareButton... After a few tries I found
out that they must be VK_F3 and VK_F4 - but the handling doesn't work
stable (cprog.exe is started even when I "eat" the event with
KeyEventArgs.Handled, sometimes the events arent sent etc.)
After searching the Internet for a long time I found references to the
function GetAsyncKeyState, but don't know how to implement it - I think
I need a working VB.Net example here.

c) Registry
In the registry, the cprog.exe is associated a few times, but when I
change a value (try to point to my application) it is ignored


A possible solution to my problems with a complete different approach is
mentioned by the user mamaich in a web forum:

http://forum.xda-developers.com/viewtopic.php?p=140351

Quote:
"As you know OS communicates with GSM device through a COM-port. It
sends normal AT-commands. You can hook the COM-port, parse ATDxxx and
modem's responces and hide unneeded commands."

This leads to my next problem:

d) Serial port
The following code lists the Com-ports 1-6 and 8-9, but it doesn't tell
me what port I can/must use:

For Each sp As String In System.IO.Ports.SerialPort.GetPortNames
CB_COMPORTS.Items.Add(sp)
Next

How can I detect *robust* of which type a Com-port is (Bluetooth,
virtual, Irda etc) and use it then? Is a .Close() followed by a .Open()
sufficient?


Sorry it's much text, but I hope that somebody of you can point me in
the right direction. Since, as I already mentioned, this is my first
VB.Net project I appreciate every piece of code.

-Jörg

PS: Sine I didn't know in which group I should write I did a rather big
crosspost - please set the appropriate follow-up
 

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

Top