⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 controldefinitions.h

📁 一个WinCE6。0下的IP phone的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#ifndef __CONTROLDEFINITIONS_H__
#define __CONTROLDEFINITIONS_H__

//
//Screen Identifiers (used to identify each dialog screen)
//
//
#define SCREEN_ID_BASE              1000                    //screen id base
#define PHONEAPP_SCREEN_ID_BASE     (SCREEN_ID_BASE + 0)    //phoneapp screen id base
#define PHSETTINGS_SCREEN_ID_BASE   (SCREEN_ID_BASE + 1000) //phsettings screen id base
#define PHINFO_SCREEN_ID_BASE       (SCREEN_ID_BASE + 2000) //phinfo screen id base

// PhoneApp Screen Ids
#define PHONEAPP_DIALER_SCREEN_ID               (PHONEAPP_SCREEN_ID_BASE + 0)   

// Settings Screen Ids
#define PHSETTINGS_CALLERFORWARDING_SCREEN_ID   (PHSETTINGS_SCREEN_ID_BASE + 0)
#define PHSETTINGS_PHONESETTINGS_SCREEN_ID      (PHSETTINGS_SCREEN_ID_BASE + 1)
#define PHSETTINGS_RINGTONES_SCREEN_ID          (PHSETTINGS_SCREEN_ID_BASE + 2)
#define PHSETTINGS_SETTINGSDIALOG_SCREEN_ID     (PHSETTINGS_SCREEN_ID_BASE + 3)
#define PHSETTINGS_USERSETTINGS_SCREEN_ID       (PHSETTINGS_SCREEN_ID_BASE + 4)
#define PHSETTINGS_VOLUMESETTINGS_SCREEN_ID     (PHSETTINGS_SCREEN_ID_BASE + 5)
#define PHSETTINGS_SERVERSETTINGS_SCREEN_ID     (PHSETTINGS_SCREEN_ID_BASE + 6)
#define PHSETTINGS_EDITSERVERSETTINGS_SCREEN_ID (PHSETTINGS_SCREEN_ID_BASE + 7)

//  PhInfo Screen Ids.
#define PHINFO_DEFAULT_SCREEN_ID                 (PHINFO_SCREEN_ID_BASE + 0)
#define PHINFO_CALL_LOG_MENU_SCREEN_ID           (PHINFO_SCREEN_ID_BASE + 1)
#define PHINFO_CONTACT_MENU_SCREEN_ID            (PHINFO_SCREEN_ID_BASE + 2)
#define PHINFO_MISSED_CALL_LIST_SCREEN_ID        (PHINFO_SCREEN_ID_BASE + 3)
#define PHINFO_OUTGOING_CALL_LIST_SCREEN_ID      (PHINFO_SCREEN_ID_BASE + 4)
#define PHINFO_INCOMING_CALL_LIST_SCREEN_ID      (PHINFO_SCREEN_ID_BASE + 5)
#define PHINFO_MISSED_CALL_DETAILS_SCREEN_ID     (PHINFO_SCREEN_ID_BASE + 6)
#define PHINFO_OUTGOING_CALL_DETAILS_SCREEN_ID   (PHINFO_SCREEN_ID_BASE + 7)
#define PHINFO_INCOMING_CALL_DETAILS_SCREEN_ID   (PHINFO_SCREEN_ID_BASE + 8)
#define PHINFO_SPEEDDIAL_LIST_SCREEN_ID          (PHINFO_SCREEN_ID_BASE + 9)
#define PHINFO_SPEEDDIAL_EDIT_SCREEN_ID          (PHINFO_SCREEN_ID_BASE + 10)
#define PHINFO_BLOCKED_CALL_LIST_SCREEN_ID       (PHINFO_SCREEN_ID_BASE + 11)
#define PHINFO_OUTLOOK_CONTACT_LIST_SCREEN_ID    (PHINFO_SCREEN_ID_BASE + 12)
#define PHINFO_GAL_CONTACT_LIST_SCREEN_ID        (PHINFO_SCREEN_ID_BASE + 13)
#define PHINFO_OUTLOOK_CONTACT_DETAILS_SCREEN_ID (PHINFO_SCREEN_ID_BASE + 14)
#define PHINFO_GAL_CONTACT_DETAILS_SCREEN_ID     (PHINFO_SCREEN_ID_BASE + 15)

