Code Samples for Windows Mobile
8/28/2008
The Windows Mobile Software Developer's Kit (SDK) ships with over a hundred code samples. These are working applications that can help you learn to develop software for the Windows Mobile platform.
The code samples are installed when you install the Windows Mobile 6 Professional SDK and the Windows Mobile 6 Standard SDK . Each SDK ships with code samples that are common to both platforms, as well as samples that are specific to each platform.
By default, the Windows Mobile 6 Professional code samples are copied to the folder
C:\Program Files\Windows Mobile 6 SDK\Samples\Pocket PC\
By default, the Windows Mobile 6 Standard code samples are copied to the folder
C:\Program Files\Windows Mobile 6 SDK\Samples\Smartphone\
By default, common code samples are copied to the folder
C:\Program Files\Windows Mobile 6 SDK\Samples\Common\
The majority of the code samples are C++ Win32 applications. These are found in the CPP subfolder. To use a code sample, navigate to the solution file (*.sln) you want to study, and double-click it. Microsoft Visual Studio 2005 launches, loading the solution. You can then build the solution, modify it, and deploy it.
Note
For your convenience, each code sample topic contains the default fully-qualified path-name of the associated solution file.If you set up your development environment using the defaults, you can simply copy this information to the Clipboard, and then paste it into the Run dialog box to launch it in Visual Studio.
Note
If an error is generated when building the samples, please try copying them to another location.
The following table contains a detailed listing of the code samples included with the Windows Mobile 6 Professional SDK and the Windows Mobile 6 Standard SDK.
Feature Area | Code Sample Topic | Language | Windows Mobile 6 Professional | Windows Mobile 6 Standard | APIs Used | Description |
---|---|---|---|---|---|---|
ActiveSync |
C++ Win32 |
x |
x |
Launches and terminates sync sessions. Displays the use of State and Notification APIs to register for changes to the two sync related Status Entries. Folder : \Common\CPP\Win32\SyncManager |
||
Camera |
C++ Win32 |
x |
|
Demonstrates the basic video capture functionalities using the native Camera APIs. Captures and encodes a video clip in WMV format. Captures and encodes a still image in jpeg format. Folder : \PocketPC\CPP\win32\CameraCapture |
||
|
C++ Win32 |
x |
x |
Take pictures and videos using the native Camera Capture API. Folder : \Common\CPP\Win32\CECamera |
||
|
C# |
x |
x |
Microsoft.WindowsMobile.Forms.CameraCaptureDialog |
Demonstrates how to take pictures and videos using the CameraCaptureDialog managed API. Folder: \Common\CS\CECamera |
|
Cellcore |
C++ Win32 |
x |
x |
lineInitialize, lineNegotiateAPIVersion, lineGetDevCaps, lineDrop, lineDeallocateCall, lineClose |
Demonstrates how to dial a call with a modem using TAPI. Folder : \Common\CPP\Win32\CellCore\CeDialer |
|
|
C++ Win32 |
x |
x |
lineNegotiateAPIVersion, lineGetDevCaps, lineGetGeneralInfo, lineInitializeEx, lineOpen, lineClose, lineShutdown |
Demonstrates ExTAPI functionality. Folder : \Common\CPP\Win32\CellCore\ExTAPI |
|
|
C++ Win32 |
x |
x |
lineNegotiateAPIVersion, lineGetDevCaps, lineGetGeneralInfo, LINEINITIALIZEEXPARAMS, lineNegotiateExtVersion, lineGetOperatorStatus, lineOpen, lineClose, lineShutdown |
Demonstrates ExTAPI asynchronous functionality. Folder : \Common\CPP\Win32\CellCore\ExTAPIAsync |
|
|
C++ Win32 |
x |
x |
Demonstrates simple SMS message Sender. Folder : \Common\CPP\Win32\CellCore\SMS\HelloSMS |
||
|
C++ Win32 |
x |
x |
Demonstrates simple TAPI dialer. Folder : \Common\CPP\Win32\CellCore\TAPI\HelloTAPI |
||
|
C++ Win32 |
x |
x |
Demonstrates both sending and receiving data via the Wireless Datagram Protocol (WDP) over Short Messaging Service (SMS). Folder : \Common\CPP\Win32\CellCore\WDP_SMS |
||
Phone and Communications |
C++ Win32 |
x |
|
Bluetooth, Implementing Synchronous Device Discovery, WSALookupServiceBegin (Windows Sockets), WSALookupServiceNext (Windows Sockets), WSALookupServiceEnd (Windows Sockets) |
Provides an implementation of simple Bluetooth device discovery via the Winsock 2 API. Folder : \PocketPC\CPP\win32\Bluetooth\btsearch |
|
|
C++ Win32 |
x |
|
Demonstrates how to create peer-to-peer communications between two devices using Bluetooth wireless technology. Folder : \PocketPC\CPP\win32\Bluetooth\BthChat |
||
|
C# |
x |
x |
System.Drawing,Microsoft.WindowsMobile.SharedSource.Bluetooth |
Demonstrates how to use the Windows Embedded Source Tools for Bluetooth Technology. Folder: \Common\CS\Bluetooth\SpaceWar2D |
|
|
C++ MFC |
x |
|
ConnMgrEstablishConnection, ConnMgrConnectionStatus, ConnMgrReleaseConnection, ConnMgrMapURL, ConnMgrProviderMessage |
Demonstrates how to write a simplified Connection Manager client by deriving functionality from a helper class. Folder : \PocketPC\CPP\MFC\CMHELPER |
|
|
C++ Win32 |
|
x |
ConnMgrReleaseConnection, ConnMgrEnumDestinations, ConnMgrEstablishConnection |
Demonstrates how to use Connection Manager to establish a connection to a Time Server, and synchronize the device's internal clock. Folder : \Smartphone\CPP\Win32\CMTime |
|
|
C++ Win32 |
x |
x |
Demonstrates how to send and receive data using the Wireless Datagram Protocol (WDP), over the Short Messaging Service (SMS) transport. Folder : \Common\CPP\Win32\CellCore\WDP_SMS |
||
|
C++Win32 |
x |
x |
WapOpen, WapSend, WapRead, WapClose, WapGetNextPrimitiveSize |
Demonstrates how to use the WAP APIs at the WDP Layer. Folder : \Common\CPP\Win32\WDP |
|
|
C# |
x |
x |
SndGetSoundDirectoriesList, SndPlaySync, SndPlayAsync, SndOpen, SndStop, SndClose, PInvoke |
Scans the device for audio files and also lets you copy those files to a directory where they will be recognize as a ring tone file. It PInvokes SndPlayAsync in order to preview the ringtones. Folder : \Common\CS\RingtoneManager |
|
Device Configuration and Security |
C++ Win32 |
|
x |
DMProcessConfigXML |
Loads WAP provisioning XML from a string resource and passes it to DMProcessConfigXML. Folder : \Common\CPP\Win32\CfgClient |
|
|
C++ Win32 |
x |
x |
Demonstrates a user-interactive sample of a setup.dll that can be included in CAB files to perform complex operations. Folder : \Common\CPP\Win32\SetupDLL |
||
|
C# |
x |
x |
ProcessConfiguration, TestConfiguration |
Demonstrates how work with security policies and certificates. Folder : \Common\CS\SecurityViewer |
|
|
C++ |
x |
|
Demonstrates how to create a custom Authentication Reset Component (ARC). Folder : \PocketPC\CPP\win32\AuthReset |
||
|
C++Win32 |
x |
|
InitLAP (function), DeinitLAP, VerifyUser (LAP), VerifyUserStart, VerifyUserToTop, LAPCreateEnrollmentConfigDialog, LAPCancelVerifySequence, LAPDisplayCodeword, LAPDisplayPreWipe, LAPLockoutUser, LASSGetValue |
Implements a LAP plug-in, including all optional LAP APIs. Folder : \PocketPC\CPP\win32\LAP |
|
|
C++Win32 |
x |
|
InitLAP (function), DeinitLAP, VerifyUser (LAP), VerifyUserStart, VerifyUserStop, VerifyUserToTop, LAPCreateEnrollmentConfigDialog, LAPCancelVerifySequence, LAPDisplayCodeword, LAPDisplayPreWipe, LAPLockoutUser, LASSGetValue |
Implements a LAP plug-in, including all optional LAP APIs. Folder : \Smartphone\CPP\win32\LAP |
|
Direct 3D Mobile |
C++ Win32 |
x |
|
Creates a Direct3D device and uses it to clear the window. Folder :\PocketPC\CPP\win32\Directx\d3dm\tutorials\tut01_createdevice |
||
|
C++ Win32 |
x |
|
Direct3D Mobile Application Development, IDirect3DMobileDevice::CreateVertexBuffer |
Demonstrates the way vertices are transformed (meaning they are already in 2D window coordinates) and lit (meaning we are not using Direct3D Mobile lighting, but are supplying our own colors). Folder : \PocketPC\CPP\win32\Directx\d3dm\tutorials\Tut02_vertices |
|
|
C++ Win32 |
x |
|
Direct3D Mobile Application Development, IDirect3DMobileDevice::SetTransform |
Demonstrates the use of 4x4 matrices to transform the geometry with translations, rotations, scaling, and setting up our camera. Folder : \PocketPC\CPP\win32\Directx\d3dm\tutorials\Tut03_matrices |
|
|
C++ Win32 |
x |
|
Direct3D Mobile Application Development, D3DMLIGHT, IDirect3DMobileDevice::LightEnable |
Demonstrates how to render 3D geometry with dynamic lighting. Folder : \PocketPC\CPP\win32\Directx\d3dm\tutorials\Tut04_lights |
|
|
C++ Win32 |
x |
|
Direct3D Mobile Application Development, IDirect3DMobileDevice::SetTexture, IDirect3DMobileDevice::SetTextureStageState |
Demonstrates how to render texture-mapped 3D geometry. Folder : \PocketPC\CPP\win32\Directx\d3dm\tutorials\Tut05_textures |
|
|
C++ Win32 |
x |
|
Demonstrates how to accept both floating point and fixed point (16.16) data types. Folder : \PocketPC\CPP\win32\Directx\D3DM\tutorials\Tut06_fixedpoint |
||
Direct Draw |
C++ Win32 |
x |
|
Demonstrates how to initialize DirectDraw and create a DirectDraw surface. Folder : \PocketPC\CPP\win32\Directx\DDraw\DDex1 |
||
|
C++ Win32 |
x |
|
Demonstrates how to add a bitmap. Extends DDex1. Folder : \PocketPC\CPP\win32\Directx\DDraw\Ddex2 |
||
|
C++ Win32 |
x |
|
Demonstrates the use of off-screen surfaces. Folder : \PocketPC\CPP\win32\Directx\DDraw\Ddex3 |
||
|
C++ Win32 |
x |
|
Demonstrates how to combine DirectDraw and waveform audio. Folder : \PocketPC\CPP\win32\Directx\DDraw\Donuts2 |
||
|
C++ Win32 |
x |
|
Demonstrates DirectDraw animation using overlays. Folder : \PocketPC\CPP\win32\Directx\DDraw\Mosquito |
||
DPI Awareness |
C++ Win32 |
x |
|
ChangeDisplaySettingsEx, WM_SETTINGCHANGE, WM_SIZE, GetDeviceCaps, GetSystemMetrics, SHGetUIMetrics |
Demonstrates how to convert a basic application into a high DPI aware application and into a landscape/portrait aware application. Folder : \PocketPC\CPP\win32\Crossword |
|
|
C++ Win32 |
x |
|
As you are developing applications for new high-resolution devices with 192 DPI resolution displays, you might wonder where the new high-resolution bitmaps and resources should go. The simplest solution is to include them in the same EXECUTABLE alongside the old, low-resolution resources. However, this approach wastes storage space. Device screens only have one resolution, which never changes for that device. Therefore, if the application is deployed to a 96 DPI device, it doesn't need 192 DPI resources - and vice versa. Folder : \PocketPC\CPP\win32\Resdll |
||
EDB |
C++Win32 |
x |
x |
EDB Reference, CeOidGetInfoEx2 (EDB), CeMountDBVol (EDB), CeCreateDatabaseWithProps (EDB), CeCreateSession (EDB), CeOpenDatabaseInSession (EDB), CeSeekDatabaseEx (EDB) |
Demonstrates how an application that used CEDB can been ported to use EDB. Folder : \Common\CPP\Win32\FileDB |
|
FileDRM |
C++ Win32 |
x |
x |
FileDrmIsDRM, FileDrmShowLicenseInfo, FileDrmVerifyRights, FileDrmCreateFile, FileDrmGetMetric, FileDrmCommitRights |
Demonstrates how to use the FileDRM APIs. Folder : \Common\CPP\Win32\FileDRM |
|
Imaging |
C++ Win32 |
x |
x |
Demonstrates how to use the imaging.dll to load and display an image file. Folder : \Common\CPP\Win32\Imaging |
||
Internet Explorer Mobile |
C++ ATL |
x |
x |
Demonstrates how to use ATL to create an ActiveX control, and how to access it in a web page. Folder : \Common\CPP\ATL\AXSample |
||
|
C++ Win32 |
x |
|
Demonstrates the use of the HTML Viewer control, including the use of the DTM_NAVIGATE message to cause the control to download and display content from a URL. Folder : \PocketPC\CPP\win32\browse |
||
|
C++ ATL |
x |
x |
Demonstrates now to create a Browser Helper Object (BHO), which Internet Explorer Mobile loads each time it starts up. Folder : \Common\CPP\ATL\PIEHelper |
||
|
C++ ATL |
x |
x |
Demonstrates how to reuse the Internet Explorer Mobile web browser in a mobile application. Folder : \Common\CPP\ATL\MiniPIE |
||
Menu extensions, POOM Named Properties |
C++ Win32 |
x |
|
IItem::SetProps, IPOutlookApp2::GetIDsFromNames, IPOutlookApp2, IPOutlookApp2::GetItemFromOidEx, IItem, IContextMenu, IObjectWithSite |
Demonstrates how to add a menu extension to the contacts summary card. Folder : \PocketPC\CPP\win32\MedicalHistory |
|
Message Queuing |
C++ Win32 |
x |
x |
Using the MSMQAdm Utility, Debugging MSMQ Installations, MSMQ Reference |
Demonstrates how to use message queuing (MSMQ). It is a visual wrapper around MSMQADM.exe. Folder : \Common\CPP\Win32\MSMQ\VisAdm |
|
Messaging (MAPI) |
C++ Win32 |
x |
x |
Demonstrates a push client that receives a push message and saves the message's body into a file and then calls ShellExecuteEx on that file. Folder : \Common\CPP\Win32\FileClient |
||
|
C++ Win32 |
x |
x |
IMAPISession, IMAPITable, IMAPIProp::GetProps, IMAPIProp::SetProps |
Demonstrates how to use IMsgStore::GetProps and IMsgStore::SetProps how to retrieve and set properties on message stores. Folder : \PocketPC\CPP\win32\MailSet |
|
|
C++ Win32 |
x |
x |
IMailRuleClient, IMailRuleClient::ProcessMessage, IMailRuleClient::Initialize, IMsgStore, IMsgStore::OpenEntry, IMessage, IMAPIProp::GetProps, MAPI Properties |
Demonstrates how to implement a MAPI Rule Client, a COM object which can handle and filter incoming MAPI messages. Folder : \Common\CPP\Win32\MapiRule |
|
|
C++ Win32 |
x |
x |
Demonstrates how to reply to an email message using a default email account. Folder : \Common\CPP\Win32\ReadViewMenuExt |
||
|
C++ Win32 |
x |
x |
Messaging API (CE MAPI) Reference, MAPILogonEx, CbSRowSet, IMAPISession::GetMsgStoresTable, IMAPISession::OpenMsgStore, IMAPITable::QueryRows, IMsgStore::OpenEntry, IMAPIProp::GetProps, IMAPIFolder::CreateMessage, IMessage::SubmitMessage, MAPIFreeBuffer, FreeProws |
Demonstrates how to use several CEMAPI APIs. Folder : \Common\CPP\Win32\SendMail |
|
|
C++ Win32 |
x |
|
Demonstrates how to create a new messaging transport. Folder : \PocketPC\CPP\win32\TransportDemo |
||
|
C++ Win32 |
x |
|
Implements a new message class appropriate for SMS notifications from your DVR. Folder : \PocketPC\CPP\win32\TV_Inbox |
||
Phone |
C++ Win32 |
|
x |
Demonstrates how to make a calling card call directly from the Contacts screen. Folder : Common\CPP\Win32\CallingCard |
||
|
C++ Win32 |
x |
x |
Demonstrates how to retrieve the phone number of a device. Folder : \Common\CPP\Win32\GetPhoneNumber |
||
|
C#, VB |
|
x |
State and Notifications Broker, Microsoft.WindowsMobile.PocketOutlook.MessageInterception, Microsoft.WindowsMobile.Status, PlaySound, PInvoke |
Demonstrates how to write an application that helps you locate your phone if you lose it. Folder : \Smartphone\CS\PhoneFinder Folder : \Smartphone\VB\PhoneFinder |
|
|
C++ Win32 |
|
x |
SIM Manager Reference, SimDeinitialize, SimGetDevCaps, SimInitialize, SimReadPhonebookEntry, Telephony |
Demonstrates how to add phone numbers to, and delete phone numbers from, a Subscriber Identity Module (SIM). Folder : \Smartphone\cpp\Win32\SIMMgr |
|
POOM |
C++ Win32 |
x |
|
CEPROPVAL, GetCursor, IDispatch, IFolder, IItem, InitCommonControlsEx (function), INITCOMMONCONTROLSEX (structure), IPOutlookApp2, IPOutlookItemCollection, LoadCursor, LVCOLUMN, LVITEM, MSG, SetCursor, SHINITDLGINFO, SHMENUBARINFO |
Demonstrates how to use the POOM IItem interface for appointment items, and POOM notifications. It displays a list-view with all calendar items. Folder : \PocketPC\CPP\win32\CalendarView |
|
|
C++ Win32 |
x |
x |
Demonstrates how to associate a phone number and picture with a digit in a grid. Pressing the digit will dial the phone number. Folder : \Common\CPP\Win32\PictureDialer |
||
|
C++ Win32 |
x |
|
CEPROPVAL, IPimSrcContactListIcon::Paint, IPimSrcContactSummaryCard::Display, PIMSRC_COLOR, Source Provider Customization Type Flags |
The following application registers a source provider for the Contacts and Calendar applications. Folder : \PocketPC\CPP\win32\PimExProvider |
|
|
C++ Win32 |
x |
x |
Pocket Outlook Object Model (POOM), IPOutlookApp, IPOutlookItemCollection, ITask, IContact, IAppointment, ListView_InsertItem, Date and Time Picker Controls Reference |
Demonstrates how to use the POOM API. Via an owner-drawn list-view control, POOMMaster displays currently stored PIM items (Contacts, Tasks, and calendar Appointments). Folder : \Common\CPP\Win32\PoomMaster |
|
|
C++ Win32 |
|
x |
Demonstrates how to write a Personal Information Manager (PIM)/Messaging application that uses API members from the Pocket Outlook Object Model (POOM) to create, delete, and otherwise manage tasks. Folder : \Smartphone\cpp\Win32\poomtasks |
||
|
C++ Win32 |
x |
|
Demonstrates how to display tasks in a tree view. Enables user to add new tasks to the tree. Folder : \PocketPC\CPP\win32\TaskTree |
||
|
C# |
x |
|
Microsoft.WindowsMobile.PocketOutlook, Microsoft.WindowsMobile.Telephony |
Demonstrates how to write a Personal Information Manager (PIM)/Messaging application that uses API members from the Microsoft.WindowsMobile.PocketOutlook namespace, along with API members from the Microsoft.WindowsMobile.Telephony namespace. Folder : \PocketPC\CS\Pocketoutlooksample |
|
|
C# |
x |
x |
Microsoft.WindowsMobile.PocketOutlook, Microsoft.WindowsMobile.PocketOutlook.Appointment, Appointment.RecurrencePattern |
Demonstrates how to write a managed Pocket Outlook Object Model (POOM) application. Folder : \Common\CS\BirthdaysToCalendar |
|
|
C# |
x |
x |
Microsoft.WindowsMobile.Forms.ChooseContactDialog,Microsoft.WindowsMobile.Forms.SelectPictureDialog,Microsoft.WindowsMobile.PocketOutlook.OutlookSession,Microsoft.WindowsMobile.PocketOutlook.Contact |
Demonstrates how to use the ChooseContactDialog and the SelectPictureDialog APIs to select a contact and then attach a picture to it. Folder : \Common\CS\AddPictureToContact |
|
|
C# |
x |
|
Pocket Outlook Object Model (POOM), Microsoft.WindowsMobile.PocketOutlook Namespace |
Demonstrates how to use custom controls to pick an Appointment and a Contact, then send a meeting request to the Contact over SMS. Folder : \PocketPC\CS\AppointmentOverSms |
|
|
C# |
x |
x |
Pocket Outlook Object Model (POOM), MessageInterceptor Class |
Demonstrates how to use C# to write a managed code version of a Short Messaging Service (SMS) interception application. Folder : \PocketPC\CS\SmsIm Folder : \Smartphone\CS\SmsIM |
|
POOM, PicturePicker |
C++ Win32 |
x |
x |
Demonstrates how to allow the user to select a contact (using the Contact Chooser), select a picture (using the Picture Picker), and then adds the selected picture to the selected contact, and displays the summary card for that contact. Folder : \Common\CPP\Win32\AddContactPicture |
||
POOM, MAPI |
C++ Win32 |
x |
x |
Demonstrates how to implement a Rule Client to capture and process SMS/EMS, process multipart EMS, and implement a custom read form to display the EMS in the Inbox application. Folder : \Common\CPP\Win32\CustomForm |
||
Power Management |
C++ Win32 |
x |
x |
RequestPowerNotifications, StopPowerNotifications, SetPowerRequirement, ReleasePowerRequirement, GetSystemPowerState, SetSystemPowerState |
Demonstrates how an application can use the Power Manager APIs to register for power notifications, set minimum device power requirements, and get and set the system power state. Folder : \Common\CPP\Win32\PowerManager |
|
RAPI |
C++ Win32 |
x |
|
Demonstrates how to use the CEInvoke API for the client, and for the server. Folder : \PocketPC\CPP\win32\Ceinvoke |
||
|
C++ Win32 |
x |
x |
IRAPIDesktop::EnumDevices, IRAPIDevice::GetConnectionInfo, IRAPIDevice::GetDeviceInfo |
Demonstrates how to use the IRAPI interfaces to get information about the Windows Mobile powered device connected through ActiveSync and the corresponding communication medium used. Once the information is collected, it is printed on the console window. Folder : \Common\CPP\Win32\Rapi\DeviceInfo |
|
|
C++ Win32 |
x |
x |
CeRapiInit (RAPI), CeFindFirstFile (RAPI), CeFindNextFile (RAPI), CeFindClose (RAPI), CeRapiUninit (RAPI) |
This application runs on a desktop host computer, and demonstrates how to list a directory's files and directories on a Mobile device. Folder : \Common\CPP\Win32\Rapi\Pdir |
|
|
C++ Win32 |
x |
x |
CeRapiInit (RAPI), CeReadFile (RAPI), CeCloseHandle (RAPI), CeRapiUninit (RAPI) |
This application runs on a desktop host computer, and demonstrates how to copy a file from a Mobile device to a desktop computer. Folder : \Common\CPP\Win32\Pget |
|
|
C++ Win32 |
x |
x |
CeRapiInit (RAPI), CeWriteFile (RAPI), CeCloseHandle (RAPI), CeRapiUninit (RAPI) |
This application runs on a desktop host computer, and demonstrates how to copy a file from the desktop computer to a Mobile device. Folder : \Common\CPP\Win32\Pput |
|
|
C++ Win32 |
x |
x |
CeRapiInit (RAPI), CeRegEnumKeyEx (RAPI), CeRegOpenKeyEx (RAPI), CeRegEnumValue (RAPI), CeRegCloseKey (RAPI), CeRapiUninit (RAPI) |
This application runs on a desktop host computer, and demonstrates how to retrieve a Mobile device's list of registry settings. Folder : \Common\CPP\Win32\Pregdmp |
|
|
C++ Win32 |
x |
x |
CeRapiInit (RAPI), CeCreateProcess (RAPI), CeCloseHandle (RAPI), CeRapiUninit (RAPI) |
This application runs on a desktop host computer, and demonstrates how to execute an executable file on a Mobile device. Folder : \Common\CPP\Win32\Prun |
|
|
C++ Win32 |
x |
x |
CeRapiInit (RAPI), CeFindAllFiles (RAPI), CeRapiFreeBuffer (RAPI), CeRapiUninit (RAPI) |
This application runs on a desktop host computer, and demonstrates how to list all of the files and directories on a Mobile device. Folder : \Common\CPP\Win32\Ptree |
|
|
C++ Win32 |
x |
x |
IRAPIDesktop::EnumDevices, IRAPIDevice::GetConnectionInfo |
Demonstrates how to use sockets to communicate with a Windows Mobile powered device. At first hand, the application uses IRAPI interfaces to get the IP of the device connected through ActiveSync. In a second step, it sends a hello string and listen for the mobile device to respond back Folder : \Common\CPP\Win32\SockApp |
|
|
C++Win32 |
x |
x |
Demonstrates how to use RAPI to access EDB databases. Folder : \Common\CPP\Win32\Rapi\EdbRapi |
||
Shell |
C++ Win32 |
x |
x |
Demonstrates how to handle Autorun notifications when an MMC card is inserted/removed from the mobile device. Folder : \Common\CPP\Win32\Autorun |
||
|
C++ Win32 |
x |
x |
RegisterClass, CreateWindow, SetForegroundWindow, SHCreateMenuBar, SHInitDialog, SHGetUIMetrics, SHHandleWMActivate, SHHandleWMSettingChange, SHLoadImageResource, WM_HIBERNATE |
Demonstrates how to implement a basic application that uses the major Shell APIs to interact properly with Windows Mobile . Folder : \Common\CPP\Win32\BasicApp |
|
|
C++ Win32 |
x |
|
Demonstrates how to use the Calendar and date and time picker controls. Folder : \PocketPC\CPP\win32\CalendarAndDTP |
||
|
C++ Win32 |
x |
|
Demonstrates how to implement a context menu extension handler, and specifically one that extends the context menu in File Explorer when tapping and holding on a file. Folder : \PocketPC\CPP\win32\CtxMenu |
||
|
C++ Win32 |
|
x |
Demonstrates how to port an application written for Windows Mobile 6 Professional , and port it to Windows Mobile 6 Standard . Folder : \Smartphone\cpp\Win32\Currency |
||
|
C++ Win32 |
x |
|
Demonstrates how to browse the file system and display all directories and files by name. Folder : \PocketPC\CPP\win32\DirTree |
||
|
C++ Win32 |
x |
|
Demonstrates techniques for using, getting, and setting menu handles on Windows Mobile 6 Professional . Folder : \PocketPC\CPP\win32\Dynamenu |
||
|
C++ Win32 |
x |
|
Demonstrates how to listen for changes to the file system. Folder : \PocketPC\CPP\win32\FileChangeNotif |
||
|
C++Win32 |
x |
x |
Demonstrates how an application can make full use of the device screen for displaying content using several shell APIs. Folder : \Common\CPP\Win32\FullScreen |
||
|
C++ Win32 |
x |
|
SipGetInfo, Common Controls Reference, Software-based Input Panel |
Demonstrates how to use SIP functions. Folder : \PocketPC\CPP\win32\HandleSIP |
|
|
C++ Win32 |
x |
|
Demonstrates the programmatic accessibility of the HTML Viewer control and produces debug output based on the user actions within the control. Folder : \PocketPC\CPP\win32\HTMLHost |
||
|
C++ Win32 |
x |
|
Demonstrates how focus moves around a dialog when the user performs various hardware navigation actions. Folder : \PocketPC\CPP\win32\HWNavigation |
||
|
C++ Win32 |
x |
x |
IContextMenu, IObjectWithSite, IMAPIFolder::DeleteMessages, IMAPIFolder::CopyMessages |
Demonstrates how to add items to the menus which are seen while in the message list view within the Inbox (tmail.exe). Folder : \Common\CPP\Win32\InboxMenuExtensibility |
|
|
C++ Win32 |
x |
|
Demonstrates how to stream rtf and txt formatted data into and out of a RichInk control. Folder : \PocketPC\CPP\win32\Ink2 |
||
|
C++ Win32 |
x |
|
Demonstrates the capabilities of the RichInk control. Folder : \PocketPC\CPP\win32\inky |
||
|
C++ Win32 |
x |
|
Demonstrates techniques for using the List-view Control. Folder : \PocketPC\CPP\win32\ListView |
||
|
C++ Win32 |
x |
|
Demonstrates how to create a custom Today screen item for Windows Mobile 6 Professional . Folder : \PocketPC\CPP\win32\MemWatcher |
||
|
C++Win32 |
x |
|
Demonstrates how to create a custom Today screen item for Windows Mobile 6 Professional . Folder : PocketPC\cpp\win32\Memwatcher |
||
|
C++ Win32 |
x |
|
Demonstrates how to append, create, and insert sub menu items. Folder : \PocketPC\CPP\win32\Menu |
||
|
C++ Win32 |
x |
|
Demonstrates how to create a simple control panel application for a Windows Mobile powered device. Folder : \PocketPC\CPP\win32\myBackLight |
||
|
C++Win32 |
x |
|
SHNotificationAdd, SHNotificationUpdate, SHNotificationRemove |
Demonstrates how to add, update and remove tray notifications. Folder : \PocketPC\CPP\win32\notifications |
|
|
C++ MFC |
x |
|
SHNotificationAdd, SHNotificationUpdate, SHNotificationRemove |
Demonstrates the capabilities and options of the Windows Mobile 6 Professional notifications and alerts API. Folder : \PocketPC\CPP\MFC\notifyMFC |
|
|
C++ Win32 |
x |
x |
Demonstrates how to implement an owner drawn List-view control. Also demonstrates how to use various List-view notification events. Folder : \Common\CPP\Win32\OwnerListView |
||
|
C++ Win32 |
x |
|
File and Application Management, FindWindow, OPENFILENAME, SHMENUBARINFO |
Demonstrates the Project document and file manipulation API. Folder : \PocketPC\CPP\win32\ProjectEnumeration |
|
|
C++ Win32 |
x |
|
Demonstrates to a Windows Mobile 6 Professional registry viewer application. Folder : \PocketPC\CPP\win32\Regviewer |
||
|
C++ Win32 |
x |
|
Winsock Application Development, gethostbyaddr, gethostbyname |
Demonstrates how to resolve a host name (e.g. www.microsoft.com) into an IP address, or an IP address into a host name. Folder : \PocketPC\CPP\win32\Resolve |
|
|
C++ Win32 |
x |
|
SHInitDialog, SHDoneButton, SHSetNavBarText, SHFullScreen, SHGetAutoRunPath, SHCreateMenuBar, SHEnableSoftkey |
Demonstrates the Shell API's. It demonstrates how to show/hide task bars, menu bars, and SIP buttons. It also shows how to use SHInitDialog for full screen dialogs, and use SHCreateMenuBar in different ways. Folder : \PocketPC\CPP\win32\ShellApiDemo |
|
|
C++ Win32 |
x |
|
Demonstrates the implementation and use of a custom control (SpinCube). Folder : \PocketPC\CPP\win32\Spintest |
||
|
C++ Win32 |
x |
|
Demonstrates how to put an icon on the tray on the today page. It also shows how to do a popup dialog from that icon. Folder : \PocketPC\CPP\win32\Trayapp |
||
|
C++ Win32 |
x |
|
Shell_NotifyIcon, CreateToolhelp32Snapshot, Process32First, Process32Next |
Demonstrates how to get a list of running tasks (and their window names) into a popup item on the tray. Folder : \PocketPC\CPP\win32\Traytasklist |
|
|
C++ Win32 |
x |
|
CloseHandle, COMMTIMEOUTS, CreateFile, CreateThread, DCB, EscapeCommFunction, GetCommModemStatus, GetCommState, GetCommTimeouts, GetLastError, MessageBox, SetCommMask, SetCommState, WaitCommEvent |
Demonstrates how to open, configure, and close a serial communications port and perform read/write operations for a TTY terminal emulation application. Folder : \PocketPC\CPP\win32\Tty |
|
|
C++ Win32 |
x |
x |
ListView_SetItemCount, ListView_SetExtendedListViewStyle, ListView_GetExtendedListViewStyle, ListView_SetImageList, ListView_InsertColumn |
Demonstrates how to use a virtual list view. Folder : \Common\CPP\Win32\VirtualListView |
|
|
C++ Win32 |
|
x |
Demonstrates how to detect when the Back Button is pressed on Windows Mobile 6 Standard device, and how you can programmatically interact with it. Folder : \Smartphone\cpp\Win32\back |
||
|
C++ Win32 |
|
x |
GetWindow, GetWindowThreadProcessId, IsWindowVisible, IsWindowEnabled |
Demonstrates how to force an application to revert back to its base state when it is relaunched, and how to destroy a chain of child windows. Folder: \Smartphone\cpp\Win32\CloseWindow |
|
|
C++ ATL |
x |
|
Demonstrates how to create a custom Soft Input Panel (SIP) as a COM object. It is intended to help users and service providers in different regions support different languages in the SIP. The application is a COM component that implements the IInputMethod Interface. Folder : \PocketPC\CPP\ATL\DvorakSIP |
||
|
C++ Win32 |
|
x |
Requires the installation of the SDKSamplePrivDeveloper certificate. Folder : \Smartphone\cpp\Win32\HomeScreen |
||
|
C++ Win32 |
|
x |
Demonstrates how to create and manipulate Soft Key menus. Folder : \Smartphone\cpp\Win32\MenuDemo |
||
|
C++ Win32 |
|
x |
SHImeSetCustomInputIcons, SHImeSetModeIcon, SHImeOnKeyPress, SHImeGetClearMessage |
Requires the installation of the SDKSamplePrivDeveloper certificate. Folder : \Smartphone\cpp\Win32\PhoneIme |
|
Setup and Deployment |
C++Win32 |
x |
x |
Setup DLL, Wceload Tool |
Demonstrates how to create a program to unpack all the cabs in a container cab ('uber-cab'). Folder : \Common\CPP\Win32\multicabinstall |
|
System Information |
C# |
x |
x |
State and Notifications Broker, Microsft.WindowsMobile.Status Namespace |
Demonstrates how to get both state values and state change notifications from the State and Notifications Broker. Folder : \PocketPC\CS\StateAndNotificationBrokerViewer Folder : \Smartphone\CS\StateAndNotificationBrokerViewer |
|
|
C++Win32 |
x |
|
RegistryGetDWORD, RegistryNotifyWindow, RegistryNotifyCallback, RegistryNotifyApp |
Demonstrates how to use the State and Notification Broker APIs to get notified of the battery strength. Folder : \PocketPC\CPP\win32\battstat |
|
System Management |
C++ Win32 |
x |
x |
Demonstrates how to protect the privacy of a device. Multiple applications need to use a device's unique identifier to communicate with servers. To protect a device's privacy, multiple servers should not be able to correlate data from the same device. Folder : \Common\CPP\Win32\GetDeviceID |
||
ToolHelp |
C++ Win32 |
x |
x |
Demonstrates a process viewer for CE devices. Folder : \Common\CPP\Win32\PViewCE |
||
Windows |
C++ Win32 |
x |
|
CheckMenuItem, CreateWindow, DeleteObject, DialogBox, DispatchMessage, Ellipse, EndDialog, EndPaint, ExtTextOut, GetClientRect, GetDC, GetDeviceCaps, GetStockObject, GetSystemMetrics, GetTextExtentExPoint, GetTextMetrics, DefWindowProc, KillTimer, LoadAccelerators, LoadImage, LoadCursor, LocalAlloc, LocalFree, MessageBox, PostMessage, Rectangle, RegisterClass, ReleaseCapture, ReleaseDC, SelectObject, SetBkMode, SetCapture, SetFocus, SetTimer, SetWindowText, ShowWindow, TranslateAccelerator, TranslateMessage |
Implements the Reversi game for Windows Mobile 6 Professional . It demonstrates drawing, game logic, and a recursive MiniMax algorithm. Folder : \PocketPC\CPP\win32\Reversi |
|
|
C# |
|
x |
Demonstrates how to write a Windows Mobile 6 Standard application in C#. The application is a game where the object is to unscramble the tiles. You can only slide the puzzle pieces into the space that is empty. Folder : \Smartphone\CS\SliderPuzzle |
||
|
C# |
x |
x |
System.Collections, System.Diagnostics, System.IO, System.Net Namespace, System.Text.RegularExpressions, System.Threading, System.Windows.Forms |
Demonstrates how to use managed code to write a C# Windows Mobile application. The application counts the links on a web site, and also counts all of the links that branch from the web site. When done, WebCrawler displays a listing of the results. Folder : \PocketPC\CS\WebCrawler |
|
|
C# |
|
x |
Demonstrates how to implement a basic .NET Compact Framework file-system navigator, as well has how to use "Platform Invoking" (PInvoke) to make calls to unmanaged APIs (in this case, CreateProcess). Folder : \Smartphone\CS\CompactNav |
||
|
C# |
x |
|
GPS Intermediate Driver Reference, PInvoke, System.Runtime.InteropServicesSystem.Runtime.InteropServices, System.Threading, System.Windows.Forms |
Demonstrates how to use managed code to write a C# Windows Mobile Global Positioning System (GPS) application. This code sample demonstrates how to wrap the native GPS APIs in a C# class. It demonstrates how to use "Platform Invoking" (PInvoke) to make calls to unmanaged APIs (in this case, CreateProcess). Folder : \PocketPC\CS\GPS |
|
|
C++ |
x |
x |
GPS_DEVICE, GPS_POSITION, GPSCloseDevice, GPSGetDeviceState, GPSGetPosition, GPSOpenDevice |
Demonstrates how to use native GPS Intermediate Driver Reference to asynchronously retrieve the location data and the GPS Intermediate Driver state. Folder : \Common\CPP\Win32\gps\ |
|
|
C++ Win32 |
|
x |
Input Method Manager (IMM) Reference, Multilingual User Interface (MUI) Reference, National Language Support (NLS) Reference |
Demonstrates how to write a Multilingual User Interface (MUI) version of a "Hello World!" application. Folder : \Smartphone\cpp\Win32\muihello |
|
Windows Mobile Ink |
C++Win32 |
x |
|
Demonstrates how to use Windows Mobile Ink to to allows a user to input text with the stylus, and then use Windows Mobile Ink to recognize the text. Folder : \PocketPC\CPP\win32\WISPLite\BasicRecognition |
||
|
C++Win32 |
x |
|
Demonstrates how to use Windows Mobile Ink to view and edit ink notes. These ink notes can also be imported to OneNote on the desktop. Folder : \PocketPC\CPP\win32\WISPLite\InkNotes |
||
|
C++Win32 |
x |
|
Demonstrates how to use Windows Mobile Ink to allow a user to sign on a region and save the signature along with the user's name in a file.Folder : \PocketPC\CPP\win32\WISPLite\InkSerialization |
||
Windows Media Player |
C++ATL |
x |
|
Windows Media Player OCX |
Demonstrates how to use the Windows Media Player ATL control from a Win32 application. Folder : \PocketPC\CPP\ATL\WmpSample |
|
|
C++Win32 |
|
x |
IHomePlugin, IPersistStream, IHomePluginEnvironment2, IWMPPluginUI, IWMPEvents |
Implements a homescreen plug-in that allows the user to view information about the current media item playing in Windows Media Player, and provides controls to pause or restart playback, to move to the next media item in the current playlist, and to move to the previous media item in the current playlist. Folder: \Smartphone\CPP\Win32\MediaPlayerHomePlugin |
Remarks
You must compile these applications with Visual Studio 2005 or newer.
To setup the Visual Studio environment
Open the solution file in Visual Studio.
Navigate to Tools > Options.
Expand Projects and Solutions.
Click VC++ Directories.
In Show directories for: select Include files.
Add the path to the mobile device include directory. If you accepted the defaults when installing Windows Mobile SDK, then the new directory will be
C:\Program Files\Windows Mobile 6 SDK\Activesync\Inc
In Show directories for: select Library files.
Add the path to the mobile device library directory. If you accepted the defaults when installing Windows Mobile SDK, then the new directory will be
C:\Program Files\Windows Mobile 6 SDK\Activesync\Lib
Navigate to Build and click ReBuild All to compile the executable file.