1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
// MainDlg.h : Declaration of the CMainDlg
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#ifndef __MAINDLG_H_
#define __MAINDLG_H_
#include "resource.h" // main symbols
#include <atlhost.h>
#include "wmp.h"
#include "wmpids.h"
#include "RemoteHost.h"
static _ATL_FUNC_INFO PlayStateChangeInfo = { CC_STDCALL, VT_EMPTY, 1, {VT_I4} };
/////////////////////////////////////////////////////////////////////////////
// CMainDlg
class CMainDlg :
public IDispEventSimpleImpl<IDC_WMP, CMainDlg, &DIID__WMPOCXEvents>,
public CAxDialogImpl<CMainDlg>
{
public:
CMainDlg();
~CMainDlg();
enum { IDD = IDD_MAINDLG };
BEGIN_MSG_MAP(CMainDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
COMMAND_ID_HANDLER(IDC_OPENURL, OnOpenURL)
COMMAND_ID_HANDLER(IDC_GOTOML, OnGoToML)
COMMAND_HANDLER(IDC_NEXT, BN_CLICKED, OnBnClickedNext)
COMMAND_HANDLER(IDC_PREVIOUS, BN_CLICKED, OnBnClickedPrevious)
COMMAND_HANDLER(IDC_VOLUMEPLUS, BN_CLICKED, OnBnClickedVolumeplus)
COMMAND_HANDLER(IDC_VOLUMEMOINS, BN_CLICKED, OnBnClickedVolumemoins)
COMMAND_HANDLER(IDC_MORCEAUPLUS, BN_CLICKED, OnBnClickedMorceauplus)
COMMAND_HANDLER(IDC_VOLUME0, BN_CLICKED, OnBnClickedVolume0)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
END_MSG_MAP()
BEGIN_SINK_MAP(CMainDlg)
SINK_ENTRY_INFO(IDC_WMP, DIID__WMPOCXEvents, DISPID_WMPCOREEVENT_PLAYSTATECHANGE, OnPlayStateChange, &PlayStateChangeInfo)
END_SINK_MAP()
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnOpenURL(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnGoToML(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
HRESULT STDMETHODCALLTYPE OnPlayStateChange(long NewState);
private:
CAxWindow *m_pView;
CComPtr<IWMPPlayer4> m_spPlayer;
public:
LRESULT OnBnClickedNext(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnBnClickedPrevious(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnBnClickedVolumeplus(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnBnClickedVolumemoins(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnBnClickedMorceauplus(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnBnClickedVolume0(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
private:
void SendSomeData();
public:
};
#endif //__MAINDLG_H_ |
Partager