1 / 33

What’s New For Native Code Developers In Windows Mobile

What’s New For Native Code Developers In Windows Mobile. Marcus Perryman Microsoft marcpe@microsoft.com http://blogs.msdn.com/marcpe. Agenda. Using Visual Studio 2005 for C++ development Building your first app Tools and debugging Multiple targets State Notification Broker

axl
Download Presentation

What’s New For Native Code Developers In Windows Mobile

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What’s New For Native Code Developers In Windows Mobile Marcus Perryman Microsoft marcpe@microsoft.com http://blogs.msdn.com/marcpe

  2. Agenda • Using Visual Studio 2005 for C++ development • Building your first app • Tools and debugging • Multiple targets • State Notification Broker • Embedded Database • POOM • Digital Rights Management • Global Positioning Broker • API’s: • Active Sync, Pictures and Contact, Query Policy, GetDeviceUniqueID

  3. ! Agenda What we will not cover, but is still interesting to Native developers: • DirectDraw • Direct3D • DirectShow • Windows Media Player • SQL Mobile • MFC, ATL

  4. Visual Studio 2005 • Single environment for Managed and Native development • SDK plug-in model • Device cross-compilers • Remote Tools • Emulator integration • Help System

  5. Developing with Visual Studio 2005

  6. Softkeys For Pocket PC • SHCreateMenuBar • SHCMBF_HMENU • Removes need for command bar • 2 top level menu’s supported • Smartphone *ONLY* 2 entries • SHEnableSoftkey – enable / disable

  7. Softkeys

  8. State And Notification Broker • Unified broker model for propagating system or application events in a publisher / subscriber model • Driven through registry keys • Transient and Persistent notification model • Conditional notification • Extensible model

  9. State Notification Categories • > 100 states declared in SNAPI.H • System Wide: • Network Connections • WiFi, GPRS, desktop, modem • Misc • Display orientation, Cradled, Battery • Application: • Phone: • Missed call, Phone status, Caller ID info • Calendar • Current Appointment, Next Appointment • Messaging • Unread number of email, SMS, etc.

  10. Transient Notifications • Notified only when app is running • Notification methods • RegistryNotifyWindow • PostMessage for delivery • RegistryNotifyMsgQueue • Local MSMQ message • RegistryNotifyCallback • Direct callback (background thread) • Requests do not survive soft reset • Invalid hWnd removes registration

  11. Conditional Notifications • DWORD conditional operators • ==, !=, >, >=, <, <= • String conditional operators • ==, !=, >, >=, <, <=, contains, starts with, ends with • No conditions on binary data

  12. Persistent Notifications • Application launched if not already running • RegistryNotifyApp • Notification methods • Command line • Window Message • Direct registry provision [HKEY_LOCAL_MACHINE\System\Notifications\MyNotification] • Persists across reboot

  13. Persistent Notification • [HKEY_LOCAL_MACHINE\System\Notifications\MyNotification] • "HKEY"=dword:0x80000001 • "Key"="System\\State\\Battery" • "Value Name"="Main" • "Application"="MyApp.exe param1 param2" • "Class Name"="MyWndClass" • "Window Name"="My Window" • "Message"=dword:400 • "Flags"=dword:1 • "Conditional Comparison"=dword:5 ; REG_CT_LESS • "Conditional Target"=dword:F #include <RegExt.h> #include <SnApi.h> RegistryNotifyApp(SN_POWERBATTERYSTRENGTH_ROOT, SN_POWERBATTERYSTRENGTH_PATH, SN_POWERBATTERYSTRENGTH_VALUE, L“BatteryChange”, L“\\Program Files\\My App\\MyApp.exe”, L“MyWindowClass”, L“MyWindow”, WM_MYWINDOWMESSAGE, 0, NULL);

  14. Notification Broker

  15. EDB • Replaces CEDB • API very similar

  16. POOM • Properties: • Add custom properties • Read bulk properties • Change Notifications • Appointments, Tasks, Contacts • Insert, update, delete notifications • PIMPR_FOLDERNOTIFICATIONS folder property

  17. POOM – Notifications • How to register propval.propid = PIMPR_FOLDERNOTIFICATIONS; propval.val.ulVal = PIMFOLDERNOTIFICATION_LOCAL | PIMFOLDERNOTIFICATION_REMOTE; pItemFolder->SetProps(0, 1, &propval); SDK Sample: CalendarView

  18. POOM – Notifications IPOutlookApp2 *polApp; … polApp->Logon((long)hWnd) LRESULT CALLBACK WndProc(…) { switch (msg) { case PIM_ITEM_CREATED_LOCAL: case PIM_ITEM_DELETED_LOCAL: case PIM_ITEM_CHANGED_LOCAL: case PIM_ITEM_CREATED_REMOTE: case PIM_ITEM_DELETED_REMOTE: case PIM_ITEM_CHANGED_REMOTE: oid = wParam; olFolder = lParam;

  19. GPS Intermediate Driver • Today GPS feed is single client • Serial port limitation • GPS Intermediate: • Parses, multiplexes, notifies • GPSOpenDevice() • GPSCloseDevice() • GPSGetPosition() • GPSGetDeviceState()

  20. Digital Rights Management • File-based rights protection • Device-locked • Cert specific to device • Time or count-bases limits • Pluggable engines • For encryption / decryptions • API: • FileDrmVerifyRights – verify file protection • FileDrmCreateFile – as per CreateFile • FileDrmCommitRights – for count based limit

  21. DRM

  22. Sound Settings • Soundfile.h • Manage user’s sound settings • Ring tones • Global sound settings (PPC Only) • SndSetSound

  23. Sound Settings

  24. Messaging Application • Drives the UI • MailComposeMessage • MailDisplayMessage • MailSwitchToFolder • MailSwitchToAccount • MailSyncMessages • CeMapi.h

  25. Messaging and Active Sync control

  26. Image Integration • New COM object for image load and display: • IImagingFactory, IImage • png, bmp, gif, jpg, ico support CoCreateInstance (CLSID_ImagingFactory, … IID_IImagingFactory,…) pImgFactory->CreateImageFromFile( L"flower.jpg", &pImage); pImage->Draw(hdc, &rc, NULL);

  27. Image Integration • Picture Picker: • Image or Video file • GetOpenFileNameEx • Links to camera capture dialog

  28. Image Integration • Camera Capture: • Image or Video captured to file of your choice • SHCameraCapture • For fine control of camera stream use Direct Show. See CameraCapture sample.

  29. Camera Capture

  30. Other API’s worthy of note • Contact Picker • ChooseContact(…) • See AddContactPicture SDK sample • Smartphone IME • Custom input mechanism for SP • Query Policy • Normal code group read only access to device policy: QueryPolicy(ID, &Out); • GetDeviceUniqueID • Normal code group, application specific • Results are != Device ID • GetDeviceUniqueID(…)

  31. ExitWindowsEx

  32. Tools & Resources Build Develop Websites msdn.microsoft.com/embedded msdn.microsoft.com/mobility Newsgroups microsoft.public.pocketpc.developer smartphone.developer dotnet.framework.compactframework microsoft.public.windowsxp.embedded windowsce.platbuilder windowsce.embedded.vc Blogs blogs.msdn.com/windowsmobilevsdteamnetcfteam blogs.msdn.com/mikehall Tools Windows CE 5.0 Eval KitWindows XP Embedded Eval Kit Windows Mobile 5.0 Eval Kit

  33. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

More Related