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

📄 rctlkeys.h

📁 Windows CE 下的机顶盒应用实例
💻 H
字号:
//
// 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.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

Module Name:  rctlkeys.h

Abstract:  Defines window.external.RemoteControlKeys (IRemoteControlKeys),
		   which extends the DHTML object model to allow pages to override
		   the default button handlers for the STB remote control.  This
		   is useful for STB features that are embedded in a web page, like
		   the windows media player, or possibly a DVD player or TV tuner.

Notes:	   To use this interface, web pages make the following calls:
		   1) RemoteControlKeys.BeginRequest()
		   2) set RemoteControlKeys properties (Play, stop, etc.) =true
		      for keys they want to override, and optionally =false for
		      keys to be handled by the host app
		   3) RemoteControlKeys.EndRequest()
		   4) RemoteControlKeys.ReleaseRequest() when the web page unloads

--*/

#ifndef _RCTLKEYS_H_1001F5AE_D616_417F_A7DB_4DDCE25918AE_
#define _RCTLKEYS_H_1001F5AE_D616_417F_A7DB_4DDCE25918AE_

// define the remote control keys
#define RCTL_STOP	 0
#define RCTL_PLAY	 1
#define RCTL_PREV	 2
#define RCTL_NEXT	 3
#define RCTL_FWD	 4
#define RCTL_BACK	 5
#define RCTL_PAUSE	 6
#define RCTL_VOLUP	 7
#define RCTL_VOLDN	 8
#define RCTL_MUTE	 9
#define RCTL_MENU	 10
#define RCTL_UP		 11
#define RCTL_DOWN	 12
#define RCTL_LEFT	 13
#define RCTL_RIGHT	 14
#define RCTL_SELECT	 15
#define RCTL_NUMKEYS 16

// define bitmask selectors for each key
#define RCTL_BM_STOP	(1 << RCTL_STOP)
#define RCTL_BM_PLAY	(1 << RCTL_PLAY)
#define RCTL_BM_PREV	(1 << RCTL_PREV)
#define RCTL_BM_NEXT	(1 << RCTL_NEXT)
#define RCTL_BM_FWD		(1 << RCTL_FWD)
#define RCTL_BM_BACK	(1 << RCTL_BACK)
#define RCTL_BM_PAUSE	(1 << RCTL_PAUSE)
#define RCTL_BM_VOLUP	(1 << RCTL_VOLUP)
#define RCTL_BM_VOLDN	(1 << RCTL_VOLDN)
#define RCTL_BM_MUTE	(1 << RCTL_MUTE)
#define RCTL_BM_MENU	(1 << RCTL_MENU)
#define RCTL_BM_UP		(1 << RCTL_UP)
#define RCTL_BM_DOWN	(1 << RCTL_DOWN)
#define RCTL_BM_LEFT	(1 << RCTL_LEFT)
#define RCTL_BM_RIGHT	(1 << RCTL_RIGHT)
#define RCTL_BM_SELECT	(1 << RCTL_SELECT)


class CRCtlKeys :
	public CComObjectRoot,
	public IDispatchImpl<IRemoteControlKeys, &IID_IRemoteControlKeys, &LIBID_STBIHOSTLib>
{
	CMainWnd* m_pMainWnd;
	BYTE m_bytTrans;
	ULONG m_bmKeys;

public:

	DECLARE_NO_REGISTRY()
	DECLARE_NOT_AGGREGATABLE(CRCtlKeys)
	DECLARE_PROTECT_FINAL_CONSTRUCT()

	BEGIN_CATEGORY_MAP(CRCtlKeys)
	END_CATEGORY_MAP()

	BEGIN_COM_MAP(CRCtlKeys)
		COM_INTERFACE_ENTRY(IRemoteControlKeys)
		COM_INTERFACE_ENTRY(IDispatch)
	END_COM_MAP()

	CRCtlKeys() :
		m_pMainWnd(NULL),
		m_bytTrans(0),
		m_bmKeys(0)
	{ }

	~CRCtlKeys()
	{ }

	VOID SetInst(CMainWnd* pMainWnd)
	{
		ASSERT(pMainWnd);
		m_pMainWnd = pMainWnd;
	}

	// IRemoteControlKeys
	STDMETHOD(BeginRequest)();
	STDMETHOD(EndRequest)();
	STDMETHOD(ReleaseRequest)();
	STDMETHOD(get_Stop)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Stop)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Play)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Play)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Previous)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Previous)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Next)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Next)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Forward)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Forward)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Backward)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Backward)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Pause)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Pause)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_VolumeUp)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_VolumeUp)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_VolumeDown)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_VolumeDown)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Mute)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Mute)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Menu)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Menu)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Up)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Up)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Down)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Down)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Left)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Left)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Right)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Right)(/*[in]*/ VARIANT_BOOL newVal);
	STDMETHOD(get_Select)(/*[out, retval]*/ VARIANT_BOOL* pVal);
	STDMETHOD(put_Select)(/*[in]*/ VARIANT_BOOL newVal);
};

#endif	// _RCTLKEYS_H_1001F5AE_D616_417F_A7DB_4DDCE25918AE_

⌨️ 快捷键说明

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