//
// Interproc messages/titles 
//

//WndClassName for the phone app
#define WNDCLASS_PHONEAPP           TEXT("__VOIP_PHONEAPP__")

//WndClassName for home screen application
#define WNDCLASS_HOMEAPP            TEXT("__VOIP_HOMESCREEN__")

//WndClassName for the enter PIN screen
#define WNDCLASS_ENTERPIN           TEXT("__VOIP_ENTERPIN__")

//WndClassName for the settings app
#define WNDCLASS_SETTINGS           TEXT("__VOIP_SETTINGS__")

//WndClassName for the info app
#define WNDCLASS_INFOAPP            TEXT("__VOIP_INFOAPP__")

//Messages and event names for the info app
#define INFOAPPMSG_ADDTOSPEEDDIAL   100

//Purpose: Send a command line argument to a running application
//WPARAM:  NULL
//LPARAM:  Pointer to a null-terminated string that contains the arguments
//Returns: BOOL
#define WM_NEW_COMMAND_LINE         WM_SETTEXT

// Purpose: Send an authentication request to the homescreen app
// WPARAM: Notification Message - message to be sent to the notification window when the request is complete
// LPARAM: Notification Window  - window receiving notification when the request is complete
// Returns: HRESULT indicating success or failure
#define WM_AUTHENTICATE_USER        (WM_USER + 100)

// Purpose: Cancel an existing authentication request for this window
// WPARAM: Not used
// LPARAM: Notification Window
// Returns: HRESULT indicating success or failure
#define WM_CANCEL_AUTH_REQUEST      (WM_USER + 101)

EXTERN_C
BOOL
WINAPI
PHInitCommonControls(
    void
    );

EXTERN_C
BOOL
WINAPI
PHUnInitCommonControls(
    void
    );

EXTERN_C
BOOL
WINAPI
PHDrawBackground(
    HDC hdc,
    __in RECT* pDrawRectangle
    );

typedef enum _PH_COLOR
{
    phcDefaultTransparentColor = 0,
    phcDefaultBackgroundColor,
    phcDefaultTextColor,
    phcDisplayItemBackgroundColor,
    phcDisplayItemSelectedBackgroundColor,
    phcDisplayItemTextColor,
    phcDisplayItemSelectedTextColor,
    phcDisplayItemBorderColor,
    phcDisplayItemSelectedBorderColor,
    phcLast,
} PH_COLOR;

EXTERN_C
COLORREF
WINAPI
PHGetColor(
    PH_COLOR Id
    );

typedef enum _PH_FONT
{
    phfStandardText = 0,
    phfStandardTextBold,
    phfInformationText,
    phfLargeText,
    phfBigNumbersText,
    phfLast,
} PH_FONT;

EXTERN_C
HFONT
WINAPI
PHGetFont(
    PH_FONT Id
    );

EXTERN_C
BOOL
WINAPI
PHRegisterSingletonApplication(
    __in            const WCHAR* pNameToRegister,
    __deref_out_opt HANDLE*      phApplication
    );

// Dialog Flags
#define VDF_TYPE_MODAL          0x00000000
#define VDF_TYPE_MODELESS       0x00000001
#define VDF_HIDDEN              0x00000002

// Dialog Hook Proc type.
// Return TRUE if message was handled. Return FALSE otherwise.
typedef BOOL (CALLBACK* DIALOG_HOOK_PROC)(
    HWND,       // In: Dialog window handle
    UINT,       // In: Message
    WPARAM,     // In: Message wParam
    LPARAM,     // In: Message lParam
    void*       // In: User data (pUserData)
);

