Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building Great Applications For The Pocket PC Luis Esparragoza Software Test Lead Pocket-PC Microsoft Corporation 8-301.

Similar presentations


Presentation on theme: "Building Great Applications For The Pocket PC Luis Esparragoza Software Test Lead Pocket-PC Microsoft Corporation 8-301."— Presentation transcript:

1 Building Great Applications For The Pocket PC Luis Esparragoza Software Test Lead Pocket-PC Microsoft Corporation 8-301

2

3 Wyvern v. Rapier

4 Key is Simplify Remove complexity Remove complexity Setup Device and Synchronization Setup Device and Synchronization Flat controls & Page-based dialogs Flat controls & Page-based dialogs Single tap Single tap Redesign of control panels Redesign of control panels Remove redundant menus, introduce tap & hold Remove redundant menus, introduce tap & hold

5 Optimize Simplifications Optimize for form factor needs and appliance-like behavior Optimize for form factor needs and appliance-like behavior New shell arrangement (nav bar on top, menus on bottom) New shell arrangement (nav bar on top, menus on bottom) Minimize difficulty of input Minimize difficulty of input Auto save & automatic memory management Auto save & automatic memory management

6 Performance Gains Functional as well as perceived Functional as well as perceived WyvernRapier Start Menu 800ms100ms Calendar2300ms1200ms Open appt 2700ms800ms Switch to Contacts 1500ms800ms Find200ms Synch (250 appt, 200 contacts, 50 tasks, 20 messages) 130 sec 20 sec

7 App Platform Diagram WinCE 3.0 (Cedar): Win32, OLE, Winsock, etc VB MFC ADO ATL CEF Your App Goes Here GameX WinInet/URLMon pIE HTML JScript XML XSL Rapier Shell APIs POOM

8 Runtime APIs VB VB MFC MFC ATL ATL ADO ADO CEF – (Common Executable Format) CEF – (Common Executable Format) See the Tools and Data Access sessions

9 Internet Explorer for Pocket PC WinInet WinInet URLMon URLMon JScript JScript XML/XSL XML/XSL ActiveX ActiveX Oh yeah… HTML, too. Oh yeah… HTML, too. See the Web-based Applications for the Pocket PC session

10 GameX First Steps towards DirectX First Steps towards DirectX Performance! Performance! Better access to device frame buffers Better access to device frame buffers Describes HW buttons and facilitates remapping Describes HW buttons and facilitates remapping Device independent! Device independent! See the GameX session

11 Pocket Outlook Object Model No more ABAPI No more ABAPI POOM = stripped down desktop Outlook Object Model POOM = stripped down desktop Outlook Object Model

12 Rapier UI APIs Maintain Windows affinity w/o being shrunken down Windows Maintain Windows affinity w/o being shrunken down Windows A few Rapier specific APIs A few Rapier specific APIs Limited new APIs Limited new APIs As automatic as we could As automatic as we could Largely UI design shift Largely UI design shift See the Rapier UI session

13 Tools Emulation Emulation Device direct Device direct Embedded Visual Studio Embedded Visual Studio Rapier MFC Wizards Rapier MFC Wizards Menu editor Menu editor See the Tools session

14 UI Design Principles The form factor is critical, optimize for it The form factor is critical, optimize for it Design for the 80% / 20% case rather than the 100% case Design for the 80% / 20% case rather than the 100% case More content, less app More content, less app Reduce redundancy, and reduce effort Reduce redundancy, and reduce effort Windows affinity, not wholesale copy Windows affinity, not wholesale copy Consistency with what users expect, not for its own sake Consistency with what users expect, not for its own sake Ease up on the eyes Ease up on the eyes Simple NOT simplistic Simple NOT simplistic

15 New Shell Nav bar on top (start button + title bar), command bar on bottom, system tray on home screen only New User Model Single tap, autosave everywhere, close cards/documents (no cancel) Flat look & feel Pages instead of cascading menus, flat buttons, fewer controls Feature consolidation Removed redundant menus/buttons, Redesigned control panel Client Area New Start Menu App Name SIP Command Bar App Menu Redesigned UI

