Jaa


Dialing the Phone with Windows Mobile 5

Question: We are building an application that is targeting Windows Mobile 5. Part of the application requires that we dial the phone. I have heard it can be done but can’t seem to getting it working in my application. Any ideas?

Answer: Sure, Windows Mobile 5 introduces the Microsoft.WindowsMobile.Telephony namespace. This exposes a managed interface for placing calls.

Note: before trying this code make sure that you have the Windows Mobile 5 SDK installed. More information can be found here.

Follow these steps to create a simple application to dial the phone.

  1. Create a new Device project as shown above.

  1. Make sure you are using the Windows Mobile Pocket 5 Pocket PC SDK. If you are not sure use the Project – Change Target Platform to validate your platform as shown above.

  1. Drop a button on the emulator as shown above.

  1. Using the My Project set a reference to the Microsoft.WindowsMobile.Telephony as shown above.

Behind the button enter the following code:

Imports Microsoft.WindowsMobile.Telephony

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim thePhone As New Phone
        With thePhone

            ‘ confirm we want to dial

            .Talk("16033215350", True)

        End With

    End Sub

End Class

Now you can run the application. When starting the application select the Windows Mobile 5 Pocket PC Phone Emulator as shown below.

Once the application is started select the button and the button and the phone will confirm and then dial the number as shown below.

Comments

  • Anonymous
    January 22, 2006
    Good Tip Thom just I could add this link

    http://blogs.msdn.com/windowsmobile/archive/2006/01/03/509036.aspx

    To be aware of this bug.

    Regards

    Cesar
  • Anonymous
    January 22, 2006
    That's a great pointer wasn't aware of that.

    Thanks!
  • Anonymous
    February 09, 2006
    The comment has been removed
  • Anonymous
    February 09, 2006
    Been using one of the new Palm phones with Mobile 5 and I noticed the other day that it had this feature.

    Very cool!