亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cecamera.cpp

?? 工具:visual studio 2005 里面有說明文件。
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//

// ***************************************************************************
// CECamera.cpp
//
// Take pictures and videos using Camera native API.
//

#include <aygshell.h>
#include "Macros.h"
#include "resource.h"

// Macros

#define MAX_INITIAL_DIR                       MAX_PATH
#define MAX_FILE_NAME                         MAX_PATH
#define MAX_TITLE                             64
#define MAX_RESOLUTION_WIDTH                  10
#define MAX_RESOLUTION_HEIGHT                 10
#define MAX_VIDEO_TIME_LIMIT                  10

#define MAX_PLATFORM                          64
#define MAX_CLASSNAME                         64
#define MAX_MESSAGE                           MAX_PATH * 2

#define CECAMERA_DEFAULT_INITIAL_DIR          NULL
#define CECAMERA_DEFAULT_FILE_NAME            NULL
#define CECAMERA_DEFAULT_TITLE                NULL
#define CECAMERA_DEFAULT_STILL_QUALITY        CAMERACAPTURE_STILLQUALITY_DEFAULT
#define CECAMERA_DEFAULT_VIDEO_TYPES          CAMERACAPTURE_VIDEOTYPE_ALL
#define CECAMERA_DEFAULT_RESOLUTION_WIDTH     0
#define CECAMERA_DEFAULT_RESOLUTION_HEIGHT    0
#define CECAMERA_DEFAULT_VIDEO_TIME_LIMIT     0
#define CECAMERA_DEFAULT_MODE                 CAMERACAPTURE_MODE_STILL

#define CECAMERA_MUTEX_NAME                   TEXT("__CECAMERA_MUTEX__")
#define CECAMERA_MAINDLG_CLASSNAME            TEXT("Dialog")


// Global variables

BOOL                       g_bSmartphone  = FALSE;
HINSTANCE                  g_hInstance    = NULL;
HMENU                      g_hMainMenu    = NULL;
LPCTSTR                    g_szCaption;

CAMERACAPTURE_STILLQUALITY g_StillQuality = CECAMERA_DEFAULT_STILL_QUALITY;
CAMERACAPTURE_VIDEOTYPES   g_VideoTypes   = CECAMERA_DEFAULT_VIDEO_TYPES;
CAMERACAPTURE_MODE         g_Mode         = CECAMERA_DEFAULT_MODE;


// Forward declarations of the functions

BOOL IsSmartphone();
BOOL IsFocusOnEditControl();
BOOL InitDialog(HWND hwndDlg);
VOID StartCamera(HWND hwndDlg);
VOID ShowAboutBox(HWND hwndDlg);
VOID ResetOptions(HWND hwndDlg);
VOID ChangeMode(WORD wMode);
VOID ChangeStillQuality(WORD wStillQuality);
VOID ChangeVideoTypes(WORD wVideoTypes);
VOID ChangeOptions(HWND hwndDlg, WORD wOptions);
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);


// ***************************************************************************
// Function Name: WinMain
//
// Purpose: Main entry point into the CECamera program
//
// Arguments: Standard WinMain arguments
//
// Return Values: 0
//
// Description:
//   Checks to see if a previous instance of the program is running,
//   and if it is not, it pops up a dialog box allowing the user to
//   specify the parameters for SHCameraCapture() API to launch Camera app.

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
{
    HRESULT hr;
    HWND    hWndPreInstance;
    HANDLE  hMutex = NULL;

    // Load the caption of the main dialog from resource
    g_szCaption = (LPCTSTR)LoadString(hInstance, IDS_CAPTION, NULL, 0);
    CPR(g_szCaption);

    // Use a global named mutex to detect another instance of CECamera
    hMutex = CreateMutex(NULL, FALSE, CECAMERA_MUTEX_NAME);
    CPR(hMutex);

    if (ERROR_ALREADY_EXISTS == GetLastError())
    {
        // Already an instance running - attempt to switch to it and then exit
        hWndPreInstance = FindWindow(CECAMERA_MAINDLG_CLASSNAME, g_szCaption);
        CPR(hWndPreInstance);

        SetForegroundWindow(hWndPreInstance);
    }
    else
    {
        // Store the hInstance
        g_hInstance = hInstance;

        // Determine if platform is Smartphone
        g_bSmartphone = IsSmartphone();

        // Create the dialog box
        DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAINDLG), NULL, (DLGPROC)DialogProc);
    }

Error:
    if (NULL != hMutex)
    {
        // Release the global named mutex
        CloseHandle(hMutex);
    }

    return hr;
}