16 Navigation Bar Foofy Design Stuff Foofy Design Stuff Start at 0,0, prime real estate Start at 0,0, prime real estate Title should only be app name, should not change Title should only be app name, should not change Instantly conveys a sense of place Instantly conveys a sense of place OK button, closes dialogs & docs OK button, closes dialogs & docs No cancel, just undo No cancel, just undo Read is often different from edit Read is often different from edit Tray objects only appear on Today Tray objects only appear on Today

17 Navigation Bar (dev part 1 of 3) Respecting space Respecting space CreateWindows at CW_USEDEFAULT, CW_USEDEFAULT origin, NOT at (0,0) CreateWindows at CW_USEDEFAULT, CW_USEDEFAULT origin, NOT at (0,0) And/Or use SHSipInfo: And/Or use SHSipInfo: si.cbSize = sizeof(si); si.cbSize = sizeof(si); if( SHSipInfo(SPI_GETSIPINFO, 0, &si, 0) ) if( SHSipInfo(SPI_GETSIPINFO, 0, &si, 0) ) { if (dwStyle & WS_POPUP) if (dwStyle & WS_POPUP) { x = si.rcVisibleDesktop.left; x = si.rcVisibleDesktop.left; y = si.rcVisibleDesktop.top; y = si.rcVisibleDesktop.top; } //Consider the menu at the bottom, please. //Consider the menu at the bottom, please. iDelta = (si.fdwFlags & SIPF_ON) ? 0 : MENU_HEIGHT; iDelta = (si.fdwFlags & SIPF_ON) ? 0 : MENU_HEIGHT; cx = si.rcVisibleDesktop.right - si.rcVisibleDesktop.left; cx = si.rcVisibleDesktop.right - si.rcVisibleDesktop.left; cy = si.rcVisibleDesktop.bottom - si.rcVisibleDesktop.top - iDelta; cy = si.rcVisibleDesktop.bottom - si.rcVisibleDesktop.top - iDelta; hwnd = CreateWindow(lpClassName, lpWindowName, dwStyle, hwnd = CreateWindow(lpClassName, lpWindowName, dwStyle, x, y, cx, cy, hWndParent, hMenu, hInstance, lpParam); x, y, cx, cy, hWndParent, hMenu, hInstance, lpParam); }

18 Navigation Bar (dev part 2 of 3) Shared Resources Shared Resources Title – Comes from your top level windows GetWindowText(); Title – Comes from your top level windows GetWindowText(); OK button OK button Remove WS_CAPTION and WS_SYSMENU bits, add WS_EX_CAPTIONOKBTN Remove WS_CAPTION and WS_SYSMENU bits, add WS_EX_CAPTIONOKBTN For Dialogs, use SHInitDialog: For Dialogs, use SHInitDialog: SHINITDLGINFO shidi; SHINITDLGINFO shidi; shidi.hDlg = hwnd; shidi.hDlg = hwnd; shidi.dwMask = SHIDIM_FLAGS; shidi.dwMask = SHIDIM_FLAGS; shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_DONEBUTTON; shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_DONEBUTTON; SHInitDialog(&shidi); SHInitDialog(&shidi);

19 Navigation Bar (dev part 3 of 3) Hiding the NavBar: Hiding the NavBar: SHFullScreen SHFullScreen BOOL SHFullScreen(HWND hwndRequester, DWORD dwState); SHFS_SHOWTASKBARSHFS_HIDETASKBARSHFS_SHOWSIPBUTTONSHFS_HIDESIPBUTTONSHFS_SHOWSTARTICONSHFS_HIDESTARTICON Must be foreground window Must be foreground window Do this on WM_ACTIVATE Do this on WM_ACTIVATE

20 New Menu Bar Design Stuff Design Stuff Moved to bottom so hand does not obstruct operations Moved to bottom so hand does not obstruct operations Menus & toolbar buttons mixed on ONE bar, no overlapping rebar Menus & toolbar buttons mixed on ONE bar, no overlapping rebar Tooltips Tooltips if the icon isnt 100% self-evident, just use a menu or text if the icon isnt 100% self-evident, just use a menu or text Buttons and menus are NOT redundant Buttons and menus are NOT redundant

21 New Menu Bar (dev 1 of 4) Nerd Stuff Nerd Stuff Rebars: still available, but not recommended Rebars: still available, but not recommended How you create Rapier menus: How you create Rapier menus: Code side: Code side: SHMENUBARINFO cbi = {0}; SHMENUBARINFO cbi = {0}; // Set up in parameters // Set up in parameters cbi.cbSize = sizeof(SHMENUBARINFO); cbi.cbSize = sizeof(SHMENUBARINFO); cbi.hwndParent = hwndParent; cbi.hwndParent = hwndParent; cbi.nToolBarId = IDR_MENU;// Resource id of menu cbi.nToolBarId = IDR_MENU;// Resource id of menu cbi.dwFlags = 0; cbi.dwFlags = 0; cbi.hInstRes = hInstance; // location of buttons and images cbi.hInstRes = hInstance; // location of buttons and images cbi.nBmpId = IDB_TOOLBAR; // if you have images cbi.nBmpId = IDB_TOOLBAR; // if you have images cbi.cBmpImages = 3; // number of images cbi.cBmpImages = 3; // number of images SHCreateMenuBar(&cbi); SHCreateMenuBar(&cbi);

22 New Menu Bar (dev 2 of 4) Resource side: Resource side: IDR_MENU RCDATA BEGIN IDMENU_CARD, // hmenu resource id IDMENU_CARD, // hmenu resource id 5,// number of menu items below 5,// number of menu items below // Image, COMMAND_ID, Initial state, Initial style, string resource for menu text, string resource for tooltip, menu offset // Image, COMMAND_ID, Initial state, Initial style, string resource for menu text, string resource for tooltip, menu offset I_IMAGENONE, IDM_SHAREDNEW, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_SHNEW, IDS_TOOLTIP_NEWCONTACT, NOMENU, I_IMAGENONE, IDM_SHAREDNEW, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_SHNEW, IDS_TOOLTIP_NEWCONTACT, NOMENU, I_IMAGENONE, IDM_CARD_EDIT, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_SHEDIT, 0, 0, I_IMAGENONE, IDM_CARD_EDIT, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_SHEDIT, 0, 0, I_IMAGENONE, IDM_CARD_TOOLS, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_SHTOOLS, 0, 1, I_IMAGENONE, IDM_CARD_TOOLS, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_SHTOOLS, 0, 1, 4, IDM_VOICE_BAR, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, IDS_TOOLTIP_VOICE_BAR, NOMENU, 4, IDM_VOICE_BAR, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, IDS_TOOLTIP_VOICE_BAR, NOMENU, 5, IDM_PEN, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, IDS_TOOLTIP_PEN, NOMENU, 5, IDM_PEN, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, IDS_TOOLTIP_PEN, NOMENU,END

23 New Menu Bar (dev 3 of 4) Notes: Notes: Menu string resource id < 100 is reserved. (IDS_SH*) Menu string resource id < 100 is reserved. (IDS_SH*) IDM_SHAREDNEW is reserved and a special token IDM_SHAREDNEW is reserved and a special token Tooltip should only be added for icons (or intl). Set to 0 otherwise. Tooltip should only be added for icons (or intl). Set to 0 otherwise. Last parameter is the menu offset for the menu set specified in IDMENU_CARD Last parameter is the menu offset for the menu set specified in IDMENU_CARD

24 New Menu Bar (dev 4 of 4) More Notes: More Notes: Non-menu activations come through as WM_COMMAND+your_id Non-menu activations come through as WM_COMMAND+your_id Menu commands come through with WM_COMMAND on select and WM_INITMENUPOPUP on activation with lParam set to MENU_ID, NOT INDEX! Menu commands come through with WM_COMMAND on select and WM_INITMENUPOPUP on activation with lParam set to MENU_ID, NOT INDEX! case WM_INITMENUPOPUP: switch (LOWORD(lParam)) { case IDM_MAIN_EDIT: SetupEditMenu((HMENU)wParam);break; case IDM_MAIN_BAZZLE: SetupBazzleMenu((HMENU)wParam);break;} break; break;

25 New New Button Design Stuff Design Stuff Quick input is critical Quick input is critical Shared with all apps Shared with all apps On Today page and user option to turn on everywhere On Today page and user option to turn on everywhere Dont spam it Dont spam it You can spam it in your own app You can spam it in your own app

26 New New Button (dev 1 of 2) Global New Global New INewMenuItemServer INewMenuItemServer DECLARE_INTERFACE_(INewMenuItemServer, IUnknown) { // *** IUnknown methods *** // *** IUnknown methods *** STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(CreateNewItem) (THIS_ HWND hwndParent) PURE; STDMETHOD(CreateNewItem) (THIS_ HWND hwndParent) PURE;}; Registration location Registration location[HKLM\Software\Microsoft\Shell\Extensions\NewMenu\{guid}] @=LOC_NAME_OF_MENU ;; named displayed on menu.

27 New New Button (dev 2 of 2) App Local New (templates) App Local New (templates) WM_NOTIFY, NMN_GETAPPREGKEY sent on new menu popup WM_NOTIFY, NMN_GETAPPREGKEY sent on new menu popup typedef struct tagNMNEWMENU { NMHDR hdr; NMHDR hdr; TCHAR szReg[80]; // out parameter of app local reg key TCHAR szReg[80]; // out parameter of app local reg key HMENU hMenu; // in param of the hmenu to popup HMENU hMenu; // in param of the hmenu to popup CLSID clsid; // unused for this notify CLSID clsid; // unused for this notify } NMNEWMENU, *PNMNEWMENU ; App menus items > IDM_NEWMENUMAX App menus items > IDM_NEWMENUMAX On invoke of Global, app first notified WM_NOTIFY, NMN_INVOKECOMMAND On invoke of Global, app first notified WM_NOTIFY, NMN_INVOKECOMMAND

28 Other Bars Design Stuff Design Stuff View bar, e.g. contacts & tasks View bar, e.g. contacts & tasks Folder bar, e.g. file explorer & notes Folder bar, e.g. file explorer & notes Address bar, e.g. pIE Address bar, e.g. pIE Status bar, e.g. Inbox Status bar, e.g. Inbox Nerd Stuff Nerd Stuff None… just win32 here! None… just win32 here!

29 Single Click Design Stuff Design Stuff Single. Everywhere. Period. Single. Everywhere. Period. 5mm stylus. 9.1mm finger. 5mm stylus. 9.1mm finger. Nerd Stuff Nerd Stuff NOT OS disabled – Convention only NOT OS disabled – Convention only ListView ListView LVS_EX_ONECLICKACTIVATE LVS_EX_ONECLICKACTIVATE WM_NOTIFY+LVN_ITEMACTIVATE WM_NOTIFY+LVN_ITEMACTIVATE Multiple selection via Action and/or drag Multiple selection via Action and/or drag VK_F23 == VK_ACTION VK_F23 == VK_ACTION Handling user double-clicks Handling user double-clicks

30 Tap & Hold Menus Design Stuff Design Stuff Just like context menus on desktop Just like context menus on desktop

31 Tap & Hold Menus Nerd Stuff SHRecognizeGesture: case WM_LBUTTONDOWN: SHRGINFO shrgi; shrgi.cbSize = sizeof(SHRGINFO); shrgi.hwndClient = hwnd; shrgi.ptDown.x = (int)(short)LOWORD(lParam); shrgi.ptDown.y = (int)(short)HIWORD(lParam); shrgi.dwFlags = SHRG_RETURNCMD; if (GN_CONTEXTMENU == SHRecognizeGesture(&shrgi)) { … your code… } break; Built into ListView, catch WM_NOTIFY+GN_CONTEXTMENU

32 The Flat Look Design Stuff Design Stuff Works better on small screens w/range of resolutions incl. greyscale Works better on small screens w/range of resolutions incl. greyscale 3D is so…95 3D is so…95 Nerd Stuff Nerd Stuff Mostly standard Win32. Avoid WS_DLGFRAME and WS_EX_WINDOWEDGE Mostly standard Win32. Avoid WS_DLGFRAME and WS_EX_WINDOWEDGE CCM_SETVERSION + COMCTL32_VERSION CCM_SETVERSION + COMCTL32_VERSION Others inherited for free (except PropSheets) Others inherited for free (except PropSheets)

33 Using Color & Sounds Color Color Use as a contrast element Use as a contrast element When all is red, nothing stands out Use judiciously Use judiciously More colors = more complexity Use to match the real world, but USE IT! Use to match the real world, but USE IT! Solitaire with color is more fun Sounds Sounds Design for the scale of the device Design for the scale of the device Train whistle in wyvern was… exaggerated Use it to enforce or enhance user input or feedback Use it to enforce or enhance user input or feedback

34 Page Dialogs & Property Sheets Design Stuff Design Stuff Dialogs are full pages, NOT floating windows unless seeing the info behind is critical Dialogs are full pages, NOT floating windows unless seeing the info behind is critical Tabs are at the Bottom, gives priority to content v. controls Tabs are at the Bottom, gives priority to content v. controls Fit tabs on one line Fit tabs on one line Hotlinks at the bottom to jump to related area…should not be treated as a remedy for poor organization of functionality Hotlinks at the bottom to jump to related area…should not be treated as a remedy for poor organization of functionality

35 Page Dialogs & Property Sheets (dev 1 of 2) Fullscreen (Page) dialogs Fullscreen (Page) dialogs SHInitDialog SHInitDialog SHINITDLGINFO shidi; SHINITDLGINFO shidi; shidi.hDlg = Hwnd(); shidi.hDlg = Hwnd(); shidi.dwMask = SHIDIM_FLAGS; shidi.dwMask = SHIDIM_FLAGS; shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_DONEBUTTON; shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_DONEBUTTON; SHInitDialog(&shidi); SHInitDialog(&shidi);

36 Page Dialogs & Property Sheets (dev 2 of 2) PropertySheet APIs PropertySheet APIs int CALLBACK PropSheetCallback(HWND hwndDlg, UINT uMsg, LPARAM lParam) { switch (uMsg) switch (uMsg) { case PSCB_GETVERSION: // to get the new UI return COMCTL32_VERSION; return COMCTL32_VERSION; case PSCB_INITIALIZED: // a menu (so that the background doesnt bleed through case PSCB_INITIALIZED: // a menu (so that the background doesnt bleed through SHMENUBARINFO cbi = {0}; SHMENUBARINFO cbi = {0}; cbi.cbSize = sizeof(SHMENUBARINFO); cbi.cbSize = sizeof(SHMENUBARINFO); cbi.hwndParent = hwndDlg; cbi.hwndParent = hwndDlg; cbi.dwFlags = SHCMBF_EMPTYBAR; cbi.dwFlags = SHCMBF_EMPTYBAR; SHCreateMenuBar(&cbi); SHCreateMenuBar(&cbi); break; break; case PSCB_GETLINKTEXT: // create link here case PSCB_GETLINKTEXT: // create link here lstrcpy((TCHAR *)lParam, TEXT(To start a modem connection, go to the folder. )); lstrcpy((TCHAR *)lParam, TEXT(To start a modem connection, go to the folder. ));break; } return 0; return 0;}

37 Control Panels Design Stuff Design Stuff Dont abuse Dont abuse Your options, belong in your app Your options, belong in your app If you must, support the appropriate classifications If you must, support the appropriate classifications Personal: user personalization (sw) Personal: user personalization (sw) System: device customization (hw) System: device customization (hw) Communications: connectivity Communications: connectivity

38 Control Panels (dev) Standard Win32 goo. Standard Win32 goo. Grouping: Grouping: Reg entry Reg entry[HKEY_LOCAL_MACHINE\ControlPanel\{cpl_id}]"Group"=dword:0 CPL_ID: CPL_ID: LONG CPLApplet(hwnd, uMsg, lParam1, lParam2) {… case CPL_IDNAME: lstrcpy((LPTSTR)lParam2, TEXT(your_cpl_id)); lstrcpy((LPTSTR)lParam2, TEXT(your_cpl_id)); return 0; }

39 User Assistance Pray you dont need it… Pray you dont need it… Integrate with Help menu, not a button in app; track context and show appropriate help Integrate with Help menu, not a button in app; track context and show appropriate help Integrate your help file into the main TOC Integrate your help file into the main TOC

40 Input Design Stuff Design Stuff Design with the SIP Design with the SIP Put it up for people and take it down Put it up for people and take it down Try not to make it dance Try not to make it dance Input is hard, make it easy… Input is hard, make it easy… You can hide, but test it hard You can hide, but test it hard Remember it is pluggable, recommended 80 pixels high, but not necessarily Remember it is pluggable, recommended 80 pixels high, but not necessarily

41 Input (dev 1 of 2) SIP friendliness (the rules) SIP friendliness (the rules) SHSipPreference(HWND hwnd, SIPSTATE eState) SHSipPreference(HWND hwnd, SIPSTATE eState) SIP_UP on WM_SETFOCUS SIP_UP on WM_SETFOCUS SIP_DOWN on WM_KILLFOCUS SIP_DOWN on WM_KILLFOCUS Do nothing if youre not an input control Do nothing if youre not an input control WC_SIPPREF magic control WC_SIPPREF magic control CONTROL "",-1,WC_SIPPREF, NOT WS_VISIBLE,-10,-10,5,5 Input Dialogs Input Dialogs SHInputDialog(hwnd, uMsg, wParam) SHInputDialog(hwnd, uMsg, wParam)

42 Input (dev 2 of 2) Main WndProc - save & restore sip state per window Main WndProc - save & restore sip state per window case WM_INITDIALOG/WM_CREATE: case WM_INITDIALOG/WM_CREATE: this->sai.cbSize = sizeof(SHACTIVATEINFO); break; case WM_ACTIVATE: case WM_ACTIVATE: SHHandleWMActivate(hWnd, wParam, lParam, &this->sai, 0); break; break; case WM_SETTINGCHANGE: case WM_SETTINGCHANGE: SHHandleWMSettingChange(hDlg, wParam, lParam, &this->sai)); break; case WM_SIZE: case WM_SIZE: … sizing goo here. break;

43 Today page Design Stuff Design Stuff Great flexibility and room for customization here Great flexibility and room for customization here Quick info is important…and so is my horoscope ;-) Quick info is important…and so is my horoscope ;-)

44 Today page (dev 1 of 2) Registering your custom plugin: Registering your custom plugin: [HKEY_LOCAL_MACHINE\Software\Microsoft\Today\Items\YOURCUSTOMITEMNA ME] "Type"=dword:4 ; 4 == tlitCustom "Type"=dword:4 ; 4 == tlitCustom "Enabled"=dword:1 "Enabled"=dword:1 "Options"=dword:0 ; 1 if options page available in "Options"=dword:0 ; 1 if options page available in ; control panel ; control panel "DLL"="\Windows\YOURDLL.DLL" ; path to the DLL "DLL"="\Windows\YOURDLL.DLL" ; path to the DLL DLL Entry points: DLL Entry points: HWND APIENTRY InitializeCustomItem(TODAYLISTITEM *ptli, HWND hwndParent); HWND hwndParent); BOOL APIENTRY CustomItemOptionsDlgProc(HWND hDlg, UINT message, UINT wParam, LONG lParam); UINT wParam, LONG lParam);

45 Today page (dev 2 of 2) WndProc WndProcWM_TODAYCUSTOM_CLEARCACHE /* Releases item-specific cached data. This message is sent, for example, when the user closes the Today settings page. */ example, when the user closes the Today settings page. */ /* WPARAM = (WPARAM)(TODAYLISTITEM *)ptli; */ /* WPARAM = (WPARAM)(TODAYLISTITEM *)ptli; */ /* LPARAM not used */ /* LPARAM not used */ WM_TODAYCUSTOM_QUERYREFRESHCACHE /* Queries the item to find out whether the item-specific cached data needs to be refreshed. When updating, the item must also data needs to be refreshed. When updating, the item must also calculate the height and set ptli->cyp. Returns TRUE if the data calculate the height and set ptli->cyp. Returns TRUE if the data was refreshed, FALSE if no changes were made. No drawing should be was refreshed, FALSE if no changes were made. No drawing should be done when handling this message. */ done when handling this message. */ /* WPARAM = (WPARAM)(TODAYLISTITEM *)ptli; */ /* WPARAM = (WPARAM)(TODAYLISTITEM *)ptli; */ /* LPARAM not used */ /* LPARAM not used */ /* return value = TRUE if refreshed, FALSE if no changes */ /* return value = TRUE if refreshed, FALSE if no changes */ WM_PAINTWM_LBUTTONUPduh…

