Code Samples
The Windows Mobile Version 5.0 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 5.0 platform. To use them, you need Visual Studio 2005, either the Windows Mobile Version 5.0 Pocket PC SDK or the Windows Mobile Version 5.0 Smartphone SDK, and ActiveSync Version 4.1. For more information on these and other Windows Mobile development tools, visit the Mobile Developer Center on MSDN.
The code samples are installed onto your workstation when you install the Pocket PC and Smartphone SDKs. Each SDK ships with code samples that are common to both platforms, as well as specific to each platform.
By default, the Pocket PC code samples are copied to the folder
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\
By default, the Smartphone code samples are copied to the folder
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Samples\
Note The majority of the code samples are C++ Win32 applications, and you will find them inside 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.
The following table contains a detailed listing of the code samples included with the Windows Mobile 5.0 Pocket PC and Smartphone SDKs.
Feature Area | Code Sample Topic | Language | PPC | SP | APIs Used | Description |
---|---|---|---|---|---|---|
ActiveSync | Sync Manager | C++ Win32 | x | x | ActiveSyncStart, ActiveSyncStop | 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: |
Camera | Camera Capture Graph | C++ Win32 | x | ICaptureGraphBuilder2 Interface | 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: |
|
Camera | C++ Win32, C# | x | x | SHCameraCapture, CameraCaptureDialog Class | Take pictures and videos using the native Camera Capture API.
Folder: |
|
Cellcore | Telephone Dialer | C++ Win32 | x | x | lineInitialize, lineNegotiateAPIVersion, lineGetDevCaps, lineDrop, lineDeallocateCall, lineClose. | Demonstrates how to dial a call with a modem using TAPI.
Folder: |
Synchronous TAPI | C++ Win32 | x | x | lineNegotiateAPIVersion, lineGetDevCaps, lineGetGeneralInfo, lineInitializeEx, lineOpen, lineClose, lineShutdown | Demonstrates ExTAPI functionality.
Folder: |
|
Asychronous TAPI | C++ Win32 | x | x | lineNegotiateAPIVersion, lineGetDevCaps, lineGetGeneralInfo, LINEINITIALIZEEXPARAMS, lineNegotiateExtVersion, lineGetOperatorStatus, lineOpen, lineClose, lineShutdown | Demonstrates ExTAPI asynchronous functionality.
Folder: |
|
Hello (SMS) | C++ Win32 | x | x | SmsSendMessage | Demonstrates simple SMS message Sender.
Folder: |
|
Hello (Telephone) | C++ Win32 | x | x | tapiRequestMakeCall | Demonstrates simple TAPI dialer.
Folder: |
|
Sending Data over SMS | C++ Win32 | x | x | WapOpen, WapSend, WapRead, WapClose | Demonstrates both sending and receiving data via the Wireless Datagram Protocol (WDP) over Short Messaging Service (SMS).
Folder: |
|
Communications | Bluetooth Device Discovery | C++ Win32 | x | Bluetooth, Winsock Support in Windows CE, WSALookupServiceBegin (Windows Sockets), WSALookupServiceNext (Windows Sockets), WSALookupServiceEnd (Windows Sockets) | Provides an implementation of simple Bluetooth device discovery via the Winsock 2 API.
Folder: |
|
Chatting over Bluetooth | C++ Win32 | x | Bluetooth | Demonstrates how to create peer-to-peer communications between two devices using Bluetooth wireless technology.
Folder: |
||
Bluetooth Event Notifications | C++ Win32 | x | Changing the Bluetooth Radio Mode, State and Notifications Broker | Demonstrates how to get notifications from the Bluetooth stack. It also shows the use of State and Notifications Broker functions to receive notifications about radio state changes.
Folder: \Bluetooth\BluetoothEvents |
||
Connection Manager Helper | 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: |
||
Time Server Synchronization | C++ Win32 | x | ConnMgrReleaseConnection, ConnMgrEnumDestinations, ConnMgrEstablishConnection | Demonstrates how to use Connection Managermob5oriConnectionManagerWindowsMobile to establish a connection to a Time Server, and synchronize the Smartphone's internal clock.
Folder: |
||
WDP over SMS | C++ Win32 | x | x | WapOpen, WapSend, WapRead, WapClose | Demonstrates how to send and receive data using the Wireless Datagram Protocol (WDP), over the Short Messaging Service (SMS) transport.
Folder: |
|
Device Configuration |
WAP Provisioning Client | C++ Win32 | x | DMProcessConfigXML | Loads WAP provisioning XML from a string resource and passes it to DMProcessConfigXML.
Folder: |
|
Setup in a CAB | C++ Win32 | x | x | Installation FunctionsCustomizing the Setup Wizard and Property Sheets for a Thin Client, Debugging Setup, CreateProcess | Demonstrates a user-interactive sample of a setup.dll that can be included in CAB files to perform complex operations.
Folder: |
|
Viewing Security Settings | C# | x | x | ProcessConfiguration, TestConfiguration | Demonstrates how work with security policies and certificates.
Folder: |
|
Direct 3D Mobile |
D3D Create Device | C++ Win32 | x | Direct3D Mobile Application Development | Creates a Direct3D device and uses it to clear the window.
Folder: |
|
D3D Vertices | 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: |
||
D3D Matrices | 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: |
||
D3D Dynamic Lighting | C++ Win32 | x | Direct3D Mobile Application Development, D3DMLIGHT, D3DM_SETLIGHT, IDirect3DMobileDevice::LightEnable | Demonstrates how to render 3D geometry with dynamic lighting.
Folder: |
||
D3D Texture Mapping | C++ Win32 | x | Direct3D Mobile Application Development, IDirect3DMobileDevice::SetTexture, IDirect3DMobileDevice::SetTextureStageState | Demonstrates how to render texture-mapped 3D geometry.
Folder: |
||
D3D Fixed Point Data | C++ Win32 | x | Direct3D Mobile Application Development | Demonstrates how to accept both floating point and fixed point (16.16) data types.
Folder: |
||
Direct Draw | DDraw Initialization | C++ Win32 | x | DirectDraw | Demonstrates how to initialize DirectDraw and create a DirectDraw surface.
Folder: |
|
DDraw and Bitmaps | C++ Win32 | x | DirectDraw | Demonstrates how to add a bitmap. Extends DDex1.
Folder: |
||
DDraw Off-Screen Surfaces | C++ Win32 | x | DirectDraw | Demonstrates the use of off-screen surfaces.
Folder: |
||
DDraw and Audio | C++ Win32 | x | DirectDraw | Demonstrates how to combine DirectDraw and waveform audio.
Folder: |
||
DDraw and Animation | C++ Win32 | x | DirectDraw | Demonstrates DirectDraw animation using overlays.
Folder: |
||
FileDRM | DRM Files | C++ Win32 | x | x | FileDrmIsDRM, FileDrmShowLicenseInfo, FileDrmVerifyRights, FileDrmCreateFile, FileDrmGetMetric, FileDrmCommitRights | Demonstrates how to use the FileDRM APIs.
Folder: |
GAPI | GAPI Application | C++ Win32 | x | x | GAPI Overview | Game API sample.
Folder: |
Imaging | Imaging | C++ Win32 | x | x | IImage, IImagingFactory | Demonstrates how to use the imaging.dll to load and display an image file.
Folder: |
Internet Explorer Mobile | AXSample | C++ ATL | x | x | ActiveX Controls, ATL, COM | Demonstrates how to use ATL to create an ActiveX control, and how to access it in a web page.
Folder: |
Web Browsing | C++ Win32 | x | HTML Control API | 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: |
||
The Browser Helper Object (BHO) | C++ ATL | x | x | IWebBrowser2, DWebBrowserEvents2 | Demonstrates now to create a Browser Helper Object (BHO), which Internet Explorer (IE) Mobile loads each time it starts up.
Folder: |
|
Using Internet Explorer Mobile In Your Application | C++ ATL | x | x | IWebBrowser2, DWebBrowserEvents2 | Demonstrates how to reuse the Internet Explorer Mobile web browser in a mobile application.
Folder: |
|
Menu extensions, POOM Named Properties | Medical History | C++ Win32 | x | IItem::SetProps, IPOutlookApp2::GetIDsFromNames, IPOutlookApp2 (IPOutlookApp::Logon, IPOutlookApp2::GetItemFromOidEx), IItem (IItem::GetProps, IItem::Save), Menu Extensibility, IContextMenu, IObjectWithSite | Demonstrates how to add a menu extension to the contacts summary card.
Folder: |
|
Message Queuing | 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: |
Messaging (MAPI) |
Push Messaging | C++ Win32 | x | x | ShellExecuteEx | 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: |
Set Message Store Properties | 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: |
|
MAPI Rules | 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: |
|
Read View Menu Extension | C++ Win32 | x | x | Menu Extensibility, IContextMenu, IObjectWithSite, MailComposeMessage | Demonstrates how to reply to an email message using a default email account.
Folder: |
|
Sending E-mail | C++ Win32 | x | x | Messaging API (MAPI), MAPILogonEx, SRowSet, IMAPISession::GetMsgStoresTable, IMAPISession::OpenMsgStore, IMAPITable::QueryRows, IMsgStore::OpenEntry, IMAPIProp::GetProps, IMAPIFolder::CreateMessage, IMessage::SubmitMessage, MAPIFreeBuffer, FreeProws | Demonstrates how to use several CEMAPI APIs.
Folder: |
|
New Messaging Transport | C++ Win32 | x | IMailSyncHandler | Demonstrates how to create a new messaging transport.
Folder: |
||
New Message Class | C++ Win32 | x | IFormProviderEx, IMailRuleClient | Implements a new message class appropriate for SMS notifications from your DVR.
Folder: |
||
Phone | Calling Card | C++ Win32 | x | IContextMenu::QueryContextMenu | Demonstrates how to make a calling card call directly from the Contacts screen.
Folder: |
|
Get Device's Phone Number | C++ Win32 | x | x | IWebBrowser2, DWebBrowserEvents2 | Demonstrates how to retrieve the phone number of a device.
Folder: |
|
Find a Lost Phone | 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: |
||
Manage SIM Contacts | C++ Win32 | x | SIM Manager, SimDeinitialize, SimGetDevCaps, SimInitialize, SimReadPhonebookEntry, Telephony | Demonstrates how to add phone numbers to, and delete phone numbers from, a Subscriber Identity Module (SIM).
Folder: |
||
POOM | Calendar List View | C++ Win32 | x | CEPROPVAL, GetCursor, IDispatch, IFolder, IItem, InitCommonControlsEx, INITCOMMONCONTROLSEX, 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: |
|
Picture Dialer | C++ Win32 | x | x | Pocket Outlook Object Model (POOM), ChooseContact | Demonstrates how to associate a phone number and picture with a digit in a grid. Pressing the digit will dial the phone number.
Folder: |
|
Register a Source Provider | 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: |
||
POOM Master | C++ Win32 | x | x | Pocket Outlook Object Model (POOM), IPOutlookApp, IPOutlookItemCollection, ITask, IContact, IAppointment, ListView_InsertItem, Date and Time Picker Controls | 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: |
|
POOM Application | 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: |
||
Add Contacts' Birthdays to Calendar | C# | x | x | Microsoft.WindowsMobile.PocketOutlook, Microsoft.WindowsMobile.PocketOutlook.Appointment, Appointment.RecurrencePattern, Recurrence | Demonstrates how to write a managed Pocket Outlook Object Model (POOM) application.
Folder: |
|
Send Meeting Requests Over SMS | C# | x | Pocket Outlook Object Model (POOM), Pocket Outlook Object Model (POOM) API, 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: |
||
SMSIM | 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: |
|
Manage Tasks | C++ Win32 | x | IPOutlookItemCollection, IRecurrencePattern, ITask | 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: |
||
POOM, PicturePicker |
Add a Contact Picture | C++ Win32 | x | x | ChooseContact, GetOpenFileNameEx, IItem | 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: |
POOM, Custom Properties |
Task Tree | C++ Win32 | x | Pocket Outlook Object Model (POOM) | Demonstrates how to display tasks in a tree view. Enables user to add new tasks to the tree.
Folder: |
|
POOM, MAPI |
Rules Client Custom Form | C++ Win32 | x | x | IMailRuleClient, IFormProviderEx | 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: |
Power Management |
Power Manager | 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: |
RAPI | CE Invoke | C++ Win32 | x | CeRapiInvoke | Demonstrates how to use the CEInvoke API for the client, and for the server.
Folder: |
|
Get Device Information | C++ Win32 | x | x | EnumDevicesIRAPIDesktop:IUnknown, IRAPIDevice::GetConnectionInfo, IRAPIDevice::GetDeviceInfo, IRAPIDevice:IUnknown, Remote API (RAPI) | Demonstrates how to use the IRAPI interfaces to get information about the Windows Mobile-based device connected through ActiveSync and the corresponding communication medium used. Once the information is collected, it is printed on the console window.
Folder: |
|
List a Directory and its Files | C++ Win32 | x | x | CeRapiInit, CeFindFirstFile, CeFindNextFile, CeFindClose, CeRapiUninit | This application runs on a desktop host computer, and demonstrates how to list a directory's files and directories on a Mobile device.
Folder: |
|
Copy a File from a Device | C++ Win32 | x | x | CeRapiInit, CeReadFile, CeCloseHandle, CeRapiUninit | This application runs on a desktop host computer, and demonstrates how to copy a file from a Mobile device to a desktop computer.
Folder: |
|
Copy a File to a Device | C++ Win32 | x | x | CeRapiInit, CeWriteFile, CeCloseHandle, CeRapiUninit | This application runs on a desktop host computer, and demonstrates how to copy a file from the desktop computer to a Mobile device.
Folder: |
|
Retrieve Registry Settings | C++ Win32 | x | x | CeRapiInit, CeRegEnumKeyEx, CeRegOpenKeyEx, CeRegEnumValue, CeRegCloseKey, CeRapiUninit | This application runs on a desktop host computer, and demonstrates how to retrieve a Mobile device's list of registry settings.
Folder: |
|
Execute an Application on a Device | C++ Win32 | x | x | CeRapiInit, CeCreateProcess, CeCloseHandle, CeRapiUninit | This application runs on a desktop host computer, and demonstrates how to execute an executable file on a Mobile device.
Folder: |
|
List all Directories and their Files | C++ Win32 | x | x | CeRapiInit, CeFindAllFiles, CeRapiFreeBuffer, CeRapiUninit | This application runs on a desktop host computer, and demonstrates how to list all of the files and directories on a Mobile device.
Folder: |
|
Communication with Sockets | C++ Win32 | x | x | EnumDevices, IRAPIDesktop:IUnknown, IRAPIDevice::GetConnectionInfo, IRAPIDevice:IUnknown | Demonstrates how to use sockets to communicate with a Windows Mobile-based device. At first hand, the application uses IRAPI interfaces to get the IP of the Windows Mobile connected through ActiveSync. In a second step, it sends a hello string and listen for the mobile device to respond back
Folder: |
|
Shell | Card Autorun | C++ Win32 | x | x | SHGetAutoRunPath | Demonstrates how to handle Autorun notifications when an MMC card is inserted/removed from the mobile device.
Folder: |
Basic Shell | 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 the Windows Mobile OS.
Folder: |
|
Calendar and DTP Controls | C++ Win32 | x | Date and Time Picker Controls | Demonstrates how to use the Calendar and DTP controls.
Folder: |
||
Context Menu Extension Handler | C++ Win32 | x | IContextMenu | 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: |
||
Currency Converter | C++ Win32 | x | CreateMutex, SHCreateMenuBar, SetFocus | Demonstrates how to port an application written for Pocket PC, and port it to Smartphone.
Folder: |
||
File System Browser | C++ Win32 | x | FindFirstFile, FindNextFile, Tree View Controls Reference | Demonstrates how to browse the file system and display all directories and files by name.
Folder: |
||
Dynamic Menu | C++ Win32 | x | SHGetSubMenu, SHSetSubMenu, CheckMenuRadioItem, CheckMenuItem, InsertMenu, DeleteMenu | Demonstrates techniques for using, getting, and setting menu handles on Pocket PC.
Folder: |
||
File Change Notification | C++ Win32 | x | SHChangeNotifyRegister, SHChangeNotifyDeregister | Demonstrates how to listen for changes to the file system.
Folder: |
||
SIP Handles | C++ Win32 | x | SipGetInfo, Common Controls, Software-Based Input Panel | Demonstrates how to use SIP functions.
Folder: |
||
HTML Viewer Host | C++ Win32 | x | Creating HTML Control | Demonstrates the programmatic accessibility of the HTML Viewer control and produces debug output based on the user actions within the control.
Folder: |
||
Hardware Navigation | C++ Win32 | x | WM_GETDLGCODE | Demonstrates how focus moves around a dialog when the user performs various hardware navigation actions.
Folder: |
||
Inbox Menu Extensions | C++ Win32 | x | x | Menu Extensibility, 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: |
|
Ink2 | C++ Win32 | x | RichInk Control Reference | Demonstrates how to stream rtf and txt formatted data into and out of a RichInk control.
Folder: |
||
Inky | C++ Win32 | x | RichInk Control Reference | Demonstrates the capabilities of the RichInk control.
Folder: |
||
List Views | C++ Win32 | x | ListView_Update | Demonstrates techniques for using the List-view Control.
Folder: |
||
Memory Watcher | C++ Win32 | x | Today Screen | Demonstrates how to create a custom Today screen item for Pocket PC.
Folder: |
||
Menu | C++ Win32 | x | Menu Extensibility | Demonstrates how to append, create, and insert sub menu items.
Folder: |
||
My Backlight | C++ Win32 | x | CPlApplet | Demonstrates how to create a simple control panel application for a Windows Mobile-based Pocket PC device.
Folder: |
||
NotifyMFC | C++ MFC | x | SHNotificationAdd, SHNotificationUpdate, SHNotificationRemove | Demonstrates the capabilities and options of the Pocket PC notifications and alerts API.
Folder: |
||
Owner Drawn List-View | C++ Win32 | x | x | ListView_GetItem, Win32 Classes, GDI Reference | Demonstrates how to implement an owner drawn List-view control. Also demonstrates how to use various List-view notification events.
Folder: |
|
Project Enumeration | C++ Win32 | x | File and Application Management API, FindWindow LoadAccelerators, OPENFILENAME, SHMENUBARINFO | Demonstrates the Project document and file manipulation API.
Folder: |
||
Registry Viewer | C++ Win32 | x | RegOpenKeyEx, RegQueryInfoKey, RegEnumValue, RegEnumKeyEx | Demonstrates to a Pocket PC registry viewer application.
Folder: |
||
Screen Resolution | C++ Win32 | x | As you are developing applications for new high-resolution Pocket PCs 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: |
|||
Resolve Host | 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: |
||
Shell Demo | 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: |
||
Spin Test | C++ Win32 | x | Common Controls, CreateWindow | Demonstrates the implementation and use of a custom control (SpinCube).
Folder: |
||
Tray Application | C++ Win32 | x | Shell_NotifyIcon | 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: |
||
Tray Task List | 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: |
||
Terminal Emulator | 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: |
||
Virtual List-View | C++ Win32 | x | x | ListView_SetItemCount, ListView_SetExtendedListViewStyle, ListView_GetExtendedListViewStyle, ListView_SetImageList, ListView_InsertColumn | Demonstrates how to use a virtual list view.
Folder: |
|
Capture Back Button Press Events | C++ Win32 | x | SHCMBM_OVERRIDEKEY, SHNavigateBack | Demonstrates how to detect when the Back Button is pressed on Smartphone, and how you can programmatically interact with it.
Folder: |
||
Close all Child Windows | 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: \Closewindow |
||
Dvorak Soft Input Panel | C++ ATL | x | IInputMethod, ATL, COM | Demonstrates how to create a custom Soft Input Panel (SIP) as a COM object. It is intended to help users and service providers in foreign countries support different languages in the SIP. The application is a COM component that implements the IInputMethod Interface.
Folder: |
||
Create a Custom Home Screen | C++ Win32 | x | IHomePlugin, IPersistStream:IPersist, IHomePluginEnvironment | Requires the installation of the SDKSamplePrivDeveloper certificate.
Folder: |
||
Create Soft Key Menus | C++ Win32 | x | AYGShell, SHCreateMenuBar, SHMENUBARINFO | Demonstrates how to create and manipulate Soft Key menus.
Folder: |
||
Create a Custom Input Method | C++ Win32 | x | SHImeSetCustomInputIcons, SHImeSetModeIcon, SHImeOnKeyPress, SHImeGetClearMessage | Requires the installation of the SDKSamplePrivDeveloper certificate.
Folder: |
||
System Information |
Crossword | 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: |
|
State and Notification Broker Viewer | 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: |
|
System Management |
Get Device ID | C++ Win32 | x | x | GetDeviceUniqueID | 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: |
ToolHelp | Process Viewer | C++ Win32 | x | x | CreateToolhelp32Snapshot | Demonstrates a process viewer for CE devices.
Folder: |
Windows | Reversi | 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 | Demonstrates how to implement the Reversi game for Pocket PC. It demonstrates drawing, game logic, and a recursive MiniMax algorithm.
Folder: |
|
SliderPuzzle | C# | x | System.Drawing Namespace, System.Windows.Forms Namespace | Demonstrates how to write a Smartphone 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: |
||
WebCrawler | C# | x | x | System.Collections Namespace, System.Diagnostics Namespace, System.IO Namespace, System.Net Namespace, System.Text.RegularExpressions Namespace, System.Threading Namespace, System.Windows.Forms Namespace | 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: |
|
CompactNav | C# | x | List-View Controls Reference, PInvoke | 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: |
||
GPS | C# | x | x | GPS Intermediate Driver Reference, PInvoke, System.Runtime.InteropServices, System.Threading Namespace, System.Windows.Forms Namespace | 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: |
|
MUIHello | 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: |
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 CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Activesync\Inc
for Pocket PC, orC:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Activesync\Inc
for Smartphone.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 CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Activesync\Lib
for Pocket PC, orC:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Activesync\Lib
for Smartphone.Navigate to Build and click ReBuild All to compile the executable file.
See Also
Send Feedback on this topic to the authors