• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            WCE下的CPL開發(fā)介紹

               WCE下的控制面板程序(CPL)與PC上的CPL開發(fā)有些許的不同,但總體上是一致的。這里總結(jié)一下在開發(fā)CPL時的思路。

               CPL文件實際上是一個DLL文件,DLL入口為CPlApplet,原型為:
            LONG CPlApplet(HWND hwndCPl,UINT  msg,LPARAM  lParam1,LPARAM  lParam2),
            將開發(fā)出來的CPL文件置于[Windows]目錄下(PC上為[Windows/system32]下),系統(tǒng)會自動掃描并識別,然后將其在控制面板中顯示出來(WCE中是在[Settings->System]中顯示)。

               系統(tǒng)會在特定的時候進入CPlApplet,這些時刻可以通過CPlApplet函數(shù)參數(shù)msg來解讀,WCE下的MSG有一下幾種:
             

            Message

            Description

            CPL_DBLCLK

            Sent to the CPlApplet function when a user taps the icon of a Control Panel application (CPL) supported by the function.

            CPL_EXIT

            Sent to the CPlApplet function before the system releases the DLL that contains the function.

            CPL_GETCOUNT

            Sent to the CPlApplet function to retrieve the number of Control Panel applications (CPLs) supported by the function.

            CPL_IDNAME

            Sent to the CPlApplet function to retrieve a Control Panel application's unique ID name string.

            CPL_INIT

            Sent to the CPlApplet function to prompt it to perform initialization for all Control Panel applications (CPLs) that it supports.

            CPL_NEWINQUIRE

            Sent to the CPlApplet function to request information about a Control Panel application (CPL) that it supports.

            CPL_STOP

            Sent to the CPlApplet function for each Control Panel application (CPL)it implements to prompt it to close down that CPL.


               CPL_DBLCLK是個很重要的消息,它表示用戶雙擊(或按了確認按鈕)了控制面板中的該程序的圖標。因此該消息處理中可以進行主窗口的啟動動作,如果窗口已經(jīng)啟動,可以將窗口提前顯示。該消息返回0表示成功處理。

               CPL_EXIT消息會在CPL_STOP消息發(fā)送之后發(fā)送。可以在該消息處理中做一些清理工作。該消息返回0表示成功處理。

               CPL_GETCOUNT消息MSDN上解釋是retrieve the number of dialog boxes supported by the application,實際測試該消息的使用功能是返回數(shù)目會影響在控制面板數(shù)出現(xiàn)的圖標數(shù)量,如果返回2,控制面板中會出現(xiàn)兩個CPL的圖標。

               CPL_IDNAME消息使用到兩個另外的參數(shù)LPARAM  lParam1和LPARAM  lParam2,lParam1這里傳入CPL的全局惟一ID號,lParam2需要在處理中指向一個字符串,該字符串將用來表示CPL的ID NAME,該名稱可以與控制面板中的CPL顯示名不同。該消息返回0表示成功處理。

               CPL_INIT消息會在控制面板載入CPL后立即被觸發(fā),可以進行一些全局內(nèi)存開辟的動作。該消息返回1表示成功處理。

               CPL_NEWINQUIRE消息用來得到CPL必要的信息。lParam1傳入CPL的全局惟一ID號,lParam2指向NEWCPLINFO結(jié)構(gòu)體,開發(fā)者需要對該結(jié)構(gòu)體的內(nèi)容進行填充。MSDN中對該消息有如下的解釋:
            The Control Panel sends the CPL_NEWINQUIRE message once for each dialog box supported by the application. The Control Panel also sends a CPL_INQUIRE message for each dialog box. These messages are sent immediately after the CPL_GETCOUNT message. However, the system does not guarantee the order in which the CPL_INQUIRE and CPL_NEWINQUIRE messages are sent.

            The CPL_NEWINQUIRE message was introduced in Windows version 3.1 as a replacement for CPL_INQUIRE. However, CPL_INQUIRE is the preferred message for Microsoft Windows 95 and Microsoft Windows NT® version 4.0. This is because CPL_NEWINQUIRE returns information in a form that the system cannot cache. Consequently, applications that process CPL_NEWINQUIRE must be loaded each time the Control Panel needs the information, resulting in a significant reduction in performance.

            該消息返回0表示成功處理。

               CPL_STOP消息會在用戶關(guān)閉了CPL主窗口時被調(diào)用,該消息返回0表示成功處理。

               從上述消息介紹中可以看出,返回值很重要。如果返回值不正確,可能發(fā)生意想不到的后果。
               
               PS: 與之類似的,WCE下的Service程序開發(fā),XXX_系列接口函數(shù)的返回值也很重要,需要重視。

            posted on 2008-05-26 10:15 迷宮の未來 閱讀(1653) 評論(0)  編輯 收藏 引用

            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            導航

            統(tǒng)計

            常用鏈接

            留言簿(10)

            隨筆檔案

            文章檔案

            最新隨筆

            搜索

            積分與排名

            最新隨筆

            最新評論

            閱讀排行榜

            評論排行榜

            成人综合伊人五月婷久久| 精品无码久久久久久久动漫| 久久亚洲国产成人影院网站| 久久久国产打桩机| 国内精品久久久久久久97牛牛| 国产精品久久国产精品99盘 | 亚洲精品高清国产一久久| 热综合一本伊人久久精品 | 无码人妻久久一区二区三区免费丨| www.久久热.com| 欧洲国产伦久久久久久久| 人妻丰满AV无码久久不卡| 久久人人爽人人爽人人av东京热| 久久97精品久久久久久久不卡| 精品国产乱码久久久久久1区2区 | 精品精品国产自在久久高清| 亚洲国产成人久久综合一区77| 成人精品一区二区久久| 伊人丁香狠狠色综合久久| 久久久久久免费视频| 亚洲午夜福利精品久久| 久久国产精品久久精品国产| 久久久国产精华液| 伊人 久久 精品| 久久久WWW成人| 狠狠色丁香久久婷婷综合图片| 欧美性猛交xxxx免费看久久久| 美女写真久久影院| 久久强奷乱码老熟女网站| 国产精品熟女福利久久AV| 国内精品久久久久久野外| 久久久久久夜精品精品免费啦| 久久综合久久综合久久综合| 久久精品天天中文字幕人妻| 欧美黑人激情性久久| 欧美精品乱码99久久蜜桃| 99久久免费国产精品特黄| 国产精品久久久久久久久久影院| 亚洲伊人久久综合中文成人网| 漂亮人妻被中出中文字幕久久| 国产69精品久久久久观看软件|