46 Optimizing for Speed Design stuff Design stuff Benchmark performance is a key metric for appliance devices Benchmark performance is a key metric for appliance devices Perceived performance is still performance Perceived performance is still performance

47 Optimizing for Speed (dev) Transparent text is actually faster Transparent text is actually faster API overhead (FillRect) API overhead (FillRect) SIP messages are sent to foreground windows only SIP messages are sent to foreground windows only LoadString(NULL); LoadString(NULL); Dont forget obvious stuff: Dont forget obvious stuff: Control window overhead Control window overhead Delay init when appropriate (esp. DllMain) Delay init when appropriate (esp. DllMain) Much you get for free: Much you get for free: Short circuit WndProcs (when possible) Short circuit WndProcs (when possible) Client side window data Client side window data CS_VREDRAW, CS_SAVEBITS CS_VREDRAW, CS_SAVEBITS

48 Optimizing for Battery Life Nerd Stuff Nerd Stuff Realtime OS Realtime OS Means a battery win if were smart Means a battery win if were smart Lose if were not Lose if were not

49 Memory Management Follow the shutdown guidelines for WM_HIBERNATE and WM_CLOSE Follow the shutdown guidelines for WM_HIBERNATE and WM_CLOSE Rapier more actively (preemptively) shuts apps down Rapier more actively (preemptively) shuts apps down Auto memory division management Auto memory division management

