Find a Lost Phone

Send Feedback

This code sample is named PhoneFinder. It demonstrates how to write an application that helps you locate your phone if you lose it.

Feature Area

Relevant APIs


To run the code sample

  1. Navigate to the solution file (*.sln), and double-click it. By default, the solution files are copied to the following folders:

    C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Samples\Cs\Phonefinder\``PhoneFinder.sln

    C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Samples\Vb\PhoneFinder\``PhoneFinder.sln

    Microsoft Visual Studio 2005 launches and loads the solution.

  2. Build the solution (Ctrl+Shift+B).

  3. Deploy the solution (F5).

If you have not installed the SDKSampleUnprivDeveloper certificate, you will need to so that your DLL and CAB projects are signed correctly

To install the SDK Sample Standard Developer Certificate from the Windows Desktop

  1. Click Start > Run.

  2. Type the path-name to SDKSampleUnprivDeveloper.pfx certificate, and click OK. By default, this is located in the following folder:

    C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Tools\
  3. Double-click the SDKSampleUnprivDeveloper.pfx certificate icon. The Certificate Import Wizard appears.

  4. Click Next. The certificate path-name is filled-in.

  5. Click Next.

  6. Click Next (you do not need a password).

  7. Click Next. Accept the default options; automatically select the certificate store based on certificate type.

  8. 9. Click Finish.

See Mobile device Security Model for further details on how to install the SDK certificates onto the mobile device, and how to use the privileged SDK certificate to sign this application.

Using the application

  • When you run the application, you have the option of setting a PIN and enabling or disabling PhoneFinder.
  • To activate PhoneFinder, send a text message from any cell phone to your phone. Enter Only the PIN in the body of the text message.
  • If enabled, your phone will wake up and start playing a sound. While playing the sound, it will also display your Owner Information so that if someone else finds your phone, they can figure out how to contact you.
  • SMS interception is used to raise an event when your PIN is sent to the phone via a text message, and the State and Notifications Broker is used to retrieve the Owner Information if it exists.
  • To play the sound, the sample uses PInvoke to call the native API, PlaySound, which plays the sound even if your PhoneProfile is set to Silent, making it very useful if you lose your phone while set to Silent.


It is assumed that your Smartphone can receive SMS text messages.

This code sample runs as an standard API. Applications that use it must be signed with an standard certificate.


Smartphone SDK: Windows Mobile 5.0 Smartphone SDK.
Development Environment: Visual Studio 2005.
ActiveSync: Version 4.0.

See Also

Code Samples | Managed Code | State and Notifications Broker Reference

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.