typedef struct _PH_DIALOG_SCREEN_PARAMETERS
{
    DWORD StructSize;               // Struct size in bytes
    DWORD Flags;                    // VDF_xxx flags

    HWND Owner;                     // Owner of the dialog screen
    UINT Id;                        // Identifier of the dialog window
    HINSTANCE Instance;             // Optional: HINSTANCE containing custom resources

    const WCHAR* pStatusHeader;     // Status Header
    const WCHAR* pTitle;            // Title
    UINT MenuId;

    DIALOG_HOOK_PROC pDialogHook;   // Optional dialog Hook proc. Required for modal dialogs to handle WM_INITDIALOG.
    void* pUserData;                // User data to be passed back in dialog hook procedure

    union
    {
        UINT SelectedId;            // [OUT] ID of button selected by user
        HWND Dialog;                // [OUT] HWND of box. Returned only for modeless screens.
    } result;
    
} PH_DIALOG_SCREEN_PARAMETERS;

EXTERN_C
BOOL
WINAPI
PHDialogScreen(
    __inout PH_DIALOG_SCREEN_PARAMETERS* pParameters
    );

// Menu Screen - special type of dialog screen
typedef struct _PHMS_ITEM
{
    int Identifier;
    int StringId;
} PHMS_ITEM;

//Return value for a cancelled menu screen (both modal and modeless)
#define PHMENU_CANCELLED  (-1)

typedef struct _PH_MENU_SCREEN_PARAMETERS
{
    DWORD StructSize;               // Struct size in bytes
    DWORD Flags;                    // VDF_xxx flags

    HWND Owner;                     // Owner of the menu screen
    UINT Id;                        // Identifier of the dialog window
    HINSTANCE Instance;             // HINSTANCE containing custom resources

    const WCHAR* pTitle;            // Title

    PHMS_ITEM* pMenuScreenItems;
    int ItemCount;

    UINT NotificationMsg;           // If the dialog is modeless, this message is sent to the owner window
                                    // prior to the dialog closing. The WPARAM contains the selected id (or PHMENU_CANCELLED).
                                    // The LPARAM contains the HWND of the dialog.
                                    // This is ignored if the menu screen is modal.

    union
    {
        UINT SelectedId;         // [OUT] Identifier of item selected by user if modal
        HWND Dialog;             // [OUT] HWND of the modeless dialog created
    } result;

} PH_MENU_SCREEN_PARAMETERS;


// Menu Screen - special type of dialog screen
//
// If the dialog is modal, the id associated with the selected item (or PHMENU_CANCELLED) is returned
// in the result union of PH_MENU_SCREEN_PARAMETERS
//
// If the dialog is modeless, the id associated with the selected item is sent as the WPARAM of the 
// message sent to owner window. 
//
EXTERN_C
BOOL
WINAPI
PHMenuScreen(
    __inout PH_MENU_SCREEN_PARAMETERS* pParameters
    );

typedef struct _PH_MESSAGE_BOX_PARAMETERS
{
    DWORD StructSize;               // Struct size in bytes
    DWORD Flags;                    // VDF_xxx flags

    HWND Owner;                     // Owner of the message box
    HINSTANCE Instance;             // Optional: HINSTANCE containing custom resources
    const WCHAR* pTitle;            // Tile

    const WCHAR* pText;             // Text
    UINT IconId;                    // Icon

    UINT MenuId;                    // Optional: Menu . If not defined, default is
                                    // - Button1. Text="Ok" / ID=IDOK.
                                    // - Button2. Text="Cancel" / ID=IDCANCEL.

    union
    {
        UINT SelectedId;            // [OUT] ID of button selected by user. Returned only for modal boxes.
        HWND Dialog;                // [OUT] HWND of box. Returned only for modeless boxes.
    } result;

} PH_MESSAGE_BOX_PARAMETERS;

EXTERN_C
BOOL
WINAPI
PHMessageBox(
    __inout PH_MESSAGE_BOX_PARAMETERS* pParameters
    );


//
//Supported display items
//
interface IVoIPDisplayItem;

EXTERN_C
HRESULT
WINAPI
PHCreateTextDisplayItem(
    __in const WCHAR* pText,
    __deref_out IVoIPDisplayItem** ppItem

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -