Windows Mobile 6.5開發環境搭建以及變化
搭建開發環境,按照以下順序安裝。
◆安裝Visual Studio 2008(我安裝的試用的Team Suite版:VS2008TeamSuite90DayTrialCHSX1429243.iso)
◆安裝Microsoft ActiveSync 4.5.msi
◆安裝Windows Mobile 6 Professional SDK Refresh.msi(如果需要6.0版本的中文模擬器,需要安裝中文包:Windows Mobile 6 Professional Images (CHS).msi)
◆安裝Windows Mobile 6.5 Professional Developer Tool Kit (CHS).msi
如下圖,第一項QVGA即是6.5版本320x240屏幕的模擬器,高亮的一項的是真機,當你需要在真機上調試時使用這項,可見6.5版本的開發工具包并沒有帶真機調試項:
2.讓我們來看下Windows Mobile 6.5 Professional在開發方面的變化。
Today Plug-in
你為6.5以前版本編寫的今日插件,仍然可以在6.5版本使用,6.5的策略讓默認方案與其它子項互斥,當你選中自己的插件時,默認方案前面的勾將自動去掉。右下圖顯示的即是默認方案。
6.5版本改變的部分是:現在不允許把你自己編寫的插件的Type設為5,當你設置為5的時候,系統會把你改回成4。
關于4和5在6.5以前版本差距還是很大的,請看我的筆記:
HKEY_LOCAL_MACHINE\Software\Microsoft\Today\Items下的Type為DWORD類型。
If the value of Type is 4, a custom plug-in is added to the Today Screen. If the value of Type is 5, the plug-in is a custom pinned plug-in. |
我自己編寫的插件設置為5的時候就解決了橫豎屏切換太慢問題,慢的原因是Type為4的插件,每次橫豎屏切換,系統都會發送4次WM_PAINT消息!微軟在6.5版本優化了這個問題。下圖就是優化之后的當橫豎屏切換時系統發送的消息截圖:
Type另外還有以下值:
If the value of Type is 0, it indicates a reserved plug-in that displays the device owner information is added to the Today Screen. If the value of Type is 1, it indicates a reserved plug-in that displays the Appointments is added to the Today Screen. If the value of Type is 2, it indicates a reserved plug-in that displays the Mail is added to the Today Screen. If the value of Type is 3, it indicates a reserved plug-in that displays the Tasks is added to the Today Screen. If the value of Type is 6, the plug-in is a custom permanent pinned plug-in. |
說到為什么使用蜂窩式菜單,記得我以前看過一篇文章有介紹,因為正六邊形可以使觸摸面積最大(相連的)。
“A grid is the most efficient method to pack as many squares into an area as possible, but not for circles. The mathematically most efficient method to arrange non-overlapping circles - a problem called “sphere packing” - is actually and as you might have guessed by now, hexagonal. ” |
Windows下面并不能實現真正的窗口透明,目前我們開發的應用程序都是采用將下一個窗口的DC先在當前窗口繪制一遍,實現透明按鈕也是這個道理,其實都是偽透明,那么任何實現真正透明的窗口?這個問題我的繼續思考,不知讀者您能否解答^^
Gesture(手勢) APIs
A new set of APIs is being introduced that will enable application developers to take advantage of the new Windows Mobile 6.5 touch gesture framework. The gesture APIs allow an application to handle touch gesture input and provide a visually consistent experience with the rest of the device UI. The APIs are defined in the following header files: Note that the gesture APIs are only available on the Windows Mobile Classic and Professional SKUs. The headers and libraries are installed in the Windows Mobile SDK\Pocket PC\ folder. Samples that make use of these APIs are installed into the Windows Mobile 6.5 Developer Tool Kit\Samples\ folder. |
內核以及驅動開發部分沒 有太多變化,因為它仍然是基于Windows CE 5.x系統。當Windows Mobile 7.0推出時,因為是基于Windows CE 6.0系統,所以驅動編寫也將發生大的變化。Windows CE發生的兩次大的內核變化,一次是Windows CE 3.0,一次就是現在的Windows CE 6.0。下面討論的是Windows Mobile 6.5帶來的部分新功能。
3.Windows Mobile 6.5 Developer Tool Kit自帶的Samples,全部都是介紹Gesture的使用。
第一個例子
Code Sample Name: Gesture Metrics Sample
Feature Area: Touch
Description:
This sample demonstrates how to use the Gesture APIs. More specifically, it
demonstrates:
- use of RKGetGestureMetrics
- handling WM_GESTURE GID_HOLD, GID_SELECT and GID_DOUBLESELECT messages
This sample was designed to show how to use RKGetGestureMetrics and interpret
its results.
This example also shows how to handle GID_HOLD, GID_SELECT and GID_DOUBLESELECT
messages.
Relevant APIs/Associated Help Topics:
RKGetGestureMetrics
RKGetGestureInfo
GESTUREMETRICS
WM_GESTURE
第二個例子
Code Sample Name: Code Sample Name: Physics Engine Sample
Feature Area: Touch
Description:
This sample demonstrates how to use the Gesture APIs. More specifically, it
demonstrates:
- use of Physics Engine
- handling WM_GESTURE GID_PAN, GID_SCROLL and GID_END
This example shows how to handle gesture scrolling and how to properly use
Physics Engine.
Relevant APIs/Associated Help Topics:
RKCreatePhysicsEngine
RKQueryPhysicsEngine
RKDestroyPhysicsEngine
RKGetGestureInfo
PHYSICSENGINESTATE
PHYSICSENGINEINIT
WM_GESTURE
第三個例子
Code Sample Name: WAG Sample
Feature Area: Touch
Description:
This sample demonstrates how to use the Gesture APIs. More specifically, it
demonstrates:
- use of Window Auto Gesture API
This example shows how to handle gesture scrolling using Window Auto Gesture API.
Relevant APIs/Associated Help Topics:
RKSetWindowAutoGesture
RKGetAnimateMessageInfo
WAGINFO
ANIMATEMESSAGEINFO
【編輯推薦】