50 AutoRun (dev) CF or MMC install (full install or just run) CF or MMC install (full install or just run) Autorun.exe copied to windows directory Autorun.exe copied to windows directory Called on insert and remove Called on insert and remove Autorun.exe install Autorun.exe install Autorun.exe uninstall Autorun.exe uninstall Launch and add link to Programs folder Launch and add link to Programs folder SHGetAutoRunPath(LPTSTR psz) SHGetAutoRunPath(LPTSTR psz) General: \dwProcessorType\autorun.exe (GetSystemInfo) MIPS: \4000\autorun.exe SH3: \10003\autorun.exe CEF: \0\autorun.exe

51 Top 10 Kick Ass Thoughts 1. Copy us 2. Less CAN be more…NO UI is Good UI 3. Know your key scenarios & design only for those 4. Read is different from edit 5. Minimize the difficulty of input 6. 5mm stylus and 9.1mm finger 7. Single tap, single tap, single tap 8. Be good to the SIP… WC_SIPPREF is your friend 9. Shut down cleanly, were managing memory, one bad app makes us all look bad 10. Support AutoRun & CF storage

52 Q & A

53


Download ppt "Building Great Applications For The Pocket PC Luis Esparragoza Software Test Lead Pocket-PC Microsoft Corporation 8-301."

Similar presentations


Ads by Google