// ***************************************************************************
// Function Name: DialogProc
//
// Purpose: Message Handler for CECamera Dialog Box
//
// Arguments: Standard Dialog Procedure Arguments
//
// Return Values:
//   Returns TRUE if it processed the message, or FALSE if it did not.
//
// Description:
//   Dialog Procedure for the main CECamera Dialog.

BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    BOOL bHandled = TRUE;

    switch (uMsg)
    {
        case WM_INITDIALOG:
            // Make sure the dialog box was created
            if (!InitDialog(hwndDlg))
            {
                PostMessage(hwndDlg, WM_CLOSE, 0, 0);
            }

            break;

        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDM_START:
                    StartCamera(hwndDlg);
                    break;

                case IDM_ABOUT:
                    ShowAboutBox(hwndDlg);
                    break;

                case IDM_RESET:
                    ResetOptions(hwndDlg);
                    break;

                case IDM_MODE_STILL:
                    // Fall through

                case IDM_MODE_VIDEOONLY:
                    // Fall through

                case IDM_MODE_VIDEOWITHAUDIO:
                    ChangeMode(LOWORD(wParam));
                    break;

                case IDM_STILLQUALITY_DEFAULT:
                    // Fall through

                case IDM_STILLQUALITY_LOW:
                    // Fall through

                case IDM_STILLQUALITY_NORMAL:
                    // Fall through

                case IDM_STILLQUALITY_HIGH:
                    ChangeStillQuality(LOWORD(wParam));
                    break;

                case IDM_VIDEOTYPES_ALL:
                    // Fall through

                case IDM_VIDEOTYPES_STANDARD:
                    // Fall through

                case IDM_VIDEOTYPES_MESSAGING:
                    ChangeVideoTypes(LOWORD(wParam));
                    break;

                case IDC_CHECK_INITIAL_DIR:
                    // Fall through

                case IDC_CHECK_DEFAULT_FILE_NAME:
                    // Fall through

                case IDC_CHECK_TITLE:
                    // Fall through

                case IDC_CHECK_RESOLUTION:
                    // Fall through

                case IDC_CHECK_VIDEO_TIME_LIMIT:
                    ChangeOptions(hwndDlg, LOWORD(wParam));
                    break;

                case IDCANCEL:
                    // Fall through

                case IDM_EXIT:
                    PostMessage(hwndDlg, WM_CLOSE, 0, 0);
                    break;
            }
            break;

        case WM_CLOSE:
            EndDialog(hwndDlg, IDCANCEL);
            break;

        case WM_ACTIVATE:
            if (WA_ACTIVE == LOWORD(wParam))
            {
                // Set the focus to the main dialog if we are activated
                SetFocus(hwndDlg);
            }
            break;

        case WM_HOTKEY:
            if (g_bSmartphone && VK_TBACK == HIWORD(lParam))
            {
                if (IsFocusOnEditControl())
                {
                    // The current control with focus is an edit control
                    if (MOD_KEYUP & LOWORD(lParam))
                    {
                        // Delete a character on each KEYUP
                        SendMessage(GetFocus(), WM_CHAR, VK_BACK, 0);
                    }
                    else if (MOD_HOLD & LOWORD(lParam))
                    {
                        // Clear content from edit controls while pressing and holding the Back key
                        SetWindowText(GetFocus(), TEXT(""));
                    }
                }
                else if (MOD_KEYUP & LOWORD(lParam))
                {
                    // The current control with focus is not an edit control,
                    // close the dialog and then back to the previous application
                    PostMessage(hwndDlg, WM_CLOSE, 0, 0);
                    SHNavigateBack();
                }
            }
            break;

        default:
            // Specify that we didn't process this message, let the default
            // dialog box window procedure to process this message
            bHandled = FALSE;
            break;
    }

    return bHandled;
}

// **************************************************************************
// Function Name: IsSmartphone
//
// Purpose: Determine if platform is Smartphone
//
// Arguments: none
//
// Return Values:
//   TRUE if the current platform is a Smartphone platform
//   FALSE if the current platform is not a Smartphone platform
//
// Description:
//   This function retrieves the current platforms type and then
//   does a case insensitive string comparison.

BOOL IsSmartphone()
{
    HRESULT hr;
    TCHAR   szPlatform[MAX_PLATFORM] = { 0 };
    BOOL    bResult = FALSE;

    CBR(SystemParametersInfo(SPI_GETPLATFORMTYPE, ARRAYSIZE(szPlatform), szPlatform, 0));

    if (0 == _tcsicmp(szPlatform, TEXT("Smartphone")))
    {
        bResult = TRUE;
    }

Error:
    return bResult;
}

// **************************************************************************
// Function Name: IsFocusOnEditControl
//
// Purpose: Determine if the current control with focus is an edit control
//
// Arguments: none
//
// Return Values:
//   TRUE if the current control with focus is an edit control
//   FALSE if the current control with focus is not an edit control
//
// Description:
//   This function retrieves the window class name of the current control
//   with focus and then does a case insensitive string comparison.

BOOL IsFocusOnEditControl()
{
    HRESULT hr;
    TCHAR   szClassName[MAX_CLASSNAME] = { 0 };
    BOOL    bResult = FALSE;

    CBR(0 != GetClassName(GetFocus(), szClassName, ARRAYSIZE(szClassName)));

    if (0 == _tcsicmp(szClassName, TEXT("Edit")))
    {
        bResult = TRUE;
    }

Error:
    return bResult;
}

// ***************************************************************************
// Function Name: InitDialog
//
// Purpose: UI Initialization
//
// Arguments:
//   HWND hwndDlg - Handle to the main dialog
//
// Return Values:
//   TRUE if initialization was successful
//   FALSE if initialization failed
//
// Description:
//   The purpose of this function is to create a full-screen dialog box with
//   the Cancel button and creates a menu bar at the bottom of the dialog.

BOOL InitDialog(HWND hwndDlg)
{
    SHINITDLGINFO shidi;
    SHMENUBARINFO shmbi;
    BOOL          bSuccess = FALSE;

    // Specify that the dialog box should stretch full screen
    ZeroMemory(&shidi, sizeof(shidi));
    shidi.dwMask  = SHIDIM_FLAGS;
    shidi.hDlg    = hwndDlg;
    shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;

    // Adds the Cancel button to close the dialog with IDCANCEL
    // if the current platform is not a Smartphone platform
    if (!g_bSmartphone)
    {
        shidi.dwFlags |= SHIDIF_CANCELBUTTON;
    }

    if (SHInitDialog(&shidi))
    {
        // Set up the menu bar
        ZeroMemory(&shmbi, sizeof(shmbi));
        shmbi.cbSize     = sizeof(shmbi);
        shmbi.hwndParent = hwndDlg;
        shmbi.nToolBarId = IDR_MENUBAR;
        shmbi.hInstRes   = g_hInstance;

        if (SHCreateMenuBar(&shmbi))
        {
            if (NULL != shmbi.hwndMB)
            {
                // Get the main menu and store it
                g_hMainMenu = (HMENU)SendMessage(shmbi.hwndMB, SHCMBM_GETSUBMENU, 0, IDM_MENU);
                if (NULL != g_hMainMenu)
                {
                    // Set the window caption
                    SetWindowText(hwndDlg, g_szCaption);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久久久久| 国产真实乱偷精品视频免| 99麻豆久久久国产精品免费优播| 精品国产成人系列| 国产一区二区三区四区五区入口| 久久久久久久免费视频了| 黑人巨大精品欧美黑白配亚洲| 久久先锋影音av鲁色资源网| 国产精品亚洲午夜一区二区三区 | 日韩一区二区三区高清免费看看| 午夜国产不卡在线观看视频| 欧美精品粉嫩高潮一区二区| 石原莉奈一区二区三区在线观看| 日韩一区二区三| 国产一区二区视频在线| 18欧美乱大交hd1984| 91福利精品视频| 奇米一区二区三区av| 久久一夜天堂av一区二区三区| 国产麻豆精品theporn| 国产精品电影一区二区| 欧美视频第二页| 麻豆精品一区二区综合av| 国产亚洲一区二区三区四区| 91亚洲精品久久久蜜桃网站 | 91精品在线一区二区| 麻豆精品精品国产自在97香蕉| 久久久久99精品国产片| 一本大道av一区二区在线播放| 天堂成人国产精品一区| 国产欧美日韩一区二区三区在线观看| eeuss影院一区二区三区| 亚洲成人tv网| 国产网红主播福利一区二区| 在线免费观看不卡av| 麻豆精品新av中文字幕| 亚洲欧美色图小说| 欧美成人激情免费网| 91麻豆精品在线观看| 激情五月激情综合网| 亚洲乱码国产乱码精品精可以看| 日韩欧美一二区| 色婷婷av一区二区三区gif| 理论电影国产精品| 亚洲激情一二三区| 国产网站一区二区| 欧美一三区三区四区免费在线看 | 国产不卡高清在线观看视频| 亚洲成人av福利| 国产精品高潮久久久久无| 欧美一级国产精品| 欧洲生活片亚洲生活在线观看| 国产乱人伦偷精品视频不卡| 午夜久久电影网| 亚洲视频在线一区二区| 欧美精品一区男女天堂| 91麻豆精品国产91久久久使用方法 | 99久久婷婷国产综合精品| 人禽交欧美网站| 亚洲午夜精品在线| 最新日韩av在线| 国产视频视频一区| 精品国产欧美一区二区| 8v天堂国产在线一区二区| 色哟哟日韩精品| 91香蕉视频在线| 国产乱码字幕精品高清av| 日本美女一区二区三区视频| 亚洲综合免费观看高清完整版| 国产精品女人毛片| 中文字幕免费不卡| 国产日韩欧美电影| 国产欧美一区二区精品忘忧草 | 日韩精品免费专区| 亚洲综合免费观看高清完整版| 中文字幕综合网| 亚洲人一二三区| 欧美国产日韩亚洲一区| 国产日韩欧美不卡| 国产精品毛片a∨一区二区三区| 久久精品免视看| 欧美极品少妇xxxxⅹ高跟鞋| 国产亚洲精品超碰| 国产精品―色哟哟| 国产精品久久久久婷婷二区次| 中文字幕欧美日本乱码一线二线 | 国产精品一区一区| 国产精品12区| 国产91色综合久久免费分享| 国产成人精品免费网站| 国产不卡视频一区| 99re热这里只有精品免费视频| 99久久精品国产一区| 91美女蜜桃在线| 精品视频一区三区九区| 91精品国产综合久久精品性色| 欧美一级搡bbbb搡bbbb| 久久综合一区二区| 国产精品久久久久婷婷| 亚洲色图欧美偷拍| 偷拍一区二区三区四区| 男女性色大片免费观看一区二区 | 免费成人深夜小野草| 精品一区二区三区蜜桃| 国产精品主播直播| 色88888久久久久久影院按摩 | 91免费观看视频| 欧美日韩国产a| 26uuu精品一区二区| 国产精品日韩成人| 亚洲线精品一区二区三区八戒| 天堂一区二区在线免费观看| 国产老女人精品毛片久久| 99麻豆久久久国产精品免费优播| 欧美午夜精品一区| 日韩欧美123| 亚洲人成亚洲人成在线观看图片| 亚洲高清一区二区三区| 国产一区二区不卡| 在线国产电影不卡| 久久久综合精品| 一区二区三区日韩欧美| 奇米色一区二区| 不卡一区二区中文字幕| 欧美一区二区三区性视频| 中文天堂在线一区| 免费在线一区观看| 91麻豆蜜桃一区二区三区| 精品日韩成人av| 国产精品乱人伦一区二区| 偷偷要91色婷婷| 99久久er热在这里只有精品15 | 日韩高清不卡一区| 成人动漫在线一区| 欧美一区二区黄色| 亚洲激情五月婷婷| 国产乱子伦一区二区三区国色天香| 色天天综合久久久久综合片| 精品国产乱码久久久久久久| 亚洲综合免费观看高清完整版在线 | 在线一区二区三区四区五区| 欧美成人国产一区二区| 亚洲第一成人在线| eeuss鲁一区二区三区| 精品国产成人系列| 日日夜夜精品视频天天综合网| a4yy欧美一区二区三区| 久久亚洲一区二区三区四区| 天堂一区二区在线| 色女孩综合影院| 国产农村妇女精品| 久久草av在线| 91精品国产91久久久久久最新毛片| 亚洲欧美日韩国产另类专区 | 国产亚洲精品aa| 久久99最新地址| 6080国产精品一区二区| 亚洲国产欧美在线| 91高清视频在线| 亚洲欧洲日韩女同| www.一区二区| 国产精品网站在线| 国产福利一区二区| 久久久国产精华| 国产精品自拍av| 26uuu国产日韩综合| 久久99热这里只有精品| 日韩亚洲欧美高清| 日韩av一区二区三区| 51精品久久久久久久蜜臀| 婷婷成人激情在线网| 欧美视频在线一区| 天堂一区二区在线免费观看| 欧美日韩一级视频| 日韩精品亚洲一区二区三区免费| 欧美撒尿777hd撒尿| 午夜精品福利在线| 欧美三级韩国三级日本三斤| 亚洲电影视频在线| 91精品国产一区二区人妖| 日本不卡不码高清免费观看| 日韩欧美一二区| 韩国三级电影一区二区| 国产免费久久精品| 99久久久免费精品国产一区二区| 亚洲色图丝袜美腿| 欧美日韩国产一二三| 蜜臀精品一区二区三区在线观看| 精品国产免费人成电影在线观看四季| 国产在线一区观看| 国产精品久久久久一区二区三区| av爱爱亚洲一区| 午夜视频一区二区| 精品国产一二三| 成人激情动漫在线观看| 亚洲综合色在线| 日韩视频免费观看高清完整版在线观看 | 欧美写真视频网站| 麻豆极品一区二区三区| 中文字幕乱码一区二区免费|